1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

vmx: Mark CDROM disk elements as read-only

Mark it explicitly as read only in accordance with the comment outlining
configuration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-04-15 17:08:45 +02:00
parent 7516ae5287
commit b528fffc6f
22 changed files with 26 additions and 0 deletions

View File

@ -2411,6 +2411,9 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt, virConf *conf,
goto cleanup;
}
} else if (device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
/* set cdrom to read-only */
(*def)->src->readonly = true;
if (fileName && virStringHasCaseSuffix(fileName, ".vmdk")) {
/*
* This function was called in order to parse a CDROM device, but

View File

@ -15,6 +15,7 @@
<disk type='block' device='cdrom'>
<source dev='/dev/scd0'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -14,6 +14,7 @@
<devices>
<disk type='block' device='cdrom'>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -14,6 +14,7 @@
<devices>
<disk type='file' device='cdrom'>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='file' device='cdrom'>
<source file='[datastore] directory/cdrom.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='lun'>
<source startupPolicy='optional'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='lun'>
<source dev='/dev/scd0'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='cdrom'>
<source dev='/dev/scd0'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -14,6 +14,7 @@
<devices>
<disk type='file' device='cdrom'>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='file' device='cdrom'>
<source file='[datastore] directory/cdrom.iso'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='lun'>
<source dev='/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='lun'>
<source startupPolicy='optional'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -15,6 +15,7 @@
<disk type='block' device='lun'>
<source dev='/dev/scd0'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>

View File

@ -21,16 +21,19 @@
<disk type='file' device='cdrom'>
<source file='[datastore] directory/Debian1-cdrom.iso'/>
<target dev='sdp' bus='scsi'/>
<readonly/>
<address type='drive' controller='1' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/vmimages/tools-isoimages/linux.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='cdrom'>
<source dev='/dev/scd0'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='disk'>

View File

@ -20,6 +20,7 @@
<disk type='file' device='cdrom'>
<source file='[498076b2-02796c1a-ef5b-000ae484a6a3] Isos/debian-testing-amd64-netinst.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='floppy'>

View File

@ -27,6 +27,7 @@
<disk type='file' device='cdrom'>
<source file='[4af0231d-1eff559a-6369-0024e84773b6] isos/CentOS-5.5-x86_64-bin-DVD-1of2.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='lsilogic'/>

View File

@ -20,6 +20,7 @@
<disk type='file' device='cdrom'>
<source file='/usr/lib/vmware/isoimages/linux.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='vmpvscsi'/>

View File

@ -20,6 +20,7 @@
<disk type='block' device='lun'>
<source dev='/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'/>
<target dev='sdb' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='scsi' index='0' model='vmpvscsi'/>

View File

@ -37,6 +37,7 @@
<disk type='file' device='cdrom'>
<source file='[692eb778-2d4937fe] CentOS-4.7.ServerCD-x86_64.iso'/>
<target dev='sda' bus='sata'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='vmpvscsi'/>

View File

@ -20,6 +20,7 @@
<disk type='block' device='cdrom'>
<source startupPolicy='optional'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='buslogic'/>

View File

@ -20,6 +20,7 @@
<disk type='file' device='cdrom'>
<source file='/usr/lib/vmware/isoimages/linux.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='lsilogic'/>

View File

@ -20,6 +20,7 @@
<disk type='file' device='cdrom'>
<source file='/usr/lib/vmware/isoimages/linux.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='lsilogic'/>