diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2022-12-20 21:35:09 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2022-12-20 21:35:09 +0000 |
| commit | 67de3d090d0b62d779fa497e708859b5ec1b791d (patch) | |
| tree | aa012a51cdc9cad601da48ab1d6ae14c1a9ab647 /qga/commands-win32.c | |
| parent | 8540a1f69578afb3b37866b1ce5bec46a9f6efbc (diff) | |
| parent | 9ca180bce1f9dad86b8d455a0c5c252d4c54eb92 (diff) | |
| download | focaccia-qemu-67de3d090d0b62d779fa497e708859b5ec1b791d.tar.gz focaccia-qemu-67de3d090d0b62d779fa497e708859b5ec1b791d.zip | |
Merge tag 'qga-pull-2022-12-20' of github.com:kostyanf14/qemu into staging
qga-pull-2022-12-20 # gpg: Signature made Tue 20 Dec 2022 13:57:59 GMT # gpg: using RSA key C2C2C109EA43C63C1423EB84EF5D5E8161BA84E7 # gpg: Good signature from "Kostiantyn Kostiuk (Upstream PR sign) <kkostiuk@redhat.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: C2C2 C109 EA43 C63C 1423 EB84 EF5D 5E81 61BA 84E7 * tag 'qga-pull-2022-12-20' of github.com:kostyanf14/qemu: qga-win: choose the right libpcre version to include in MSI package qga: map GLib log levels to system levels qga-win: add logging to Windows event log qga: Add initial OpenBSD and NetBSD support qga:/qga-win: skip getting pci info for USB disks qga:/qga-win: adding a empty PCI address creation function Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qga/commands-win32.c')
| -rw-r--r-- | qga/commands-win32.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 4df50ea710..b5fee6a2cd 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -596,6 +596,18 @@ static void get_pci_address_for_device(GuestPCIAddress *pci, } } +static GuestPCIAddress *get_empty_pci_address(void) +{ + GuestPCIAddress *pci = NULL; + + pci = g_malloc0(sizeof(*pci)); + pci->domain = -1; + pci->slot = -1; + pci->function = -1; + pci->bus = -1; + return pci; +} + static GuestPCIAddress *get_pci_info(int number, Error **errp) { HDEVINFO dev_info = INVALID_HANDLE_VALUE; @@ -605,13 +617,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) SP_DEVICE_INTERFACE_DATA dev_iface_data; HANDLE dev_file; int i; - GuestPCIAddress *pci = NULL; - - pci = g_malloc0(sizeof(*pci)); - pci->domain = -1; - pci->slot = -1; - pci->function = -1; - pci->bus = -1; + GuestPCIAddress *pci = get_empty_pci_address(); dev_info = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DISK, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); @@ -868,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 |