qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 203951: scsi: Report error when lun number is


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 203951: scsi: Report error when lun number is in use
Date: Tue, 15 Jul 2014 06:30:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 2039511b8f573165420c86380762ae829dc398d9
      
https://github.com/qemu/qemu/commit/2039511b8f573165420c86380762ae829dc398d9
  Author: Fam Zheng <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

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

  Log Message:
  -----------
  scsi: Report error when lun number is in use

In the case that the lun number is taken by another scsi device, don't
release the existing device siliently, but report an error to user.

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


  Commit: 7b3621f47a990c5099c6385728347f69a8d0e55c
      
https://github.com/qemu/qemu/commit/7b3621f47a990c5099c6385728347f69a8d0e55c
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

  Changed paths:
    M qemu-char.c

  Log Message:
  -----------
  qemu-char: fix deadlock with "-monitor pty"

qemu_chr_be_generic_open cannot be called with the write lock taken,
because it calls client code that may call qemu_chr_fe_write.  This
actually happens for the monitor:

    0x00007ffff27dbf79 in __GI_raise (address@hidden)
    0x00007ffff27df388 in __GI_abort ()
    0x00005555555ef489 in error_exit (err=<optimized out>, address@hidden 
<__func__.5959> "qemu_mutex_lock")
    0x00005555558f9080 in qemu_mutex_lock (address@hidden)
    0x0000555555713936 in qemu_chr_fe_write (s=0x555556248a30, address@hidden 
"QEMU 2.0.90 monitor - type 'help' for more information\r\n", len=56)
    0x00005555556217fd in monitor_flush_locked (address@hidden)
    0x0000555555621a12 in monitor_flush_locked (mon=0x555556251fd0)
    monitor_puts (address@hidden, str=0x55555634bfa7 "", address@hidden "QEMU 
2.0.90 monitor - type 'help' for more information\n")
    0x0000555555624359 in monitor_vprintf (mon=0x555556251fd0, fmt=<optimized 
out>, ap=<optimized out>)
    0x0000555555624414 in monitor_printf (mon=<optimized out>, address@hidden 
"QEMU %s monitor - type 'help' for more information\n")
    0x0000555555629806 in monitor_event (opaque=0x555556251fd0, 
event=<optimized out>)
    0x000055555571343c in qemu_chr_be_generic_open (s=0x555556248a30)

To avoid this, defer the call to an idle callback, which will be
called as soon as the main loop is re-entered.  In order to simplify
the cleanup and do it in one place only, change pty_chr_close to
call pty_chr_state.

To reproduce, run with "-monitor pty", then try to read from the
slave /dev/pts/FOO that it creates.

Fixes: 9005b2a7589540a3733b3abdcfbccfe7746cd1a1
Reported-by: Li Liang <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: f702e62a193e9ddb41cef95068717e5582b39a64
      
https://github.com/qemu/qemu/commit/f702e62a193e9ddb41cef95068717e5582b39a64
  Author: Kirill Batuzov <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

  Changed paths:
    M hw/char/serial.c

  Log Message:
  -----------
  serial: change retry logic to avoid concurrency

Whenever serial_xmit fails to transmit a byte it adds a watch that would
call it again when the "line" becomes ready. This results in a retry
chain:
  serial_xmit -> add_watch -> serial_xmit
Each chain is able to transmit one character, and for every character
passed to serial by the guest driver a new chain is spawned.

The problem lays with the fact that a new chain is spawned even when
there is one already waiting on the watch. So there can be several retry
chains waiting concurrently on one "line". Every chain tries to transmit
current character, so character order is not messed up. But also every
chain increases retry counter (tsr_retry). If there are enough
concurrent chains this counter will hit MAX_XMIT_RETRY value and
the character will be dropped.

To reproduce this bug you need to feed serial output to some program
consuming it slowly enough. A python script from bug #1335444
description is an example of such program.

This commit changes retry logic in the following way to avoid
concurrency: instead of spawning a new chain for each character being
transmitted spawn only one and make it transmit characters until FIFO is
empty.

The change consists of two parts:
 - add a do {} while () loop in serial_xmit (diff is a bit erratic
   for this part, diff -w will show actual change),
 - do not call serial_xmit from serial_ioport_write if there is one
   waiting on the watch already.

This should fix another issue causing bug #1335444.

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


  Commit: 1f4e6a069b07869eb5fd3ab711b703b95d363652
      
https://github.com/qemu/qemu/commit/1f4e6a069b07869eb5fd3ab711b703b95d363652
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

  Changed paths:
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: fix with -M pc-i440fx-2.0

Right now starting a machine with virtio-scsi and a <= 2.0 machine type
fails with:

    qemu-system-x86_64: -device virtio-scsi-pci: Property .any_layout not found

This is because the any_layout bit was actually never set after
virtio-scsi was changed to support arbitrary layout for virtio buffers.

(This was just a cleanup and a preparation for virtio 1.0; no guest
actually checks the bit, but the new request parsing algorithms are
tested even with old guest).

Reported-by: David Gilbert <address@hidden>
Reviewed-by: David Gilbert <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 7497bce6c2561f1215fe179e40837774f6243799
      
https://github.com/qemu/qemu/commit/7497bce6c2561f1215fe179e40837774f6243799
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

  Changed paths:
    M hw/char/serial-pci.c

  Log Message:
  -----------
  serial-pci: remove memory regions from BAR before destroying them

Otherwise, hot-unplug of pci-serial-2x trips the assertion
in memory_region_destroy:

    (qemu) device_del gg
    (qemu) qemu-system-x86_64: /work/armbru/tmp/qemu/memory.c:1021: 
memory_region_destroy: Assertion `((&mr->subregions)->tqh_first == ((void 
*)0))' failed.
    Aborted (core dumped)

Reported-by: Markus Armbruster <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 0a9934eef166836c8100fce72f7f837cb8b2ed2b
      
https://github.com/qemu/qemu/commit/0a9934eef166836c8100fce72f7f837cb8b2ed2b
  Author: Peter Maydell <address@hidden>
  Date:   2014-07-14 (Mon, 14 Jul 2014)

  Changed paths:
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/scsi/scsi-bus.c
    M include/hw/virtio/virtio-scsi.h
    M qemu-char.c

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

Misc 2.1 fixes regarding character/serial devices and SCSI.

# gpg: Signature made Mon 14 Jul 2014 16:26:08 BST using RSA key ID 9B4D86F2
# gpg: Can't check signature: public key not found

* remotes/bonzini/tags/for-upstream:
  serial-pci: remove memory regions from BAR before destroying them
  virtio-scsi: fix with -M pc-i440fx-2.0
  serial: change retry logic to avoid concurrency
  qemu-char: fix deadlock with "-monitor pty"
  scsi: Report error when lun number is in use

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


Compare: https://github.com/qemu/qemu/compare/7a6d04e73fdd...0a9934eef166

reply via email to

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