]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Check few more fields for when changing disk source
authorPeter Krempa <pkrempa@redhat.com>
Thu, 28 Apr 2016 14:45:02 +0000 (16:45 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 May 2016 07:03:02 +0000 (09:03 +0200)
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

index 8132ff693068ea66fd484e0efb78257f33758272..f6e68ea918beb4ff3b6400c4827d8bf15bbda939 100644 (file)
@@ -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;