提交 e8e51b63 编写于 作者: P Peter Krempa

qemu: domain: Forbid copy_on_read option also for floppies

Using copy_on_read for removable disks is a hassle. It also does not
work for CDROMs at all as the image is supposed to be read-only and we
might ignore it for floppies when they are started as empty. Forbid it
for floppies completely rather than trying to support what probably
nobody is using.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b3736feb
......@@ -5041,13 +5041,23 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
return -1;
}
if (disk->src->readonly && disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
if (disk->src->readonly) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("copy_on_read is not compatible with read-only disk '%s'"),
disk->dst);
return -1;
}
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ||
disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("copy_on_read is not supported with removable disk '%s'"),
disk->dst);
return -1;
}
}
if (disk->geometry.cylinders > 0 &&
disk->geometry.heads > 0 &&
disk->geometry.sectors > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册