[libvirt] [PATCH] qemu: fix Validate scsi disk against domain def on coldplug

Michal Privoznik mprivozn at redhat.com
Thu Sep 19 14:46:23 UTC 2019


On 9/19/19 10:02 AM, Xu Yandong wrote:
> Check the disk scsi address only when the disk is scsi type.
> 
> Signed-off-by: Xu Yandong <xuyandong2 at huawei.com>
> ---
>   src/qemu/qemu_driver.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 62ce7270ca..ff2173da5e 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -8326,7 +8326,8 @@ static int
>   qemuCheckDiskConfigAgainstDomain(const virDomainDef *def,
>                                    const virDomainDiskDef *disk)
>   {
> -    if (virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) {
> +    if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
> +        virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) {
>           virReportError(VIR_ERR_OPERATION_INVALID, "%s",
>                          _("Domain already contains a disk with that address"));
>           return -1;
> 

Nice catch!

Reviewed-by: Michal Privoznik <mprivozn at redhat.com>

Michal




More information about the libvir-list mailing list