- BuildRequire libfdt1-devel on ARM

- fate#311487: remove modprobe.conf files for autoloading of
  pv-on-hvm files.
  Rely on core kernel to skip initialization of emulated hardware
  Handle xen_emul_unplug= from xenlinux based core kernel-default

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=291
This commit is contained in:
Charles Arnold 2014-01-23 18:54:00 +00:00 committed by Git OBS Bridge
parent 03a37ddd87
commit bff807c26a
8 changed files with 129 additions and 63 deletions

View File

@ -1,32 +1,13 @@
Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
---
tools/qemu-xen-traditional-dir-remote/hw/pci.c | 44 ++++++++++++++++
tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c | 2
tools/qemu-xen-traditional-dir-remote/qemu-xen.h | 1
3 files changed, 47 insertions(+)
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/pci.c
===================================================================
--- xen-4.2.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
@@ -359,6 +359,8 @@ static void platform_ioport_write(void *
case 4:
fprintf(logfile, "Disconnect IDE hard disk...\n");
ide_unplug_harddisks();
+ fprintf(logfile, "Disconnect SCSI hard disk...\n");
+ pci_unplug_scsi();
fprintf(logfile, "Disconnect netifs...\n");
pci_unplug_netifs();
fprintf(logfile, "Shutdown taps...\n");
Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
===================================================================
--- xen-4.2.0-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
+++ xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
@@ -47,6 +47,7 @@ void unset_vram_mapping(void *opaque);
#endif
void pci_unplug_netifs(void);
+void pci_unplug_scsi(void);
void destroy_hvm_domain(void);
void unregister_iomem(target_phys_addr_t start);
Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/pci.c
===================================================================
--- xen-4.2.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/pci.c
+++ xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/pci.c
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/pci.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/pci.c
@@ -871,6 +871,50 @@ void pci_unplug_netifs(void)
}
}
@ -78,3 +59,28 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/pci.c
typedef struct {
PCIDevice dev;
PCIBus *bus;
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
@@ -364,6 +364,8 @@ static void suse_platform_ioport_write(v
* If it controlled just disk or just LAN, it would use 8 below. */
fprintf(logfile, "Disconnect IDE hard disk...\n");
ide_unplug_harddisks();
+ fprintf(logfile, "Disconnect SCSI hard disk...\n");
+ pci_unplug_scsi();
fprintf(logfile, "Disconnect netifs...\n");
pci_unplug_netifs();
fprintf(logfile, "Shutdown taps...\n");
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h
@@ -47,6 +47,7 @@ void unset_vram_mapping(void *opaque);
#endif
void pci_unplug_netifs(void);
+void pci_unplug_scsi(void);
void destroy_hvm_domain(void);
void unregister_iomem(target_phys_addr_t start);

View File

@ -1,7 +1,11 @@
Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
---
tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c | 46 ++++++++++++++++
1 file changed, 46 insertions(+)
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
===================================================================
--- xen-4.2.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
@@ -30,6 +30,8 @@
#include "qemu-xen.h"
#include "net.h"
@ -11,13 +15,13 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
#include <assert.h>
#include <xenguest.h>
@@ -335,11 +337,51 @@ static void xen_platform_ioport_writeb(v
@@ -335,8 +337,52 @@ static void xen_platform_ioport_writeb(v
}
}
+static uint32_t ioport_base;
+
+static void platform_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+static void suse_platform_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+{
+ DECLARE_DOMCTL;
+ int rc;
@ -27,6 +31,7 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+
+ switch (addr - ioport_base) {
+ case 0:
+ /* FIXME Unknown who makes use of this code! */
+ fprintf(logfile, "Init hypercall page %x, addr %x.\n", val, addr);
+ domctl.domain = (domid_t)domid;
+ domctl.u.hypercall_init.gmfn = val;
@ -35,6 +40,10 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+ fprintf(logfile, "result -> %d.\n", rc);
+ break;
+ case 4:
+ /* xen-kmp used this since xen-3.0.4, instead the official protocol from xen-3.3+
+ * pre vmdp 1.7 made use of 4 and 8 depending on how vmdp was configured.
+ * If vmdp was to control both disk and LAN it would use 4.
+ * If it controlled just disk or just LAN, it would use 8 below. */
+ fprintf(logfile, "Disconnect IDE hard disk...\n");
+ ide_unplug_harddisks();
+ fprintf(logfile, "Disconnect netifs...\n");
@ -44,8 +53,8 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+ fprintf(logfile, "Done.\n");
+ break;
+ default:
+ fprintf(logfile, "Write to bad port %x (base %x) on evtchn device.\n",
+ addr, ioport_base);
+ fprintf(logfile, "Write %x to bad port %x (base %x) on evtchn device.\n",
+ val, addr, ioport_base);
+ break;
+ }
+}
@ -54,12 +63,8 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
{
+ ioport_base = addr;
+
+ register_ioport_write(addr, 16, 4, platform_ioport_write, NULL);
+/*
+ register_ioport_write(addr, 16, 4, suse_platform_ioport_write, NULL);
+
PCIXenPlatformState *d = (PCIXenPlatformState *)pci_dev;
register_ioport_write(addr, size, 1, xen_platform_ioport_writeb, d);
register_ioport_read(addr, size, 1, xen_platform_ioport_readb, d);
+*/
}
static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr)

View File

@ -1,3 +1,2 @@
%defattr (-,root,root)
/lib/modules/%2-%1
/etc/modprobe.d/xen_pvdrivers-%1.conf

View File

@ -1,8 +1,12 @@
Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
---
tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
===================================================================
--- xen-4.2.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
@@ -365,6 +365,19 @@ static void platform_ioport_write(void *
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
@@ -370,6 +370,19 @@ static void suse_platform_ioport_write(v
net_tap_shutdown_all();
fprintf(logfile, "Done.\n");
break;
@ -20,5 +24,5 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+ }
+ break;
default:
fprintf(logfile, "Write to bad port %x (base %x) on evtchn device.\n",
addr, ioport_base);
fprintf(logfile, "Write %x to bad port %x (base %x) on evtchn device.\n",
val, addr, ioport_base);

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Sun Jan 19 00:13:06 CET 2014 - ohering@suse.de
- BuildRequire libfdt1-devel on ARM
-------------------------------------------------------------------
Sat Jan 18 00:35:46 CET 2014 - ohering@suse.de
- fate#311487: remove modprobe.conf files for autoloading of
pv-on-hvm files.
Rely on core kernel to skip initialization of emulated hardware
Handle xen_emul_unplug= from xenlinux based core kernel-default
-------------------------------------------------------------------
Wed Jan 16 13:11:32 MST 2014 - carnold@suse.com

View File

@ -60,17 +60,20 @@ ExclusiveArch: %ix86 x86_64 %arm aarch64
%else
%define with_systemd 0
%endif
%ifnarch %arm aarch64
%ifarch %arm aarch64
BuildRequires: libfdt1-devel
%endif
%ifarch %ix86 x86_64
BuildRequires: dev86
%endif
BuildRequires: fdupes
BuildRequires: glib2-devel
BuildRequires: libaio-devel
BuildRequires: libbz2-devel
BuildRequires: libpixman-1-0-devel
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: libyajl-devel
BuildRequires: libpixman-1-0-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: python-devel
@ -79,10 +82,10 @@ BuildRequires: transfig
BuildRequires: texinfo
BuildRequires: texlive
%if %suse_version > 1220
BuildRequires: texlive-latex
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
BuildRequires: texlive-helvetic
BuildRequires: texlive-latex
BuildRequires: texlive-psnfss
BuildRequires: texlive-times
BuildRequires: tex(a4.sty)
@ -105,7 +108,7 @@ BuildRequires: xz-devel
%if %suse_version <= 1110
BuildRequires: pmtools
%else
%ifnarch %arm aarch64
%ifarch %ix86 x86_64
BuildRequires: acpica
%endif
%endif
@ -157,7 +160,6 @@ Source23: block-npiv-vport
Source24: xmclone.sh
Source26: init.xen_loop
%if %{?with_kmp}0
Source27: xen_pvdrivers.conf
Source28: kmp_filelist
%endif
Source29: block-dmmd
@ -252,6 +254,7 @@ Patch381: ioemu-disable-scsi.patch
Patch382: ioemu-disable-emulated-ide-if-pv.patch
Patch383: xenpaging.qemu.flush-cache.patch
Patch384: qemu-xen-upstream-blkif-discard.patch
Patch385: xen_pvonhvm.xen_emul_unplug.patch
# Xend
Patch400: xen.migrate.tools_set_migration_constraints_from_cmdline.patch
Patch401: xen.migrate.tools_add_xm_migrate_--log_progress_option.patch
@ -598,6 +601,7 @@ Authors:
%patch382 -p1
%patch383 -p1
%patch384 -p1
%patch385 -p1
# Xend
%if %{?with_xend}0
%patch400 -p1
@ -703,7 +707,7 @@ configure_flags="${configure_flags} --disable-xend"
--enable-blktap1 ${configure_flags}
%if %{?with_dom0_support}0
CFLAGS_SAVE=$CFLAGS
%ifnarch %arm aarch64
%ifarch %ix86 x86_64
make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FLAGS}" %{?_smp_mflags} -k
%endif
make -C tools/include/xen-foreign %{?_smp_mflags}
@ -802,7 +806,6 @@ mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
install -m644 %SOURCE27 $RPM_BUILD_ROOT/etc/modprobe.d/xen_pvdrivers-$flavor.conf
done
%endif

View File

@ -1,8 +0,0 @@
# Install the paravirtualized drivers
install libata /sbin/modprobe xen-vbd 2>&1 |:; /sbin/modprobe --ignore-install libata
install ata_piix /sbin/modprobe xen-vbd 2>&1 |:; /sbin/modprobe --ignore-install ata_piix
install 8139cp /sbin/modprobe xen-vnif 2>&1 |:; /sbin/modprobe --ignore-install 8139cp
install 8139too /sbin/modprobe xen-vnif 2>&1 |:; /sbin/modprobe --ignore-install 8139too

View File

@ -0,0 +1,44 @@
fate#311487
Handle xen_emul_unplug from xenlinux based core kernel.
If the kernel was booted with xen_emul_unplug=(never|ide-disks|nics) unplug only
what was requested. Kernel cmdline option is prefered over module option.
---
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: xen-4.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
===================================================================
--- xen-4.4.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -39,6 +39,9 @@
#include <xen/interface/hvm/params.h>
#include <xen/features.h>
#include <xen/evtchn.h>
+#ifdef HAVE_XEN_PVONHVM_UNPLUG
+#include <xen/xen_pvonhvm.h>
+#endif
#ifdef __ia64__
#include <asm/xen/xencomm.h>
#endif
@@ -290,6 +293,18 @@ static int check_platform_magic(struct d
short magic, unplug = 0;
char protocol, *p, *q, *err;
+#ifdef HAVE_XEN_PVONHVM_UNPLUG
+ if (xen_pvonhvm_unplug) {
+ /* Use kernel cmdline setting */
+ if (dev_unplug)
+ printk(KERN_INFO DRV_NAME ": ignoring option dev_unplug=%s \n", dev_unplug);
+ dev_unplug = NULL;
+ if (xen_pvonhvm_unplugged_disks)
+ unplug |= UNPLUG_ALL_IDE_DISKS | UNPLUG_AUX_IDE_DISKS;
+ if (xen_pvonhvm_unplugged_nics)
+ unplug |= UNPLUG_ALL_NICS;
+ } else
+#endif
/* Unconditionally unplug everything */
if (!dev_unplug)
unplug = UNPLUG_ALL;