[PATCH] qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias()

Michal Privoznik posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/36c8ca20aa8b2280f31453c8b3da44318378214b.1663938700.git.mprivozn@redhat.com
src/qemu/qemu_domain.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias()
Posted by Michal Privoznik 1 year, 7 months ago
When retiring QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI capability the
commit removed a bit too much. Previously, all other devices than
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI were ignored in
qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(). But the
commit in question removed not only the capability check but also
this return early statement. Restore it back.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2129239
Fixes: dc8dbb27d40968c9d9bfad2c6181bccc20c0e44e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_domain.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d7ef23f493..ee024d17cd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5596,6 +5596,10 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDef *host
     if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
         return 0;
 
+    if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+        hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
+        return 0;
+
     switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) {
     case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE:
         if (!scsisrc->u.host.src)
-- 
2.35.1
Re: [PATCH] qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias()
Posted by Martin Kletzander 1 year, 7 months ago
On Fri, Sep 23, 2022 at 03:11:40PM +0200, Michal Privoznik wrote:
>When retiring QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI capability the
>commit removed a bit too much. Previously, all other devices than
>VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI were ignored in
>qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(). But the
>commit in question removed not only the capability check but also
>this return early statement. Restore it back.
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2129239
>Fixes: dc8dbb27d40968c9d9bfad2c6181bccc20c0e44e
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>---
> src/qemu/qemu_domain.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
>index d7ef23f493..ee024d17cd 100644
>--- a/src/qemu/qemu_domain.c
>+++ b/src/qemu/qemu_domain.c
>@@ -5596,6 +5596,10 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDef *host
>     if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
>         return 0;
>
>+    if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
>+        hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
>+        return 0;
>+
>     switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) {
>     case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE:
>         if (!scsisrc->u.host.src)
>-- 
>2.35.1
>
Re: [PATCH] qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias()
Posted by Peter Krempa 1 year, 7 months ago
On Fri, Sep 23, 2022 at 15:11:40 +0200, Michal Privoznik wrote:
> When retiring QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI capability the
> commit removed a bit too much. Previously, all other devices than
> VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI were ignored in
> qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(). But the
> commit in question removed not only the capability check but also
> this return early statement. Restore it back.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2129239
> Fixes: dc8dbb27d40968c9d9bfad2c6181bccc20c0e44e
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index d7ef23f493..ee024d17cd 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -5596,6 +5596,10 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDef *host
>      if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
>          return 0;
>  
> +    if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
> +        hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
> +        return 0;
> +
>      switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) {
>      case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE:
>          if (!scsisrc->u.host.src)

Oops,

Reviewed-by: Peter Krempa <pkrempa@redhat.com>