From 451287a11c90ec692391d1293a75d9cd7b70eb4f6d9912233962902cb6c6426a Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sun, 29 Jul 2007 08:57:36 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=24 --- blktap.patch | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ domUloader.py | 10 ++++-- xen.changes | 8 +++++ xen.spec | 9 +++++- 4 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 blktap.patch diff --git a/blktap.patch b/blktap.patch new file mode 100644 index 0000000..cef8f34 --- /dev/null +++ b/blktap.patch @@ -0,0 +1,84 @@ +bug #239173 +bug #242953 + +Index: xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -1833,7 +1833,7 @@ class XendDomainInfo: + (fn, BOOTLOADER_LOOPBACK_DEVICE)) + + vbd = { +- 'mode': 'RO', ++ 'mode': 'RW', + 'device': BOOTLOADER_LOOPBACK_DEVICE, + } + +Index: xen-3.1-testing/tools/ioemu/xenstore.c +=================================================================== +--- xen-3.1-testing.orig/tools/ioemu/xenstore.c ++++ xen-3.1-testing/tools/ioemu/xenstore.c +@@ -81,9 +81,9 @@ void xenstore_parse_domain_config(int do + { + char **e = NULL; + char *buf = NULL, *path; +- char *fpath = NULL, *bpath = NULL, ++ char *fpath = NULL, *bpath = NULL, *btype = NULL, + *dev = NULL, *params = NULL, *type = NULL, *media_present = NULL; +- int i, is_scsi; ++ int i, is_scsi, is_tap; + unsigned int len, num, hd_index; + + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) +@@ -116,6 +116,14 @@ void xenstore_parse_domain_config(int do + bpath = xs_read(xsh, XBT_NULL, buf, &len); + if (bpath == NULL) + continue; ++ /* check to see if type is tap or not */ ++ if (pasprintf(&buf, "%s/type", bpath) == -1) ++ continue; ++ free(btype); ++ btype = xs_read(xsh, XBT_NULL, buf, &len); ++ if (btype == NULL) ++ continue; ++ is_tap = !strncmp(btype, "tap", 3); + /* read the name of the device */ + if (pasprintf(&buf, "%s/dev", bpath) == -1) + continue; +@@ -123,6 +131,13 @@ void xenstore_parse_domain_config(int do + dev = xs_read(xsh, XBT_NULL, buf, &len); + if (dev == NULL) + continue; ++ /* Force xvdN to look like hdN */ ++ if (is_tap && !strncmp(dev, "xvd", 3)) { ++ memmove(dev, dev+1, strlen(dev)); ++ dev[0] = 'h'; ++ dev[1] = 'd'; ++ fprintf(stderr, "Got blktap '%s'\n", dev); ++ } + is_scsi = !strncmp(dev, "sd", 2); + if ((strncmp(dev, "hd", 2) && !is_scsi) || strlen(dev) != 3 ) + continue; +@@ -140,6 +155,14 @@ void xenstore_parse_domain_config(int do + params = xs_read(xsh, XBT_NULL, buf, &len); + if (params == NULL) + continue; ++ /* Strip off blktap sub-type prefix aio: etc */ ++ if (is_tap) { ++ char *offset = strchr(params, ':'); ++ if (!offset) ++ continue; ++ memmove(params, offset+1, strlen(offset+1)+1); ++ fprintf(stderr, "Got params '%s'\n", params); ++ } + /* + * check if device has a phantom vbd; the phantom is hooked + * to the frontend device (for ease of cleanup), so lookup +@@ -196,6 +219,7 @@ void xenstore_parse_domain_config(int do + free(type); + free(params); + free(dev); ++ free(btype); + free(bpath); + free(buf); + free(path); diff --git a/domUloader.py b/domUloader.py index 08e7baa..34a7a55 100644 --- a/domUloader.py +++ b/domUloader.py @@ -77,12 +77,13 @@ class Wholedisk: "Class representing a whole disk that may have partitions" def __init__(self, vdev, pdev): "c'tor: set up" - self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE])) self.ldev = None self.vdev = vdev self.pdev = pdev self.mapped = 0 self.partitions = [] + self.pcount = 0 + self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE])) self.pcount = self.scanpartitions() def physdev(self): @@ -251,11 +252,16 @@ class Partition: mopts = "" if fstype: mopts += " -t %s" % fstype - mopts += " -o %s" % options + if options: + mopts += " -o %s" % options verbose_print("mount %s '%s' %s" % (mopts, self.pdev, mtpt)) fd = os.popen("mount %s '%s' %s" % (mopts, self.pdev, mtpt)) err = fd.close() if err: + try: + os.rmdir(mtpt) + except: + pass raise RuntimeError("Error %i from mount %s '%s' on %s" % \ (err, mopts, self.pdev, mtpt)) self.mountpoint = mtpt diff --git a/xen.changes b/xen.changes index 8fe172a..92405f5 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jul 27 10:50:58 MDT 2007 - ccoffing@novell.com + +- #242953: Allow HVM to use blktap +- #239173: block-attach as RW for domUloader to avoid failures with + reiserfs (since blktap does not yet correctly communicate RO to + the kernel) + ------------------------------------------------------------------- Mon Jul 23 12:57:45 MDT 2007 - ccoffing@novell.com diff --git a/xen.spec b/xen.spec index 80fc1c5..0081781 100644 --- a/xen.spec +++ b/xen.spec @@ -34,7 +34,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit BuildRequires: kernel-source kernel-syms xorg-x11 %endif Version: 3.1.0_15042 -Release: 14 +Release: 19 License: GPL v2 or later Group: System/Kernel Autoreqprov: on @@ -155,6 +155,7 @@ Patch208: x86-emul-rf.patch Patch209: vmx-check-descr.patch Patch210: x86_64-syscall-clear-df.patch Patch211: 32on64-extra-mem.patch +Patch212: blktap.patch URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 x86_64 ia64 @@ -623,6 +624,7 @@ Authors: %patch209 -p1 %patch210 -p1 %patch211 -p1 +%patch212 -p1 XEN_EXTRAVERSION=%version-%release XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}} sed -i "s/XEN_EXTRAVERSION[\t ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile @@ -934,6 +936,11 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info /sbin/ldconfig %changelog +* Fri Jul 27 2007 - ccoffing@novell.com +- #242953: Allow HVM to use blktap +- #239173: block-attach as RW for domUloader to avoid failures with + reiserfs (since blktap does not yet correctly communicate RO to + the kernel) * Mon Jul 23 2007 - ccoffing@novell.com - Drop xen-bootloader-dryrun.diff; not needed for xen 3.1 - rpmlint: Actually apply patch for #280637