[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/24] qga: linux: return disk device in guest-get-fs
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PULL 06/24] qga: linux: return disk device in guest-get-fsinfo |
Date: |
Tue, 30 Oct 2018 09:43:40 -0500 |
From: Tomáš Golembiovský <address@hidden>
Report device node of the disk on Linux (e.g. "/dev/sda2").
Requirs libudev.
Signed-off-by: Tomáš Golembiovský <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
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 const
*syspath,
if (udev == NULL || udevice == NULL) {
g_debug("failed to query udev");
} else {
- const char *serial;
+ const char *devnode, *serial;
+ devnode = udev_device_get_devnode(udevice);
+ if (devnode != NULL) {
+ disk->dev = g_strdup(devnode);
+ disk->has_dev = true;
+ }
serial = udev_device_get_property_value(udevice, "ID_SERIAL");
if (serial != NULL && *serial != 0) {
disk->serial = 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'} }
##
# @GuestFilesystemInfo:
--
2.17.1
- [Qemu-devel] [PULL 01/24] qga: Support Unicode paths in guest-file-open on win32, (continued)
- [Qemu-devel] [PULL 01/24] qga: Support Unicode paths in guest-file-open on win32, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 22/24] qga-win: install service with --retry-path set by default, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 21/24] qga: add --retry-path option for re-initializing channel on failure, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 23/24] qga-win: report specific error when failing to open channel, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 02/24] qga-win: add support for qmp_guest_fsfreeze_freeze_list, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 24/24] qga-win: changing --retry-path option behavior, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 03/24] qga: ignore non present cpus when handling qmp_guest_get_vcpus(), Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 04/24] configure: add test for libudev, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 05/24] qga: linux: report disk serial number, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 07/24] qga-win: prevent crash when executing fsinfo command, Michael Roth, 2018/10/30
- [Qemu-devel] [PULL 06/24] qga: linux: return disk device in guest-get-fsinfo,
Michael Roth <=
- [Qemu-devel] [PULL 08/24] qga-win: fsinfo: pci-info: allow partial info, Michael Roth, 2018/10/30
- Re: [Qemu-devel] [PULL 00/24] qemu-ga patch queue for soft-freeze, Peter Maydell, 2018/10/30
- Re: [Qemu-devel] [PULL 00/24] qemu-ga patch queue for soft-freeze, no-reply, 2018/10/31