From 7526a71586d4072cef7d66798c3da4d30e163e7d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 7 Apr 2017 13:44:54 +0200 Subject: [PATCH] conf: Keep 'readonly' property when resetting disk source The property is necessary also for the disk using the source (e.g. cdrom) which needs to be kept readonly. Commit '462c4b66' was a bit too aggressive in this aspect, since the readonly flag is set only while parsing. --- 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 80baa090a7..d660c06e0f 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; } -- GitLab