9de337
From 7da0de5b5de0b43e7da21844cad3c643f9f19997 Mon Sep 17 00:00:00 2001
9de337
Message-Id: <7da0de5b5de0b43e7da21844cad3c643f9f19997@dist-git>
d76c62
From: Michal Privoznik <mprivozn@redhat.com>
d76c62
Date: Fri, 6 Mar 2020 15:52:24 +0100
d76c62
Subject: [PATCH] RHEL: virutil: Accept non-block devices in virGetDeviceID()
d76c62
d76c62
If a caller wants to learn major or minor number for a device,
d76c62
let them. There's no need to check if the device is a block
d76c62
device here.
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1808390
d76c62
d76c62
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
d76c62
Message-Id: <20200306145226.1610708-5-abologna@redhat.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
---
d76c62
 src/util/virutil.c | 3 ---
d76c62
 1 file changed, 3 deletions(-)
d76c62
d76c62
diff --git a/src/util/virutil.c b/src/util/virutil.c
9de337
index d0fc49c39f..0b8d763584 100644
d76c62
--- a/src/util/virutil.c
d76c62
+++ b/src/util/virutil.c
9de337
@@ -1338,9 +1338,6 @@ virGetDeviceID(const char *path, int *maj, int *min)
d76c62
     if (stat(path, &sb) < 0)
d76c62
         return -errno;
d76c62
 
d76c62
-    if (!S_ISBLK(sb.st_mode))
d76c62
-        return -EINVAL;
d76c62
-
d76c62
     if (maj)
d76c62
         *maj = major(sb.st_rdev);
d76c62
     if (min)
d76c62
-- 
9de337
2.32.0
d76c62