]> git.pld-linux.org Git - packages/parted.git/blob - 0057-libparted-Don-t-warn-if-no-HDIO_GET_IDENTITY-ioctl.patch
- rel 4; tons of patches from FC
[packages/parted.git] / 0057-libparted-Don-t-warn-if-no-HDIO_GET_IDENTITY-ioctl.patch
1 From a6612fb6dd3746cfc9138ebc84210945a8fffa10 Mon Sep 17 00:00:00 2001
2 From: Sebastian Parschauer <sparschauer@suse.de>
3 Date: Tue, 4 Oct 2016 11:37:30 +0200
4 Subject: [PATCH 57/75] libparted: Don't warn if no HDIO_GET_IDENTITY ioctl
5
6 Fully virtualized Xen VMs (HVM) use Linux IDE devices which don't
7 support the HDIO_GET_IDENTITY ioctl. EINVAL is returned, a warning
8 is printed and the device model is set to "Generic IDE" in that
9 case. The problem is seeing the warning all the time. So drop it
10 for this case.
11
12 Signed-off-by: Brian C. Lane <bcl@redhat.com>
13 ---
14  libparted/arch/linux.c | 7 ++++++-
15  1 file changed, 6 insertions(+), 1 deletion(-)
16
17 diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
18 index b7ba5de..2058697 100644
19 --- a/libparted/arch/linux.c
20 +++ b/libparted/arch/linux.c
21 @@ -931,6 +931,7 @@ init_ide (PedDevice* dev)
22          PedExceptionOption      ex_status;
23          char                    hdi_buf[41];
24          int                     sector_multiplier = 0;
25 +        int                     r;
26  
27          if (!_device_stat (dev, &dev_stat))
28                  goto error;
29 @@ -938,7 +939,11 @@ init_ide (PedDevice* dev)
30          if (!_device_open_ro (dev))
31                  goto error;
32  
33 -        if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) {
34 +        r = ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi);
35 +        if (r && errno == EINVAL) {
36 +                /* silently ignore unsupported ioctl */
37 +                dev->model = strdup(_("Generic IDE"));
38 +        } else if (r) {
39                  ex_status = ped_exception_throw (
40                                  PED_EXCEPTION_WARNING,
41                                  PED_EXCEPTION_IGNORE_CANCEL,
42 -- 
43 2.9.3
44
This page took 0.056444 seconds and 3 git commands to generate.