From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA9rl-0005IV-VB for qemu-devel@nongnu.org; Wed, 10 Oct 2018 04:29:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA9rh-00051q-WC for qemu-devel@nongnu.org; Wed, 10 Oct 2018 04:29:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gA9rh-00050i-Pa for qemu-devel@nongnu.org; Wed, 10 Oct 2018 04:29:09 -0400 Received: by mail-wr1-f67.google.com with SMTP id g15-v6so4645105wru.9 for ; Wed, 10 Oct 2018 01:29:07 -0700 (PDT) Date: Tue, 9 Oct 2018 14:38:38 +0200 From: =?UTF-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Message-ID: <20181009143838.23f19a4c@fiorina> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau Cc: qemu-devel , "Blake, Eric" , sjubran@redhat.com, okrishtal@virtuozzo.com, Michael Roth On Thu, 4 Oct 2018 17:20:50 +0400 Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Thu, Oct 4, 2018 at 3:22 PM Tom=C3=A1=C5=A1 Golembiovsk=C3=BD 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=C3=A1=C5=A1 Golembiovsk=C3=BD = =20 >=20 > Reviewed-by: Marc-Andr=C3=A9 Lureau >=20 > > --- > > 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, E= rror **errp) > > char dev_name[MAX_PATH]; > > char *buffer =3D NULL; > > GuestPCIAddress *pci =3D NULL; > > - char *name =3D g_strdup(&guid[4]); > > + char *name =3D NULL; > > + > > + if ((g_str_has_prefix(guid, "\\\\.\\") =3D=3D TRUE) || > > + (g_str_has_prefix(guid, "\\\\?\\") =3D=3D TRUE)) { > > + name =3D g_strdup(&guid[4]); =20 >=20 > I find "guid + 4" easier to read though I will change that, no problem. >=20 > > + } else { > > + name =3D g_strdup(guid); > > + } > > > > if (!QueryDosDevice(name, dev_name, ARRAY_SIZE(dev_name))) { > > error_setg_win32(errp, GetLastError(), "failed to get dos devi= ce name"); > > -- > > 2.19.0 > > =20 --=20 Tom=C3=A1=C5=A1 Golembiovsk=C3=BD