Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
*additonal fixup for NULL pci_controller field
(cherry picked from commit 51fe925a7b473c76e06b60ddb8a862c91901b290)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
mdroth committed Sep 26, 2018
1 parent d5f5f7e commit 201db36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qga/commands-win32.c
Expand Up @@ -628,6 +628,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 */
Expand All @@ -642,12 +646,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));
Expand Down

0 comments on commit 201db36

Please sign in to comment.