From nobody Thu Nov 6 12:13:08 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 1540911020866926.6417463228861; Tue, 30 Oct 2018 07:50:20 -0700 (PDT) Received: from localhost ([::1]:53665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHVLX-00035m-Pm for importer@patchew.org; Tue, 30 Oct 2018 10:50:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHVGG-0007a2-9p for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHVGB-0000IJ-Gx for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:52 -0400 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:45433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHVGB-0000Hm-AF for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:47 -0400 Received: by mail-qt1-x831.google.com with SMTP id l9-v6so13691967qtj.12 for ; Tue, 30 Oct 2018 07:44:47 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id e54-v6sm11703975qta.4.2018.10.30.07.44.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 07:44:44 -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=g+5jA+QymCopuIt9XUkeQH/gkr9FuWKjrOo9Ek5V/cYr2mbgts2ESJvWqZXQZ9yPok 0Dx2t1xLN+ETfjvThMwkb1Q4J424kuS0ZloYuQxsULPjdYZ0oqsA/cMSzeVXsUxDa52v lAYNfTRw+QU3FeGE9WXRFBsN3Mu+iyCELZwbOneB3nz4zvznZpIJP1yvnHN4oUhaut42 kbQNYJM5Gz5846WQUs++B9NXpt6fzlbe+mNBTcK4ryE9RLbm8q+QvwZlgQ2/U775ZCGL Sj0hy4HOzbfZaIyPFlQcRmY9odFG+E2dcZwoXPLP/ENmuC8kqTezhhXvuQEsHIpGE0dk 0yAA== 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=YOfv/wbAmPp7LWRizL3vTjBVB0lhcICVJCBnlihNVoICgQ3fhRJGZYOetL4f0Tdz45 5EqeSMIYwlqrVubub92aPrUBzcClW8k+8vPF3nNNHMEmzbYZyLUU04uwygo5gVVIkG4S +uCwOKlBu0+POAodLpXzwnaeQJmDUOFnZtn9i4HyYD3kYw21cz4Yet7Ke6BxdB7H1Wc5 0MlrpMq/NSyzM1HlTQPM7ZuWiET1c2duY1AM1dGNJLflx4HwLYnxx4kTFaVxzpB5IAqO PKcOXlg6DJ/HoC/aytcKLRSXBIA8gwslWpHrcWKTpTL9qG+2S7xNT+TYGK+N5o7YqJL6 NnrA== X-Gm-Message-State: AGRZ1gJ5TVgpWfZCdPSgh3PnTmZN0/cFVrV5Uc+D1HckR0gFsKuouWMP XcRM567TCWN9CQBLY66ABs2LLerh X-Google-Smtp-Source: AJdET5dLZNpYIFSH0hvT3Uo5WPJSxcunR+hVVMWndfzyH5lUjVooWBG38OD0dW6S9G12KCVD1ogfMA== X-Received: by 2002:ac8:53c6:: with SMTP id c6mr2582079qtq.278.1540910686080; Tue, 30 Oct 2018 07:44:46 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 09:43:50 -0500 Message-Id: <20181030144358.23144-17-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181030144358.23144-1-mdroth@linux.vnet.ibm.com> References: <20181030144358.23144-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::831 Subject: [Qemu-devel] [PULL 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