]> git.proxmox.com Git - mirror_qemu.git/blobdiff - blockdev.c
block: check for RESIZE blocker in the QMP command, not bdrv_truncate()
[mirror_qemu.git] / blockdev.c
index 03ab153d0117a36584a34f33c07f1a899f9d6294..e8bfa3c6608545b977cc29deb99538db9b133bab 100644 (file)
@@ -1819,6 +1819,11 @@ void qmp_block_resize(bool has_device, const char *device,
         return;
     }
 
+    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) {
+        error_set(errp, QERR_DEVICE_IN_USE, device);
+        return;
+    }
+
     /* complete all in-flight operations before resizing the device */
     bdrv_drain_all();