mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
parent
b003b9781b
commit
7526a71586
@ -1723,9 +1723,12 @@ void
|
|||||||
virDomainDiskEmptySource(virDomainDiskDefPtr def)
|
virDomainDiskEmptySource(virDomainDiskDefPtr def)
|
||||||
{
|
{
|
||||||
virStorageSourcePtr src = def->src;
|
virStorageSourcePtr src = def->src;
|
||||||
|
bool readonly = src->readonly;
|
||||||
|
|
||||||
virStorageSourceClear(src);
|
virStorageSourceClear(src);
|
||||||
src->type = VIR_STORAGE_TYPE_FILE;
|
src->type = VIR_STORAGE_TYPE_FILE;
|
||||||
|
/* readonly property is necessary for CDROMs and thus can't be cleared */
|
||||||
|
src->readonly = readonly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user