qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 532cee: iscsi: Fix check for username


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 532cee: iscsi: Fix check for username
Date: Tue, 10 Mar 2015 12:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 532cee4184877053398a2bdae4edc965084fc79e
      
https://github.com/qemu/qemu/commit/532cee4184877053398a2bdae4edc965084fc79e
  Author: Stefan Weil <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Fix check for username

The variable user in struct iscsi_url is a character array, not a pointer.
Therefore its address will never be NULL.

clang reports this error:

block/iscsi.c:1329:20: warning:
 comparison of array 'iscsi_url->user' not equal to a null pointer
 is always true [-Wtautological-pointer-compare]

Reviewed-by: Peter Lieven <address@hidden>
Acked-by: Peter Lieven <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9a7dcb711bdaf4082bf333dbecfeb729bbff1f8e
      
https://github.com/qemu/qemu/commit/9a7dcb711bdaf4082bf333dbecfeb729bbff1f8e
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M scripts/kvm/kvm_stat

  Log Message:
  -----------
  kvm_stat: add column headers to text UI

The curses user interface shows both the accumulated total and the
current event counts.  Add column headers so it's clear what the numbers
mean.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Ademar Reis <address@hidden>
Reviewed-by: Wei Huang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 811c5727765eba00824c29a696350d4780d86c19
      
https://github.com/qemu/qemu/commit/811c5727765eba00824c29a696350d4780d86c19
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M Makefile
    A scripts/kvm/kvm_stat.texi

  Log Message:
  -----------
  kvm_stat: add kvm_stat.1 man page

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Ademar Reis <address@hidden>
Reviewed-by: Wei Huang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 24fa90499f8b24bcba2960a3316d797f9b80b5e9
      
https://github.com/qemu/qemu/commit/24fa90499f8b24bcba2960a3316d797f9b80b5e9
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M util/qemu-thread-posix.c

  Log Message:
  -----------
  qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK

PTHREAD_MUTEX_ERRORCHECK is completely broken with respect to fork.
The way to safely do fork is to bring all threads to a quiescent
state by acquiring locks (either in callers---as we do for the
iothread mutex---or using pthread_atfork's prepare callbacks)
and then release them in the child.

The problem is that releasing error-checking locks in the child
fails under glibc with EPERM, because the mutex stores a different
owner tid than the duplicated thread in the child process.  We
could make it work for locks acquired via pthread_atfork, by
recreating the mutex in the child instead of unlocking it
(we know that there are no other threads that could have taken
the mutex; but when the lock is acquired in fork's caller
that would not be possible.

The simplest solution is just to forgo error checking.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6
      
https://github.com/qemu/qemu/commit/21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M util/rcu.c

  Log Message:
  -----------
  rcu: handle forks safely

After forking, only the calling thread is duplicated in the child process.
The call_rcu thread has to be recreated in the child.  Exploit the fact
that only one thread exists (same as when constructors run), and just redo
the entire initialization to ensure the threads are in the proper state.

The only additional things to do are emptying the list of threads
registered with RCU, and unlocking the lock that was taken in the prepare
callback (implementations are allowed to fail pthread_mutex_init()
if the mutex is still locked).

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: cba7054928b10a7fda57c64807451bbc9a31e42e
      
https://github.com/qemu/qemu/commit/cba7054928b10a7fda57c64807451bbc9a31e42e
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M exec.c

  Log Message:
  -----------
  cpus: initialize cpu->memory_dispatch

This fixes a NULL pointer dereference in s390x-softmmu.

On pretty much all other architectures, creating an MMIO region calls
cpu_reload_memory_map.  On s390, however, there are no MMIO regions
and everything is done via hypercalls.

Fixes: 9d82b5a792236db31a75b9db5c93af69ac07c7c5
Reported-by: Christian Borntraeger <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: fa617181839741727d0067ea68807133f498f29b
      
https://github.com/qemu/qemu/commit/fa617181839741727d0067ea68807133f498f29b
  Author: Markus Armbruster <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M hw/scsi/esp-pci.c
    M hw/scsi/lsi53c895a.c
    M hw/scsi/megasas.c
    M hw/scsi/scsi-bus.c

  Log Message:
  -----------
  scsi: Clean up duplicated error in legacy if=scsi code

Commit a818a4b changed scsi_bus_legacy_handle_cmdline() to report
errors from scsi_bus_legacy_add_drive() with error_report() in
addition to returning them.  That's inappropriate.

Two kinds of callers:

1. realize methods (devices "esp", "virtio-scsi-device" and
   "spapr-vscsi")

   The error object gets passed up the call chain until it gets
   reported again and freed.

   Example:

   $ qemu-system-arm -M virt -S -display none \
   > -drive if=scsi,id=foo,bus=1,file=tmp.qcow2 \
   > -device nec-usb-xhci -device usb-storage,drive=foo \
   > -device virtio-scsi-pci
   qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Property 
'scsi-disk.drive' can't take value 'foo', it's in use
   qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Setting drive 
property failed
   qemu-system-arm: -device virtio-scsi-pci: Setting drive property failed
   qemu-system-arm: -device virtio-scsi-pci: Device initialization failed
   qemu-system-arm: -device virtio-scsi-pci: Device 'virtio-scsi-pci' could not 
be initialized

   The second message in this error cascade comes from
   scsi_bus_legacy_handle_cmdline().  The error object then gets
   passed up to the qdev_init() called from
   virtio_scsi_pci_init_pci(), which reports it again.

2. init methods (devices "am53c974", "dc390", "lsi53c895a",
   "lsi53c810", "megasas", "megasas-gen2")

   init methods need to report their errors with qerror_report().
   These don't.  The inappropriate error_report() papers over the bug.

   error_report() isn't the same as qerror_report() in QMP context,
   but this can't actually happen: QMP can still only hot-plug, and
   callers call scsi_bus_legacy_handle_cmdline() only on cold-plug.
   Except for sysbus_esp_realize(), but that can't be hot-plugged at
   all, as far as I can tell.

Fix the init methods and drop the inappropriate error_report() in
scsi_bus_legacy_handle_cmdline().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9b3d111ad90886546614b2579eedcb4675b35d14
      
https://github.com/qemu/qemu/commit/9b3d111ad90886546614b2579eedcb4675b35d14
  Author: Markus Armbruster <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/core/qdev-properties-system.c
    M hw/scsi/scsi-bus.c
    M hw/usb/dev-storage.c
    M include/hw/qdev-properties.h

  Log Message:
  -----------
  hw: Propagate errors through qdev_prop_set_drive()

Three kinds of callers:

1. On failure, report the error and abort

   Passing &error_abort does the job.  No functional change.

2. On failure, report the error and exit()

   This is qdev_prop_set_drive_nofail().  Error reporting moves from
   qdev_prop_set_drive() to its caller.  Because hiding away the error
   in the monitor right before exit() isn't helpful, replace
   qerror_report_err() by error_report_err().  Shouldn't make a
   difference, because qdev_prop_set_drive_nofail() should never be
   used in QMP context.

3. On failure, report the error and recover

   This is usb_msd_init() and scsi_bus_legacy_add_drive().  Error
   reporting and freeing the error object moves from
   qdev_prop_set_drive() to its callers.

   Because usb_msd_init() can't run in QMP context, replace
   qerror_report_err() by error_report_err() there.

   No functional change.

   scsi_bus_legacy_add_drive() calling qerror_report_err() is of
   course inappropriate, but this commit merely makes it more obvious.
   The next one will clean it up.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 390e90a90736f98ca47f2e767d7f2a15d68d6bc4
      
https://github.com/qemu/qemu/commit/390e90a90736f98ca47f2e767d7f2a15d68d6bc4
  Author: Markus Armbruster <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M hw/scsi/scsi-bus.c

  Log Message:
  -----------
  scsi: Improve error reporting for invalid drive property

When setting "realized" fails, scsi_bus_legacy_add_drive() passes the
error to qerror_report_err(), then returns an unspecific "Setting
drive property failed" error, which is reported further up the call
chain.

Example:

    $ qemu-system-x86_64 -nodefaults -S -display none \
    > -drive if=scsi,id=foo,file=tmp.qcow2 -global isa-fdc.driveA=foo
    qemu-system-x86_64: -drive if=scsi,id=foo,file=tmp.qcow2: Property 
'scsi-disk.drive' can't take value 'foo', it's in use
    qemu-system-x86_64: Setting drive property failed
    qemu-system-x86_64: Initialization of device lsi53c895a failed: Device 
initialization failed

Clean up the obvious way: simply return the original error to the
caller.  Gets rid of the second message in the above error cascade.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ae071cc851d7150d3a9950c642570830bb85729e
      
https://github.com/qemu/qemu/commit/ae071cc851d7150d3a9950c642570830bb85729e
  Author: Markus Armbruster <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M hw/scsi/esp-pci.c
    M hw/scsi/lsi53c895a.c
    M hw/scsi/megasas.c

  Log Message:
  -----------
  scsi: Convert remaining PCI HBAs to realize()

These are "am53c974", "dc390", "lsi53c895a", "lsi53c810", "megasas",
"megasas-gen2".

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ac57622985220de064059971f9ccb00905e9bd04
      
https://github.com/qemu/qemu/commit/ac57622985220de064059971f9ccb00905e9bd04
  Author: Bill Paul <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M target-i386/seg_helper.c

  Log Message:
  -----------
  x86: fix SS selector in SYSRET

According to my reading of the Intel documentation, the SYSRET instruction
is supposed to force the RPL bits of the %ss register to 3 when returning
to user mode. The actual sequence is:

SS.Selector <-- (IA32_STAR[63:48]+8) OR 3; (* RPL forced to 3 *)

However, the code in helper_sysret() leaves them at 0 (in other words, the "OR
3" part of the above sequence is missing). It does set the privilege level
bits of %cs correctly though.

This has caused me trouble with some of my VxWorks development: code that runs
okay on real hardware will crash on QEMU, unless I apply the patch below.

Signed-off-by: Bill Paul <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 23a7a287967089d70a7e30ca4c7421674691c503
      
https://github.com/qemu/qemu/commit/23a7a287967089d70a7e30ca4c7421674691c503
  Author: Peter Maydell <address@hidden>
  Date:   2015-03-10 (Tue, 10 Mar 2015)

  Changed paths:
    M Makefile
    M block/iscsi.c
    M exec.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/core/qdev-properties-system.c
    M hw/scsi/esp-pci.c
    M hw/scsi/lsi53c895a.c
    M hw/scsi/megasas.c
    M hw/scsi/scsi-bus.c
    M hw/usb/dev-storage.c
    M include/hw/qdev-properties.h
    M scripts/kvm/kvm_stat
    A scripts/kvm/kvm_stat.texi
    M target-i386/seg_helper.c
    M util/qemu-thread-posix.c
    M util/rcu.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

- scsi: improvements to error reporting and conversion to realize,
  Coverity/sparse fix for iscsi driver
- RCU fallout: fix -daemonize and s390x system emulation
- KVM: kvm_stat improvements and new man page
- x86: SYSRET fix for VxWorks

# gpg: Signature made Tue Mar 10 10:18:45 2015 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <address@hidden>"
# gpg:                 aka "Paolo Bonzini <address@hidden>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  x86: fix SS selector in SYSRET
  scsi: Convert remaining PCI HBAs to realize()
  scsi: Improve error reporting for invalid drive property
  hw: Propagate errors through qdev_prop_set_drive()
  scsi: Clean up duplicated error in legacy if=scsi code
  cpus: initialize cpu->memory_dispatch
  rcu: handle forks safely
  qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK
  kvm_stat: add kvm_stat.1 man page
  kvm_stat: add column headers to text UI
  iscsi: Fix check for username

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/197605810989...23a7a2879670

reply via email to

[Prev in Thread] Current Thread [Next in Thread]