Taint domains using cdrom-passthrough

https://bugzilla.redhat.com/show_bug.cgi?id=976387

For a domain configured using the host cdrom, we should taint the domain
due to problems encountered when the host and guest try to control the tray.
This commit is contained in:
John Ferlan 2015-05-12 15:58:31 -04:00
parent 9ce409561a
commit 99a2d6af2b
4 changed files with 10 additions and 1 deletions

View File

@ -101,7 +101,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
"disk-probing",
"external-launch",
"host-cpu",
"hook-script");
"hook-script",
"cdrom-passthrough");
VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
"qemu",

View File

@ -2288,6 +2288,7 @@ typedef enum {
VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH, /* Externally launched guest domain */
VIR_DOMAIN_TAINT_HOST_CPU, /* Host CPU passthrough in use */
VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */
VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */
VIR_DOMAIN_TAINT_LAST
} virDomainTaintFlags;

View File

@ -2079,6 +2079,12 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver,
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HIGH_PRIVILEGES,
logFD);
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_BLOCK &&
disk->src->path)
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,
logFD);
virObjectUnref(cfg);
}

View File

@ -8202,6 +8202,7 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn,
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, -1);
ret = qemuDomainChangeDiskMediaLive(conn, vm, dev, driver, force);
break;
case VIR_DOMAIN_DEVICE_GRAPHICS: