mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user