qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 60fe4f: nbd: Don't export a block device with


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 60fe4f: nbd: Don't export a block device with no medium.
Date: Mon, 30 Jun 2014 08:30:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 60fe4fac22895576973e317d7148b084c31cc64c
      
https://github.com/qemu/qemu/commit/60fe4fac22895576973e317d7148b084c31cc64c
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-06-27 (Fri, 27 Jun 2014)

  Changed paths:
    M blockdev-nbd.c

  Log Message:
  -----------
  nbd: Don't export a block device with no medium.

The device is exported with erroneous values and can't be read.

Before the patch:
$ sudo nbd-client localhost -p 10809 /dev/nbd0 -name floppy0
Negotiation: ..size = 17592186044415MB
bs=1024, sz=18446744073709547520 bytes

$ sudo mount /dev/nbd0 /mnt/tmp/
mount: block device /dev/nbd0 is write-protected, mounting read-only
mount: /dev/nbd0: can't read superblock

After the patch:
(qemu) nbd_server_add ide0-hd0
(qemu) nbd_server_add floppy0
Device 'floppy0' has no medium

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


  Commit: 8c5d1abbb79193dca8e4823ef53d8d1e650362ae
      
https://github.com/qemu/qemu/commit/8c5d1abbb79193dca8e4823ef53d8d1e650362ae
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-06-27 (Fri, 27 Jun 2014)

  Changed paths:
    M nbd.c

  Log Message:
  -----------
  nbd: Don't validate from and len in NBD_CMD_DISC.

These values aren't used in this case.

Currently, the from field in the request sent by the nbd kernel module leading
to a false error message when ending the connection with the client.

$ qemu-nbd some.img -v
// After nbd-client -d /dev/nbd0
nbd.c:nbd_trip():L1031: From: 18446744073709551104, Len: 0, Size: 20971520,
Offset: 0
nbd.c:nbd_trip():L1032: requested operation past EOF--bad client?
nbd.c:nbd_receive_request():L638: read failed

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


  Commit: 27e5eae4577316f7e86a56eb7363d4e78f79e3e5
      
https://github.com/qemu/qemu/commit/27e5eae4577316f7e86a56eb7363d4e78f79e3e5
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M blockdev-nbd.c
    M qemu-nbd.c

  Log Message:
  -----------
  nbd: Shutdown socket before closing.

This forces finishing data sending to client before closing the socket like in
exports listing or replying with NBD_REP_ERR_UNSUP cases.

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


  Commit: f5076b5a759cb9b25ab377bbad453801db78a43e
      
https://github.com/qemu/qemu/commit/f5076b5a759cb9b25ab377bbad453801db78a43e
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M include/block/nbd.h
    M nbd.c

  Log Message:
  -----------
  nbd: Handle fixed new-style clients.

When this flag is set, the server tells the client that it can send another
option if the server received a request with an option that it doesn't
understand instead of directly closing the connection.

Also add link to the most up-to-date documentation.

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


  Commit: 32d7d2e068756874518f97d5a114e43d8977980b
      
https://github.com/qemu/qemu/commit/32d7d2e068756874518f97d5a114e43d8977980b
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M include/block/nbd.h
    M nbd.c

  Log Message:
  -----------
  nbd: Handle NBD_OPT_LIST option.

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


  Commit: e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3
      
https://github.com/qemu/qemu/commit/e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3
  Author: Roger Pau Monne <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M hw/char/cadence_uart.c
    M hw/char/serial.c
    M hw/char/virtio-console.c
    M hw/usb/redirect.c
    M monitor.c

  Log Message:
  -----------
  serial: poll the serial console with G_IO_HUP

On FreeBSD polling a master pty while the other end is not connected
with G_IO_OUT only results in an endless wait. This is different from
the Linux behaviour, that returns immediately. In order to demonstrate
this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which
makes the code behave the same way on both Linux and FreeBSD).

Signed-off-by: Roger Pau Monné <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: Michael Tokarev <address@hidden>
Cc: "Andreas Färber" <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: address@hidden
[Add hw/char/cadence_uart.c too. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: af35e5e1fb8c334498c61cb9a568719483955a8f
      
https://github.com/qemu/qemu/commit/af35e5e1fb8c334498c61cb9a568719483955a8f
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M tests/test-qmp-event.c

  Log Message:
  -----------
  tests/test-qmp-event: fix for GLib < 2.31

On old GLib, the test needs a g_thread_init call.

Reported-by: Wenchao Xia <address@hidden>
Tested-by: Wenchao Xia <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ec9fe956d5c728da770db5ec9bc429080ccb5043
      
https://github.com/qemu/qemu/commit/ec9fe956d5c728da770db5ec9bc429080ccb5043
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M hw/char/cadence_uart.c
    M hw/char/serial.c
    M hw/char/virtio-console.c
    M hw/usb/redirect.c
    M monitor.c
    M tests/test-qmp-event.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/small-fixes' into staging

* remotes/bonzini/small-fixes:
  tests/test-qmp-event: fix for GLib < 2.31
  serial: poll the serial console with G_IO_HUP

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


  Commit: 8954000b9ef88db809d23ce58a3221eacdf3b773
      
https://github.com/qemu/qemu/commit/8954000b9ef88db809d23ce58a3221eacdf3b773
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M blockdev-nbd.c
    M include/block/nbd.h
    M nbd.c
    M qemu-nbd.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/nbd-next' into staging

* remotes/bonzini/nbd-next:
  nbd: Handle NBD_OPT_LIST option.
  nbd: Handle fixed new-style clients.
  nbd: Shutdown socket before closing.
  nbd: Don't validate from and len in NBD_CMD_DISC.
  nbd: Don't export a block device with no medium.

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


Compare: https://github.com/qemu/qemu/compare/a4b31047c851...8954000b9ef8

reply via email to

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