Blob Blame History Raw
From a87147a0bb1bf52cb0646e5776bce19fdc51d80d Mon Sep 17 00:00:00 2001
Message-Id: <a87147a0bb1bf52cb0646e5776bce19fdc51d80d@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 8 Oct 2019 14:14:22 +0200
Subject: [PATCH] RHEL: virutil: Accept non-block devices in virGetDeviceID()

If a caller wants to learn major or minor number for a device,
let them. There's no need to check if the device is a block
device here.

https://bugzilla.redhat.com/show_bug.cgi?id=1754241

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <354b68e431cc5179ab57895536afebc0d68b2a4b.1570536610.git.mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/util/virutil.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/util/virutil.c b/src/util/virutil.c
index b25d2a5ca4..fb2a95041a 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -1672,9 +1672,6 @@ virGetDeviceID(const char *path, int *maj, int *min)
     if (stat(path, &sb) < 0)
         return -errno;
 
-    if (!S_ISBLK(sb.st_mode))
-        return -EINVAL;
-
     if (maj)
         *maj = major(sb.st_rdev);
     if (min)
-- 
2.23.0