mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Prohibit setting tray status as open for block type disk
This commit is contained in:
parent
ad7db43913
commit
7fcf943bcd
@ -1963,6 +1963,13 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) &&
|
||||
(disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) {
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("tray status 'open' is invalid for "
|
||||
"block type disk"));
|
||||
goto error;
|
||||
}
|
||||
virBufferEscape(&opt, ',', ",", "file=%s,", disk->src);
|
||||
}
|
||||
}
|
||||
@ -4641,6 +4648,14 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
const char *fmt;
|
||||
virDomainDiskDefPtr disk = def->disks[i];
|
||||
|
||||
if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) &&
|
||||
(disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) {
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("tray status 'open' is invalid for "
|
||||
"block type disk"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
|
||||
virCommandAddArg(cmd, "-usbdevice");
|
||||
|
Loading…
Reference in New Issue
Block a user