render / rpms / libvirt

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