- Detect Xen virtual block devices and set model name appropriately

This commit is contained in:
David Cantrell 2007-08-07 18:11:31 +00:00
parent ca7e6d5dfd
commit 6c3525dc27
2 changed files with 56 additions and 1 deletions

50
parted-1.8.6-xvd.patch Normal file
View File

@ -0,0 +1,50 @@
diff -up parted-1.8.6/libparted/arch/linux.c.xvd parted-1.8.6/libparted/arch/linux.c
--- parted-1.8.6/libparted/arch/linux.c.xvd 2007-08-07 14:05:59.000000000 -0400
+++ parted-1.8.6/libparted/arch/linux.c 2007-08-07 14:07:13.000000000 -0400
@@ -248,6 +248,7 @@ struct blkdev_ioctl_param {
#define VIODASD_MAJOR 112
#define SX8_MAJOR1 160
#define SX8_MAJOR2 161
+#define XVD_MAJOR 202
#define SCSI_BLK_MAJOR(M) ( \
(M) == SCSI_DISK0_MAJOR \
@@ -450,6 +451,8 @@ _device_probe_type (PedDevice* dev)
} else if (_is_dm_major(dev_major)) {
dev->type = PED_DEVICE_DM;
#endif
+ } else if (dev_major == XVD_MAJOR && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_XVD;
} else {
dev->type = PED_DEVICE_UNKNOWN;
}
@@ -1152,6 +1155,11 @@ linux_new (const char* path)
break;
#endif
+ case PED_DEVICE_XVD:
+ if (!init_generic (dev, _("Xen Virtual Block Device")))
+ goto error_free_arch_specific;
+ break;
+
case PED_DEVICE_UNKNOWN:
if (!init_generic (dev, _("Unknown")))
goto error_free_arch_specific;
diff -up parted-1.8.6/include/parted/device.h.xvd parted-1.8.6/include/parted/device.h
--- parted-1.8.6/include/parted/device.h.xvd 2007-01-12 10:15:10.000000000 -0500
+++ parted-1.8.6/include/parted/device.h 2007-08-07 14:07:13.000000000 -0400
@@ -45,11 +45,11 @@ typedef enum {
PED_DEVICE_UBD = 8,
PED_DEVICE_DASD = 9,
PED_DEVICE_VIODASD = 10,
- PED_DEVICE_SX8 = 11
+ PED_DEVICE_SX8 = 11,
#ifdef ENABLE_DEVICE_MAPPER
- ,
- PED_DEVICE_DM = 12
+ PED_DEVICE_DM = 12,
#endif
+ PED_DEVICE_XVD = 13
} PedDeviceType;
typedef struct _PedDevice PedDevice;

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 1.8.6
Release: 5%{?dist}
Release: 6%{?dist}
License: GPL
Group: Applications/System
URL: http://www.gnu.org/software/parted
@ -14,6 +14,7 @@ Patch0: %{name}-1.8.6-warnings.patch
Patch1: %{name}-1.8.6-notransname.patch
Patch2: %{name}-1.8.6-off-by-one.patch
Patch3: %{name}-1.8.6-primary-boundary.patch
Patch4: %{name}-1.8.6-xvd.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel readline-devel ncurses-devel
@ -47,6 +48,7 @@ Parted library, you need to install this package.
%patch1 -p1 -b .notransname
%patch2 -p1 -b .offbyone
%patch3 -p1 -b .boundary
%patch4 -p1 -b .xvd
%build
%configure --enable-device-mapper --enable-selinux --disable-static
@ -91,6 +93,9 @@ fi
%{_libdir}/pkgconfig/libparted.pc
%changelog
* Tue Aug 07 2007 David Cantrell <dcantrell@redhat.com> - 1.8.6-6
- Detect Xen virtual block devices and set model name appropriately
* Thu Apr 19 2007 David Cantrell <dcantrell@redhat.com> - 1.8.6-5
- Spec file cleanups for merge review (#226230)