[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping |
Date: |
Thu, 4 Oct 2018 17:20:50 +0400 |
Hi
On Thu, Oct 4, 2018 at 3:22 PM Tomáš Golembiovský <address@hidden> wrote:
>
> 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>
Reviewed-by: Marc-André Lureau <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 d0d969d0ce..82881aa749 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -507,7 +507,14 @@ 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;
> +
> + if ((g_str_has_prefix(guid, "\\\\.\\") == TRUE) ||
> + (g_str_has_prefix(guid, "\\\\?\\") == TRUE)) {
> + name = g_strdup(&guid[4]);
I find "guid + 4" easier to read though
> + } 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");
> --
> 2.19.0
>
- [Qemu-devel] [PATCH v4 01/11] qga-win: fix crashes when PCI info cannot be retrived, (continued)
- [Qemu-devel] [PATCH v4 01/11] qga-win: fix crashes when PCI info cannot be retrived, Tomáš Golembiovský, 2018/10/04
- [Qemu-devel] [PATCH v4 03/11] build: rename CONFIG_QGA_NTDDDISK to CONFIG_QGA_NTDDSCSI, Tomáš Golembiovský, 2018/10/04
- [Qemu-devel] [PATCH v4 08/11] qga-win: refactor disk info, Tomáš Golembiovský, 2018/10/04
- [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping, Tomáš Golembiovský, 2018/10/04
- Re: [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v4 06/11] configure: add test for libudev, Tomáš Golembiovský, 2018/10/04
- [Qemu-devel] [PATCH v4 09/11] qga-win: handle multi-disk volumes, Tomáš Golembiovský, 2018/10/04