qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 06/14] *additonal fixup for NULL pci_controller f


From: Tomáš Golembiovský
Subject: [Qemu-devel] [PATCH v5 06/14] *additonal fixup for NULL pci_controller field
Date: Tue, 23 Oct 2018 13:23:15 +0200

From: Michael Roth <address@hidden>

(cherry picked from commit 51fe925a7b473c76e06b60ddb8a862c91901b290)
Signed-off-by: Michael Roth <address@hidden>
Signed-off-by: Tomáš Golembiovský <address@hidden>
---
 qga/commands-win32.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a8967abf06..44b6b1ce88 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -627,6 +627,10 @@ static GuestDiskAddressList *build_guest_disk_info(char 
*guid, Error **errp)
 
     disk = g_malloc0(sizeof(*disk));
     disk->bus_type = find_bus_type(bus);
+    /* always set pci_controller as required by schema. get_pci_info() should
+     * report -1 values for non-PCI buses rather than fail.
+     */
+    disk->pci_controller = get_pci_info(name, errp);
     if (bus == BusTypeScsi || bus == BusTypeAta || bus == BusTypeRAID
 #if (_WIN32_WINNT >= 0x0600)
             /* This bus type is not supported before Windows Server 2003 SP1 */
@@ -641,12 +645,9 @@ static GuestDiskAddressList *build_guest_disk_info(char 
*guid, Error **errp)
             disk->unit = addr.Lun;
             disk->target = addr.TargetId;
             disk->bus = addr.PathId;
-            disk->pci_controller = get_pci_info(name, errp);
         }
         /* We do not set error in this case, because we still have enough
          * information about volume. */
-    } else {
-         disk->pci_controller = NULL;
     }
 
     list = g_malloc0(sizeof(*list));
-- 
2.19.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]