提交 99a2d6af 编写于 作者: J John Ferlan

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.
上级 9ce40956
......@@ -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",
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册