render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
d76c62
From cd2640c256389b4041e4cd38fd72f77184bb4414 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <cd2640c256389b4041e4cd38fd72f77184bb4414@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
d76c62
index a0fd7618ee..f142951acf 100644
d76c62
--- a/src/util/virutil.c
d76c62
+++ b/src/util/virutil.c
d76c62
@@ -1379,9 +1379,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
-- 
d76c62
2.25.1
d76c62