render / rpms / libvirt

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