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.
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;
}