From nobody Wed Nov 5 10:59:03 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; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540294610910474.45175340589833; Tue, 23 Oct 2018 04:36:50 -0700 (PDT) Received: from localhost ([::1]:40354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEuzK-0003mx-OG for importer@patchew.org; Tue, 23 Oct 2018 07:36:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEumr-0001yi-RQ for qemu-devel@nongnu.org; Tue, 23 Oct 2018 07:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEumm-0007qN-TY for qemu-devel@nongnu.org; Tue, 23 Oct 2018 07:23:49 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEumm-0007pO-M4 for qemu-devel@nongnu.org; Tue, 23 Oct 2018 07:23:44 -0400 Received: by mail-wm1-f68.google.com with SMTP id x19-v6so1365265wmc.2 for ; Tue, 23 Oct 2018 04:23:44 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g8-v6sm1498990wmf.45.2018.10.23.04.23.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 04:23:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AGf2jCn6NBp1indlMDqYY918CooL347mtnpSMsGHL5M=; b=fQVbhXXUrDr4AnHqxRFBz8F8dWWAQwGFGAiJMfDr7tcik/ZyBaJJ6CzSnmh8hzU48g BQ3LwXHP3lxTFPNvt7PQJ3m+IehXht8o3Im91pDtrpcfeBo8uzfWw5o46QUKbEzAfXO8 U3Vaor84G3o5+OCQkrR+MG/zk0gMxhPsXJ48inJDnzd0/Uj0WHE8TBD2NRFCxIKXTRgc HSjem7TDnIp0n4IQK+f0KNO0/NO3zsbS9wA5EA9ZE1YUtp3/f4pDr7y1WF33JNijItAe hdmMRnK5aUbTZagKDUXIwgLOKwKZf075SvuxICHmUpuKSHjAso+zqH2iGPkigq3kuTbf olVg== X-Gm-Message-State: ABuFfohz1i+vvrd/Wc2fYEKgaYIYG/GoSCAyTCPlaN4SURUO7jo6C8Cu LUwVSRFnWQEu/0kh9+r+K79pozE+Ce0= X-Google-Smtp-Source: ACcGV63TeoLLWW8sWchahxE6fI/YzO7s0aYTV0Q1ZLsdAb8xYLjmKn9j3JZQ7i0bLTpFWU7TZrvrDw== X-Received: by 2002:a1c:c708:: with SMTP id x8-v6mr19748616wmf.116.1540293823277; Tue, 23 Oct 2018 04:23:43 -0700 (PDT) From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= To: qemu-devel@nongnu.org Date: Tue, 23 Oct 2018 13:23:23 +0200 Message-Id: X-Mailer: git-send-email 2.19.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.68 Subject: [Qemu-devel] [PATCH v5 14/14] 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: Michael Roth , Olga Krishtal , =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= , Sameeh Jubran , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 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 --- qga/commands-win32.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 12aba8cc50..779c8ce1fa 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -507,13 +507,21 @@ static GuestPCIAddress *get_pci_info(char *guid, Erro= r **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; + pci =3D g_malloc0(sizeof(*pci)); pci->domain =3D -1; pci->slot =3D -1; 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.19.0