[PATCH 1/5] conf: Keep 'readonly' property when resetting disk source

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

 



The property is necessary also for the disk using the source (e.g. cdrom)
which needs to be kept readonly.
---
 src/conf/domain_conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 80baa090a..d660c06e0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1723,9 +1723,12 @@ void
 virDomainDiskEmptySource(virDomainDiskDefPtr def)
 {
     virStorageSourcePtr src = def->src;
+    bool readonly = src->readonly;

     virStorageSourceClear(src);
     src->type = VIR_STORAGE_TYPE_FILE;
+    /* readonly property is necessary for CDROMs and thus can't be cleared */
+    src->readonly = readonly;
 }


-- 
2.12.2

--
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]
  Powered by Linux