]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Drop 'empty' filed from 'qemuDomainDiskInfo'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 3 Feb 2026 16:53:09 +0000 (17:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 12 Feb 2026 15:45:34 +0000 (16:45 +0100)
The value is no longer used so drop the field and also the code which
fetches it from the QMP command reply.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.h
src/qemu/qemu_monitor_json.c
tests/qemumonitorjsontest.c

index 20d6bd316cb3e4c4b1816ea664820701b352fa39..0f975a22fc9685dbeb6ac59f6aa8004bcef35528 100644 (file)
@@ -360,7 +360,6 @@ struct qemuDomainDiskInfo {
     bool removable;
     bool tray;
     bool tray_open;
-    bool empty;
     int io_status;
 };
 
index a7e095a64895b511fac2aaa14c3bc194ec2dc66e..bf9e59c0b675ee71461a44244901cf354501f973 100644 (file)
@@ -2323,7 +2323,6 @@ qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
 
     for (i = 0; i < virJSONValueArraySize(devices); i++) {
         virJSONValue *dev;
-        virJSONValue *image;
         struct qemuDomainDiskInfo info = { false };
         const char *thisdev;
         const char *status;
@@ -2358,11 +2357,6 @@ qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
         if (virJSONValueObjectGetBoolean(dev, "tray_open", &info.tray_open) == 0)
             info.tray = true;
 
-        /* presence of 'inserted' notifies that a medium is in the device */
-        if (!(image = virJSONValueObjectGetObject(dev, "inserted"))) {
-            info.empty = true;
-        }
-
         /* Missing io-status indicates no error */
         if ((status = virJSONValueObjectGetString(dev, "io-status"))) {
             info.io_status = qemuMonitorBlockIOStatusToError(status);
index efa2400750ddd860fc01a3fa8742d6aa3077d64f..699b75ce2d80d3da8a840e2869cc740fab7286e2 100644 (file)
@@ -1353,10 +1353,8 @@ testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *opaque)
 static void
 testQemuMonitorJSONGetBlockInfoPrint(const struct qemuDomainDiskInfo *d)
 {
-    VIR_TEST_VERBOSE("removable: %d, tray: %d, tray_open: %d, empty: %d, "
-                     "io_status: %d",
-                     d->removable, d->tray, d->tray_open, d->empty,
-                     d->io_status);
+    VIR_TEST_VERBOSE("removable: %d, tray: %d, tray_open: %d, io_status: %d",
+                     d->removable, d->tray, d->tray_open, d->io_status);
 }
 
 
@@ -1418,7 +1416,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
 
     info->removable = true;
     info->tray = true;
-    info->empty = true;
 
     if (virHashAddEntry(expectedBlockDevices, "ide0-1-1", info) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",