[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/24] qga-win: demystify namespace stripping
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PULL 16/24] qga-win: demystify namespace stripping |
Date: |
Tue, 30 Oct 2018 09:43:50 -0500 |
From: Tomáš Golembiovský <address@hidden>
It was not obvious what exactly the cryptic string copying does to the
GUID. This change makes the intent clearer.
Signed-off-by: Tomáš Golembiovský <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
qga/commands-win32.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 30d6c639c3..a1b7512d46 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -521,7 +521,7 @@ static GuestPCIAddress *get_pci_info(char *guid, Error
**errp)
char dev_name[MAX_PATH];
char *buffer = NULL;
GuestPCIAddress *pci = NULL;
- char *name = g_strdup(&guid[4]);
+ char *name = NULL;
bool partial_pci = false;
pci = g_malloc0(sizeof(*pci));
pci->domain = -1;
@@ -529,6 +529,13 @@ static GuestPCIAddress *get_pci_info(char *guid, Error
**errp)
pci->function = -1;
pci->bus = -1;
+ if (g_str_has_prefix(guid, "\\\\.\\") ||
+ g_str_has_prefix(guid, "\\\\?\\")) {
+ name = g_strdup(guid + 4);
+ } else {
+ name = g_strdup(guid);
+ }
+
if (!QueryDosDevice(name, dev_name, ARRAY_SIZE(dev_name))) {
error_setg_win32(errp, GetLastError(), "failed to get dos device
name");
goto out;
--
2.17.1
- [Qemu-devel] [PULL 00/24] qemu-ga patch queue for soft-freeze, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 09/24] build: rename CONFIG_QGA_NTDDDISK to CONFIG_QGA_NTDDSCSI, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 11/24] qga-win: refactor disk properties (bus), Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 15/24] qga-win: return disk device in guest-get-fsinfo, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 10/24] qga-win: add debugging information, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 14/24] qga-win: handle multi-disk volumes, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 12/24] qga-win: report disk serial number, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 13/24] qga-win: refactor disk info, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 18/24] qga: group agent init/cleanup init separate routines, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 16/24] qga-win: demystify namespace stripping,
Michael Roth <=
- [Qemu-devel] [PULL 17/24] qga: fix an off-by-one issue, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 19/24] qga: hang GAConfig/socket_activation off of GAState global, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 20/24] qga: move w32 service handling out of run_agent(), Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 01/24] qga: Support Unicode paths in guest-file-open on win32, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 22/24] qga-win: install service with --retry-path set by default, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 21/24] qga: add --retry-path option for re-initializing channel on failure, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 23/24] qga-win: report specific error when failing to open channel, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 02/24] qga-win: add support for qmp_guest_fsfreeze_freeze_list, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 24/24] qga-win: changing --retry-path option behavior, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 03/24] qga: ignore non present cpus when handling qmp_guest_get_vcpus(), Michael Roth, 2018/10/30