Skip to contentSkip to conversation

Block layer patches

GIT PULL Applied Kevin Wolf 2 participants 8 messages Jul 8, 2019 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

The following changes since commit df34fe314b5da628bc9a2664fb1b887bc0a6cc6d:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190708' into staging (2019-07-08 14:23:32 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to f7077c9860a438087c2d9a8cc27cb8438c98a748:

qcow2: Allow -o compat=v3 during qemu-img amend (2019-07-08 16:00:31 +0200)

----------------------------------------------------------------
Block layer patches:

- virtio-scsi: Fix request resubmission after I/O error with iothreads
- qcow2: Fix missing v2/v3 subformat aliases for amend
- qcow(1): More specific error message for wrong format version
- MAINTAINERS: update RBD block maintainer

----------------------------------------------------------------
Eric Blake (1):
qcow2: Allow -o compat=v3 during qemu-img amend

Jason Dillaman (1):
MAINTAINERS: update RBD block maintainer

John Snow (1):
block/qcow: Improve error when opening qcow2 files as qcow

Stefan Hajnoczi (3):
vl: add qemu_add_vm_change_state_handler_prio()
qdev: add qdev_add_vm_change_state_handler()
virtio-scsi: restart DMA after iothread

 include/hw/qdev-core.h            |  5 ++++
 include/sysemu/sysemu.h           |  2 ++
 block/qcow.c                      |  7 ++++-
 block/qcow2.c                     |  6 ++--
 hw/core/vm-change-state-handler.c | 61 +++++++++++++++++++++++++++++++++++++++
 hw/scsi/scsi-bus.c                |  4 +--
 hw/virtio/virtio.c                |  4 +--
 vl.c                              | 59 +++++++++++++++++++++++++++++--------
 MAINTAINERS                       |  2 +-
 hw/core/Makefile.objs             |  1 +
 10 files changed, 130 insertions(+), 21 deletions(-)
 create mode 100644 hw/core/vm-change-state-handler.c
author
#1 lore raw

[Qemu-devel] [PULL 1/6] vl: add qemu_add_vm_change_state_handler_prio()

From: Stefan Hajnoczi <[email protected]>

Add an API for registering vm change state handlers with a well-defined ordering. This is necessary when handlers depend on each other.

Small coding style fixes are included to make checkpatch.pl happy.

---
 include/sysemu/sysemu.h |  2 ++
 vl.c                    | 59 ++++++++++++++++++++++++++++++++---------
 2 files changed, 49 insertions(+), 12 deletions(-)
include/sysemu/sysemu.h +2 -0
index 61579ae71e..984c439ac9 100644
@@ -29,6 +29,8 @@ typedef void VMChangeStateHandler(void *opaque, int running, RunState state);
 
 VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
                                                      void *opaque);
+VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(
+        VMChangeStateHandler *cb, void *opaque, int priority);
 void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
 void vm_state_notify(int running, RunState state);
 
vl.c +47 -12

90 lines not on this page · raw message

Signature · 1 line
2.20.1
author
#2 lore raw

[Qemu-devel] [PULL 3/6] virtio-scsi: restart DMA after iothread

In reply to Kevin Wolf

From: Stefan Hajnoczi <[email protected]>

When the 'cont' command resumes guest execution the vm change state handlers are invoked. Unfortunately there is no explicit ordering between classic qemu_add_vm_change_state_handler() callbacks. When two layers of code both use vm change state handlers, we don't control which handler runs first.

virtio-scsi with iothreads hits a deadlock when a failed SCSI command is restarted and completes before the iothread is re-initialized.

This patch uses the new qdev_add_vm_change_state_handler() API to guarantee that virtio-scsi's virtio change state handler executes before the SCSI bus children. This way DMA is restarted after the iothread has re-initialized.

---
 hw/scsi/scsi-bus.c | 4 ++--
 hw/virtio/virtio.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
hw/scsi/scsi-bus.c +2 -2
index 196136a307..fdc3a0e4e0 100644
@@ -207,8 +207,8 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)
         error_propagate(errp, local_err);
         return;
     }
-    dev->vmsentry = qemu_add_vm_change_state_handler(scsi_dma_restart_cb,
-                                                     dev);
+    dev->vmsentry = qdev_add_vm_change_state_handler(DEVICE(dev),
+            scsi_dma_restart_cb, dev);
 }
 
 static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp)
hw/virtio/virtio.c +2 -2
index 18f9f4c372..a94ea18a9c 100644
@@ -2362,8 +2362,8 @@ void virtio_init(VirtIODevice *vdev, const char *name,
     } else {
         vdev->config = NULL;
     }
-    vdev->vmstate = qemu_add_vm_change_state_handler(virtio_vmstate_change,
-                                                     vdev);
+    vdev->vmstate = qdev_add_vm_change_state_handler(DEVICE(vdev),
+            virtio_vmstate_change, vdev);
     vdev->device_endian = virtio_default_endian();
     vdev->use_guest_notifier_mask = true;
 }
Signature · 1 line
2.20.1
author
#3 lore raw

[Qemu-devel] [PULL 5/6] MAINTAINERS: update RBD block maintainer

In reply to Kevin Wolf

From: Jason Dillaman <[email protected]>

Remove Josh as per his request since he is no longer the upstream RBD tech lead. Add myself as the maintainer since I am the current RBD tech lead.

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 2cce50287a..cc9636b43a 100644
@@ -2385,7 +2385,7 @@ S: Supported
 F: block/vmdk.c
 
 RBD
-M: Josh Durgin <[email protected]>
+M: Jason Dillaman <[email protected]>
 L: [email protected]
 S: Supported
 F: block/rbd.c
Signature · 1 line
2.20.1
author
#4 lore raw

[Qemu-devel] [PULL 2/6] qdev: add qdev_add_vm_change_state_handler()

In reply to Kevin Wolf

From: Stefan Hajnoczi <[email protected]>

Children sometimes depend on their parent's vm change state handler having completed. Add a vm change state handler API for devices that guarantees tree depth ordering.

---
 include/hw/qdev-core.h            |  5 +++
 hw/core/vm-change-state-handler.c | 61 +++++++++++++++++++++++++++++++
 hw/core/Makefile.objs             |  1 +
 3 files changed, 67 insertions(+)
 create mode 100644 hw/core/vm-change-state-handler.c
include/hw/qdev-core.h +5 -0
index fa55dc10ae..e157fc4acd 100644
@@ -6,6 +6,7 @@
 #include "qom/object.h"
 #include "hw/irq.h"
 #include "hw/hotplug.h"
+#include "sysemu/sysemu.h"
 
 enum {
     DEV_NVECTORS_UNSPECIFIED = -1,
@@ -450,4 +451,8 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
 void device_listener_register(DeviceListener *listener);
 void device_listener_unregister(DeviceListener *listener);
 
+VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
+                                                     VMChangeStateHandler *cb,
+                                                     void *opaque);
+
 #endif
hw/core/vm-change-state-handler.c new file +61 -0

61 lines not on this page · raw message

hw/core/Makefile.objs +1 -0
index 585b734358..f8481d959f 100644
@@ -7,6 +7,7 @@ common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o
 common-obj-y += irq.o
 common-obj-y += hotplug.o
 common-obj-$(CONFIG_SOFTMMU) += nmi.o
+common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o
 
 common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
Signature · 1 line
2.20.1
author
#5 lore raw

[Qemu-devel] [PULL 4/6] block/qcow: Improve error when opening qcow2 files as qcow

In reply to Kevin Wolf

From: John Snow <[email protected]>

---
 block/qcow.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
block/qcow.c +6 -1
index 6dee5bb792..5bdf72ba33 100644
@@ -156,7 +156,12 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
         goto fail;
     }
     if (header.version != QCOW_VERSION) {
-        error_setg(errp, "Unsupported qcow version %" PRIu32, header.version);
+        error_setg(errp, "qcow (v%d) does not support qcow version %" PRIu32,
+                   QCOW_VERSION, header.version);
+        if (header.version == 2 || header.version == 3) {
+            error_append_hint(errp, "Try the 'qcow2' driver instead.\n");
+        }
+
         ret = -ENOTSUP;
         goto fail;
     }
Signature · 1 line
2.20.1
author
#6 lore raw

[Qemu-devel] [PULL 6/6] qcow2: Allow -o compat=v3 during qemu-img amend

In reply to Kevin Wolf

From: Eric Blake <[email protected]>

Commit b76b4f60 allowed '-o compat=v3' as an alias for the less-appealing '-o compat=1.1' for 'qemu-img create' since we want to use the QMP form as much as possible, but forgot to do likewise for qemu-img amend. Also, it doesn't help that '-o help' doesn't list our new preferred spellings.

---
 block/qcow2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block/qcow2.c +3 -3
index 2a59eb27fe..039bdc2f7e 100644
@@ -4823,9 +4823,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
             compat = qemu_opt_get(opts, BLOCK_OPT_COMPAT_LEVEL);
             if (!compat) {
                 /* preserve default */
-            } else if (!strcmp(compat, "0.10")) {
+            } else if (!strcmp(compat, "0.10") || !strcmp(compat, "v2")) {
                 new_version = 2;
-            } else if (!strcmp(compat, "1.1")) {
+            } else if (!strcmp(compat, "1.1") || !strcmp(compat, "v3")) {
                 new_version = 3;
             } else {
                 error_setg(errp, "Unknown compatibility level %s", compat);
@@ -5098,7 +5098,7 @@ static QemuOptsList qcow2_create_opts = {
         {
             .name = BLOCK_OPT_COMPAT_LEVEL,
             .type = QEMU_OPT_STRING,
-            .help = "Compatibility level (0.10 or 1.1)"
+            .help = "Compatibility level (v2 [0.10] or v3 [1.1])"
         },
         {
             .name = BLOCK_OPT_BACKING_FILE,
Signature · 1 line
2.20.1
#7 lore raw
In reply to Kevin Wolf
Quoted 13 lines · Kevin Wolf

The following changes since commit df34fe314b5da628bc9a2664fb1b887bc0a6cc6d:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190708' into staging (2019-07-08 14:23:32 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to f7077c9860a438087c2d9a8cc27cb8438c98a748:

qcow2: Allow -o compat=v3 during qemu-img amend (2019-07-08 16:00:31 +0200)

Quoted 8 lines

----------------------------------------------------------------
Block layer patches:

- virtio-scsi: Fix request resubmission after I/O error with iothreads
- qcow2: Fix missing v2/v3 subformat aliases for amend
- qcow(1): More specific error message for wrong format version
- MAINTAINERS: update RBD block maintainer

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.

-- PMM