forked from rpms/libvirt
38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
|
From c37b04bc3d636d8d96f9e40075336ff5166d5585 Mon Sep 17 00:00:00 2001
|
||
|
Message-Id: <c37b04bc3d636d8d96f9e40075336ff5166d5585@dist-git>
|
||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||
|
Date: Fri, 6 Mar 2020 15:52:24 +0100
|
||
|
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=1808390
|
||
|
|
||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||
|
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||
|
Message-Id: <20200306145226.1610708-5-abologna@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 970b9f1fec..135e1e5943 100644
|
||
|
--- a/src/util/virutil.c
|
||
|
+++ b/src/util/virutil.c
|
||
|
@@ -1343,9 +1343,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.31.1
|
||
|
|