[PATCH 5/8] conf: Add disk iothread bus check in device post parse

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

 



Add a check in the device post processing for any disk using iothread to be
using the proper bus (which happens to be only virtio for now).

This check could have been added in device parse, except that if a domain
was running with such a configuration (albeit doing nothing), then it
would disappear. Found while working through code to add iothreads for
virtio-scsi-{pci,ccw}.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a3c50f1..fd7579a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
             return -1;
         }
 
+        if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("disk '%s' improperly configured, iothread "
+                             "only supported on virtio bus"), disk->dst);
+            return -1;
+        }
+
         if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
             virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0)
             return -1;
-- 
2.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]