From nobody Thu Nov 6 12:14:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540950798761870.0290426411347; Tue, 30 Oct 2018 18:53:18 -0700 (PDT) Received: from localhost ([::1]:56648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHfh7-0004Hm-An for importer@patchew.org; Tue, 30 Oct 2018 21:53:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHfUu-0000YP-DT for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHfUt-0002IS-EW for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:40 -0400 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:43411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHfUt-00028B-5h for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:39 -0400 Received: by mail-qt1-x82b.google.com with SMTP id q41-v6so15954314qtq.10 for ; Tue, 30 Oct 2018 18:40:23 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m21-v6sm2933222qtq.15.2018.10.30.18.40.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 18:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=reWrzN1nbgrUa5M9CT6ngaBhfrzDoBBYAKpSG9utug0=; b=f+K9lcH5HelSTND1Sd9pwRDpKdi1V9PVYrAlYMfjmH57C+zO+NlZO6tk+HhXhHYV/6 0mecBTxs8D01N2QDsN29avGZQLa1wjV45LG3646QxyHqLaTQVHSGb4QELDhXSkpcGpi4 e1eImgzMTKk10kXoUZJ2UmcPY8eRYVxBvdBp/CITZ+8+laTDCagP0poELfU5R4UxD1s0 00v3dEnbOvDjryoRqcqaRpzLVlRakaJKwcjo2Iz+Gsuu8yMM5dsTrbibs8JfXPSgS7SK 0JolrO7bqNuRxz9BoirABC6nnYMj4fIfgLYKzf178f8y/fYRzp8PSTZ8G2UqswwIzU5T bE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=reWrzN1nbgrUa5M9CT6ngaBhfrzDoBBYAKpSG9utug0=; b=VbGHWUwKT/z0kAkuIVM9y82+avSnAFaxUr9gKN2NZU8p2C4bOLNd8ml2HKoe392+a3 lLbYlFaC4mo7411QnUYRXimEO7I29suRLqYyMcHEiv/D3BWsRnM84/qMCCoeR4TGUSZq gJ6qk1jFKi1jgjd84qfPrZVeOQDDVz8aVRm5YGAjJBGvVVrpmR/AQ6gfuCKfICub/dzB tdAG4m4Gpl4x31iojrmD6pmdp59n7nD0T5yQJJeO0cD9Rdc9/x2oDR2SrBAw5N6NWTry O9I3KBxYes+ENNMIzBtSlfjdInx4ZQS7aaUUbBZhC0B+4Fu4/VA5J1GnXdlfT6StGdpF 9PPQ== X-Gm-Message-State: AGRZ1gJwhxE10bVBTdpABFCn691V98HMcP0yWwLkiWeIgAgsT85fC7hg BT+MKHbguQEuYDI528qvZnWzMoo8 X-Google-Smtp-Source: AJdET5ddub6Ov80O3hqwa1X0rwMJaCCfJphTLyK+BrxpcmFVincvWwAjZqWUyS8NDFQNjDKdyJ/tbg== X-Received: by 2002:ac8:2e44:: with SMTP id s4mr961726qta.355.1540950022864; Tue, 30 Oct 2018 18:40:22 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 20:38:13 -0500 Message-Id: <20181031013821.24023-17-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031013821.24023-1-mdroth@linux.vnet.ibm.com> References: <20181031013821.24023-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82b Subject: [Qemu-devel] [PULL v2 16/24] qga-win: demystify namespace stripping X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD 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 Signed-off-by: Michael Roth --- 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 =3D NULL; GuestPCIAddress *pci =3D NULL; - char *name =3D g_strdup(&guid[4]); + char *name =3D NULL; bool partial_pci =3D false; pci =3D g_malloc0(sizeof(*pci)); pci->domain =3D -1; @@ -529,6 +529,13 @@ static GuestPCIAddress *get_pci_info(char *guid, Error= **errp) pci->function =3D -1; pci->bus =3D -1; =20 + if (g_str_has_prefix(guid, "\\\\.\\") || + g_str_has_prefix(guid, "\\\\?\\")) { + name =3D g_strdup(guid + 4); + } else { + name =3D g_strdup(guid); + } + if (!QueryDosDevice(name, dev_name, ARRAY_SIZE(dev_name))) { error_setg_win32(errp, GetLastError(), "failed to get dos device n= ame"); goto out; --=20 2.17.1