[libvirt] [PATCH] qemu: Only allow 'raw' format for scsi-block using virtio-scsi

Michal Privoznik mprivozn at redhat.com
Tue Nov 8 10:00:47 UTC 2016


On 07.11.2016 23:58, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1379196
> 
> Add check in qemuCheckDiskConfig for an invalid combination
> of using the 'scsi' bus for a block 'lun' device and any disk
> source format other than 'raw'.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_command.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 96c4f31..9adf0fe 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1238,6 +1238,14 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk)
>              return -1;
>          }
>  
> +        if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
> +            disk->src->format != VIR_STORAGE_FILE_RAW) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("disk device 'lun' using target 'scsi' must use "
> +                             "'raw' format"));
> +            return -1;
> +        }
> +
>          if (qemuDomainDefValidateDiskLunSource(disk->src) < 0)
>              return -1;
>  
> 

ACK

Michal




More information about the libvir-list mailing list