render / rpms / libvirt

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