render / rpms / libvirt

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