Apart from not littering the command line generator, the added benefit
is that new configs with a FDC will be rejected at define stage.
---
 src/qemu/qemu_command.c |  8 --------
 src/qemu/qemu_process.c | 11 ++++++++++-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 698fef58d..95f99d4d9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2247,14 +2247,6 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd,
         qemuDomainSecretInfoPtr secinfo = diskPriv->secinfo;
         qemuDomainSecretInfoPtr encinfo = diskPriv->encinfo;

-        /* PowerPC pseries based VMs do not support floppy device */
-        if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
-            qemuDomainIsPSeries(def)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("PowerPC pseries machines do not support floppy 
device"));
-            return -1;
-        }
-
         if (disk->info.bootIndex) {
             bootindex = disk->info.bootIndex;
         } else {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index bde3ba462..d8b721282 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4586,7 +4586,8 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm,
     size_t i;

     for (i = 0; i < vm->def->ndisks; i++) {
-        virStorageSourcePtr src = vm->def->disks[i]->src;
+        virDomainDiskDefPtr disk = vm->def->disks[i];
+        virStorageSourcePtr src = disk->src;

         /* This is a best effort check as we can only check if the command
          * option exists, but we cannot determine whether the running QEMU
@@ -4599,6 +4600,14 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm,
                              "QEMU binary"));
             return -1;
         }
+
+        /* PowerPC pseries based VMs do not support floppy device */
+        if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
+            qemuDomainIsPSeries(vm->def)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("PowerPC pseries machines do not support floppy 
device"));
+            return -1;
+        }
     }

     return 0;
-- 
2.14.1

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

Reply via email to