render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
d0f569
From ac8357ab7dd676af82b971673f8d7e862ff07624 Mon Sep 17 00:00:00 2001
d0f569
Message-Id: <ac8357ab7dd676af82b971673f8d7e862ff07624@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
d0f569
index b1e37b45c5..ced8493516 100644
fbe740
--- a/src/util/virutil.c
fbe740
+++ b/src/util/virutil.c
d0f569
@@ -1333,9 +1333,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
-- 
d0f569
2.34.1
fbe740