[prev in list] [next in list] [prev in thread] [next in thread]
List: libvir-list
Subject: [libvirt] [PATCH 5/5] qemu: domain: Forbid copy_on_read option also for floppies
From: Peter Krempa <pkrempa () redhat ! com>
Date: 2019-03-29 13:53:57
Message-ID: f2b32b73c8f71d49ca022910004b9cccb25af505.1553867580.git.pkrempa () redhat ! com
[Download RAW message or body]
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: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_domain.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e903d36fec..2480211194 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5041,11 +5041,21 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
return -1;
}
- if (disk->src->readonly && disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("copy_on_read is not compatible with read-only disk '%s'"),
- disk->dst);
- return -1;
+ 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 &&
--
2.20.1
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic