d759b5
From a87147a0bb1bf52cb0646e5776bce19fdc51d80d Mon Sep 17 00:00:00 2001
d759b5
Message-Id: <a87147a0bb1bf52cb0646e5776bce19fdc51d80d@dist-git>
d759b5
From: Michal Privoznik <mprivozn@redhat.com>
d759b5
Date: Tue, 8 Oct 2019 14:14:22 +0200
d759b5
Subject: [PATCH] RHEL: virutil: Accept non-block devices in virGetDeviceID()
d759b5
d759b5
If a caller wants to learn major or minor number for a device,
d759b5
let them. There's no need to check if the device is a block
d759b5
device here.
d759b5
d759b5
https://bugzilla.redhat.com/show_bug.cgi?id=1754241
d759b5
d759b5
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
d759b5
Message-Id: <354b68e431cc5179ab57895536afebc0d68b2a4b.1570536610.git.mprivozn@redhat.com>
d759b5
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d759b5
---
d759b5
 src/util/virutil.c | 3 ---
d759b5
 1 file changed, 3 deletions(-)
d759b5
d759b5
diff --git a/src/util/virutil.c b/src/util/virutil.c
d759b5
index b25d2a5ca4..fb2a95041a 100644
d759b5
--- a/src/util/virutil.c
d759b5
+++ b/src/util/virutil.c
d759b5
@@ -1672,9 +1672,6 @@ virGetDeviceID(const char *path, int *maj, int *min)
d759b5
     if (stat(path, &sb) < 0)
d759b5
         return -errno;
d759b5
 
d759b5
-    if (!S_ISBLK(sb.st_mode))
d759b5
-        return -EINVAL;
d759b5
-
d759b5
     if (maj)
d759b5
         *maj = major(sb.st_rdev);
d759b5
     if (min)
d759b5
-- 
d759b5
2.23.0
d759b5