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
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
12 Signed-off-by: Brian C. Lane <bcl@redhat.com>
14 libparted/arch/linux.c | 7 ++++++-
15 1 file changed, 6 insertions(+), 1 deletion(-)
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;
24 int sector_multiplier = 0;
27 if (!_device_stat (dev, &dev_stat))
29 @@ -938,7 +939,11 @@ init_ide (PedDevice* dev)
30 if (!_device_open_ro (dev))
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"));
39 ex_status = ped_exception_throw (
40 PED_EXCEPTION_WARNING,
41 PED_EXCEPTION_IGNORE_CANCEL,