[PATCH 2/3] qemu: domain: Check few more fields for when changing disk source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Both disk->src->shared and disk->src->readonly can't be modified when
changing disk source for floppy and cdrom drives since both arguments
are passed as arguments of the disk rather than the image in qemu.

Historically these fields have only two possible values since they are
represented as XML thus we need to ignore if user did not provide them
and thus we are treating them as false.
---
 src/qemu/qemu_domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8132ff6..f6e68ea 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3940,6 +3940,12 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
         return false;
     }

+    /* checks for fields stored in disk->src */
+    /* unfortunately 'readonly' and 'shared' can't be converted to tristate
+     * values thus we need to ignore the check if the new value is 'false' */
+    CHECK_EQ(src->readonly, "readonly", true);
+    CHECK_EQ(src->shared, "shared", true);
+
 #undef CHECK_EQ

     return true;
-- 
2.8.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]