aboutsummaryrefslogtreecommitdiff
path: root/qga/commands-posix.c
diff options
context:
space:
mode:
authorTomáš Golembiovský <tgolembi@redhat.com>2018-10-23 13:23:12 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2018-10-31 09:04:20 -0500
commit6589ce35734e7e71463485650e5fb6e4bbe64729 (patch)
tree156e68804f2976c13e95d680d1582ba70675c94f /qga/commands-posix.c
parentb616105a904bc350a409e12c39af0ae210900124 (diff)
qga: linux: return disk device in guest-get-fsinfo
Report device node of the disk on Linux (e.g. "/dev/sda2"). Requirs libudev. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r--qga/commands-posix.c7
1 files changed, 6 insertions, 1 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);