diff mbox series

[PULL,v2,2/6] qga:/qga-win: skip getting pci info for USB disks

Message ID 20221217090740.522093-3-kkostiuk@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,v2,1/6] qga:/qga-win: adding a empty PCI address creation function | expand

Commit Message

Konstantin Kostiuk Dec. 17, 2022, 9:07 a.m. UTC
From: Kfir Manor <kfir@daynix.com>

Skip getting PCI info from disks type USB and give them an empty PCI address instead.

Signed-off-by: Kfir Manor <kfir@daynix.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
 qga/commands-win32.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index bd0f3cccfe..b5fee6a2cd 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -874,10 +874,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