[PATCH 2/2] qga:/qga-win: skip getting pci info for USB disks

Kfir Manor posted 2 patches 3 years, 2 months ago
Maintainers: Konstantin Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>
[PATCH 2/2] qga:/qga-win: skip getting pci info for USB disks
Posted by Kfir Manor 3 years, 2 months ago
Skip getting PCI info from disks type USB and give them an empty PCI address instead.

Signed-off-by: Kfir Manor <kfir@daynix.com>
---
 qga/commands-win32.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a645480496..14c43b3de5 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -878,10 +878,14 @@ static void get_single_disk_info(int disk_number,
      * if that doesn't hold since that suggests some other unexpected
      * breakage
      */
-    disk->pci_controller = get_pci_info(disk_number, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
-        goto err_close;
+    if (disk->bus_type == GUEST_DISK_BUS_TYPE_USB) {
+        disk->pci_controller = get_empty_pci_address();
+    } else {
+        disk->pci_controller = get_pci_info(disk_number, &local_err);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            goto err_close;
+        }
     }
     if (disk->bus_type == GUEST_DISK_BUS_TYPE_SCSI
             || disk->bus_type == GUEST_DISK_BUS_TYPE_IDE
-- 
2.38.1
Re: [PATCH 2/2] qga:/qga-win: skip getting pci info for USB disks
Posted by Konstantin Kostiuk 3 years, 2 months ago
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Sun, Nov 20, 2022 at 4:01 PM Kfir Manor <kfir@daynix.com> wrote:

> Skip getting PCI info from disks type USB and give them an empty PCI
> address instead.
>
> Signed-off-by: Kfir Manor <kfir@daynix.com>
> ---
>  qga/commands-win32.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index a645480496..14c43b3de5 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -878,10 +878,14 @@ static void get_single_disk_info(int disk_number,
>       * if that doesn't hold since that suggests some other unexpected
>       * breakage
>       */
> -    disk->pci_controller = get_pci_info(disk_number, &local_err);
> -    if (local_err) {
> -        error_propagate(errp, local_err);
> -        goto err_close;
> +    if (disk->bus_type == GUEST_DISK_BUS_TYPE_USB) {
> +        disk->pci_controller = get_empty_pci_address();
> +    } else {
> +        disk->pci_controller = get_pci_info(disk_number, &local_err);
> +        if (local_err) {
> +            error_propagate(errp, local_err);
> +            goto err_close;
> +        }
>      }
>      if (disk->bus_type == GUEST_DISK_BUS_TYPE_SCSI
>              || disk->bus_type == GUEST_DISK_BUS_TYPE_IDE
> --
> 2.38.1
>
>