qemu: command: Move PPC fdc check to domain validation

Apart from not littering the command line generator, the added benefit
is that new configs with a FDC will be rejected at define stage.
This commit is contained in:
Peter Krempa 2017-10-03 14:06:15 +02:00
parent 627f489e5d
commit 79edca277a
2 changed files with 10 additions and 9 deletions

View File

@ -2258,14 +2258,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 {

View File

@ -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;