diff options
author | CoprDistGit <infra@openeuler.org> | 2023-09-12 01:06:10 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-09-12 01:06:10 +0000 |
commit | d6d9b3795aceb43d6aa1fcab85193e88049ce309 (patch) | |
tree | 6fc7120d35bbdccab9830f6b46100bbed6501bf6 /libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch | |
parent | 0081bffd55f7e9dc8df063521321178b95758d24 (diff) |
automatic import of libvirtopeneuler22.03_LTS
Diffstat (limited to 'libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch')
-rw-r--r-- | libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch b/libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch new file mode 100644 index 0000000..2edf1ad --- /dev/null +++ b/libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch @@ -0,0 +1,37 @@ +From 82715bfd06ae16b20bf7cb872f43013e9fdb97a7 Mon Sep 17 00:00:00 2001 +Message-Id: <82715bfd06ae16b20bf7cb872f43013e9fdb97a7@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 b1e37b45c5..ced8493516 100644 +--- a/src/util/virutil.c ++++ b/src/util/virutil.c +@@ -1333,9 +1333,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.33.1 + |