]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Drop 'removable' field from 'qemuDomainDiskInfo'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 3 Feb 2026 17:01:15 +0000 (18:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 12 Feb 2026 15:45:34 +0000 (16:45 +0100)
The only real use was in 'qemuProcessRefreshDiskProps' where it guarded
assignment of 'tray' status. Since qemu doesn't actually report any tray
status for devices which don't have a tray there's no need for the extra
guard.

Remove the field completely.

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
src/qemu/qemu_process.c
tests/qemumonitorjsontest.c

index 0f975a22fc9685dbeb6ac59f6aa8004bcef35528..06e2f92ac3d6dca00048f28e1f25e023e261037b 100644 (file)
@@ -357,7 +357,6 @@ struct _qemuDomainVcpuPrivate {
 
 
 struct qemuDomainDiskInfo {
-    bool removable;
     bool tray;
     bool tray_open;
     int io_status;
index bf9e59c0b675ee71461a44244901cf354501f973..1b05c713ea8857b5abb3132dd43d42a3b61817c4 100644 (file)
@@ -2346,13 +2346,6 @@ qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
             return -1;
         }
 
-        if (virJSONValueObjectGetBoolean(dev, "removable", &info.removable) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("cannot read %1$s value"),
-                           "removable");
-            return -1;
-        }
-
         /* 'tray_open' is present only if the device has a tray */
         if (virJSONValueObjectGetBoolean(dev, "tray_open", &info.tray_open) == 0)
             info.tray = true;
index ba8bda0f99fe5ccd8abe0299c01a611bdb8f140a..d6ff9c96fcb0b9819a3bd3ac124fad4d15b9812c 100644 (file)
@@ -9592,13 +9592,11 @@ qemuProcessRefreshDiskProps(virDomainDiskDef *disk,
 {
     qemuDomainDiskPrivate *diskpriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
 
-    if (info->removable) {
-        if (info->tray) {
-            if (info->tray_open)
-                disk->tray_status = VIR_DOMAIN_DISK_TRAY_OPEN;
-            else
-                disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
-        }
+    if (info->tray) {
+        if (info->tray_open)
+            disk->tray_status = VIR_DOMAIN_DISK_TRAY_OPEN;
+        else
+            disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
     }
 
     diskpriv->tray = info->tray;
index 699b75ce2d80d3da8a840e2869cc740fab7286e2..b3aca6a6c38147a348ae82a31c0503835a801abe 100644 (file)
@@ -1353,8 +1353,8 @@ testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *opaque)
 static void
 testQemuMonitorJSONGetBlockInfoPrint(const struct qemuDomainDiskInfo *d)
 {
-    VIR_TEST_VERBOSE("removable: %d, tray: %d, tray_open: %d, io_status: %d",
-                     d->removable, d->tray, d->tray_open, d->io_status);
+    VIR_TEST_VERBOSE("tray: %d, tray_open: %d, io_status: %d",
+                     d->tray, d->tray_open, d->io_status);
 }
 
 
@@ -1403,7 +1403,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
 
     info = g_new0(struct qemuDomainDiskInfo, 1);
 
-    info->removable = true;
     info->tray = true;
 
     if (virHashAddEntry(expectedBlockDevices, "ide0-1-0", info) < 0) {
@@ -1414,7 +1413,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
 
     info = g_new0(struct qemuDomainDiskInfo, 1);
 
-    info->removable = true;
     info->tray = true;
 
     if (virHashAddEntry(expectedBlockDevices, "ide0-1-1", info) < 0) {