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