From nobody Sun Feb 8 17:21:23 2026 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 1540996520840289.49678036128614; Wed, 31 Oct 2018 07:35:20 -0700 (PDT) Received: from localhost ([::1]:59945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHraS-0007hd-69 for importer@patchew.org; Wed, 31 Oct 2018 10:35:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHrNS-0001X6-Nh for qemu-devel@nongnu.org; Wed, 31 Oct 2018 10:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHrNQ-0007cy-VK for qemu-devel@nongnu.org; Wed, 31 Oct 2018 10:21:46 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:43430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHrNO-0007QA-RU for qemu-devel@nongnu.org; Wed, 31 Oct 2018 10:21:43 -0400 Received: by mail-ot1-x341.google.com with SMTP id k9so14659673otl.10 for ; Wed, 31 Oct 2018 07:21:16 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 69sm2720915otc.23.2018.10.31.07.21.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Oct 2018 07:21:13 -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=Ogb5hMscvBR7/97F7+QGB34/MnUmfKCPRhsa5QI4p84=; b=RwP9J8ZsTfs1eJqD5N8TaULfxCKDxA0xkStzUIJ8R7hfidxtWd78K8ZR+4S4v50UUe HIX0xXMa5wN2H9o8pQnQOa6Y/Ku+MhB7cLClZvXiQke8N6w/IO+AStx8OnqL6bx3z9xH vS+MYmWbriHGvR7DdotcBCzpXGgcthWXCSoeDyJ9UAyEmP+tSzNzpmbuZIWssmGxUwt3 mklN2OjajTexVuCL6bTqLRe4utwsOxdPWndf82Chj+KAoKaUl7llC3DKbyvX7NaMfrrc p1Cn47PhC4t1oSqI7U29Yy/L5wdJkoRRMT58VJ1lQ9mI9cu74Mu8wSV8gtiVgSFfsy+u oB4A== 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=Ogb5hMscvBR7/97F7+QGB34/MnUmfKCPRhsa5QI4p84=; b=eMcF2lX6CrgKCYJ+HfNhodDj2LxGv8HHTGPCf8rWNJhTFwIbW2ojbEjjBjhvWP1RlP FBeioZka1JFfmKlgNNtGVZ5vJMQ//lJFyXzeH5MXhcz/7qJzGuhhMf3RxD6Htgm0ZCRC IKkZv8t7AREf/ahfx8waiNTo/ypg9jFW8cvcr4Bh+k5kErrA9nRxDj8zD40ouQ8tH4Zf JLqYRq6mn9yPkDDjylJU1tLezccqTerfgDAi+ovlmATLlxZX2jX2ucrpJIxYLm3KzQ/g YggGhBtvJUmTrBxwbasu20sooqbPJaNxutyKvp+gPKWQU8dABXIXtPvUJUD56YnUwSg6 w47A== X-Gm-Message-State: AGRZ1gLLS94RffM8AqD7ulksknX7/TO1vdfJ610VhL8MO67n9g2xZYp5 cOqz7F+iKYrE4x7d25NxWGfg+Q3e X-Google-Smtp-Source: AJdET5fRlq4hKUvij84qJowgs5WLwaREMus2EYuyQ2i3LMnnBzj8KwlmAOKAUVKQUiQRLUSYxsS+Ow== X-Received: by 2002:a9d:3c0c:: with SMTP id q12mr1835610otc.63.1540995674696; Wed, 31 Oct 2018 07:21:14 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 31 Oct 2018 09:19:07 -0500 Message-Id: <20181031141925.30026-7-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031141925.30026-1-mdroth@linux.vnet.ibm.com> References: <20181031141925.30026-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::341 Subject: [Qemu-devel] [PULL v3 06/24] qga: linux: return disk device in guest-get-fsinfo 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 Report device node of the disk on Linux (e.g. "/dev/sda2"). Requirs libudev. Signed-off-by: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD Signed-off-by: Michael Roth --- qga/commands-posix.c | 7 ++++++- qga/qapi-schema.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 41bd11b2b5..1877976522 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -950,7 +950,12 @@ static void build_guest_fsinfo_for_real_device(char co= nst *syspath, if (udev =3D=3D NULL || udevice =3D=3D NULL) { g_debug("failed to query udev"); } else { - const char *serial; + const char *devnode, *serial; + devnode =3D udev_device_get_devnode(udevice); + if (devnode !=3D NULL) { + disk->dev =3D g_strdup(devnode); + disk->has_dev =3D true; + } serial =3D udev_device_get_property_value(udevice, "ID_SERIAL"); if (serial !=3D NULL && *serial !=3D 0) { disk->serial =3D g_strdup(serial); diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 3bcda6257e..c6725b3ec8 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -835,6 +835,7 @@ # @target: target id # @unit: unit id # @serial: serial number (since: 3.1) +# @dev: device node (POSIX) or device UNC (Windows) (since: 3.1) # # Since: 2.2 ## @@ -842,7 +843,7 @@ 'data': {'pci-controller': 'GuestPCIAddress', 'bus-type': 'GuestDiskBusType', 'bus': 'int', 'target': 'int', 'unit': 'int', - '*serial': 'str'} } + '*serial': 'str', '*dev': 'str'} } =20 ## # @GuestFilesystemInfo: --=20 2.17.1