From 0652bf3563918ba890a7eb4a6c20bd7d78938832 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 10 Feb 2017 18:46:47 +0000 Subject: [PATCH] - updated to 2.8.0, partial PLD merge --- qemu-sh.patch | 12 -- qemu-user-execve.patch | 261 +++++++++++++++++++++++++++++++++++++++++ qemu.spec | 188 ++++++++++++++++++++++++----- x32.patch | 41 +++++++ 4 files changed, 461 insertions(+), 41 deletions(-) delete mode 100644 qemu-sh.patch create mode 100644 qemu-user-execve.patch create mode 100644 x32.patch diff --git a/qemu-sh.patch b/qemu-sh.patch deleted file mode 100644 index f2f4f8e..0000000 --- a/qemu-sh.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urp qemu-2.6.1.orig/configure qemu-2.6.1/configure ---- qemu-2.6.1.orig/configure 2016-08-22 12:55:29.238554000 +0000 -+++ qemu-2.6.1/configure 2016-08-22 12:55:44.167554000 +0000 -@@ -4769,7 +4769,7 @@ echo "GNUTLS rnd $gnutls_rnd" - echo "libgcrypt $gcrypt" - echo "libgcrypt kdf $gcrypt_kdf" - if test "$nettle" = "yes"; then -- echo "nettle $nettle ($nettle_version)" -+ echo "nettle $nettle \($nettle_version)" - else - echo "nettle $nettle" - fi diff --git a/qemu-user-execve.patch b/qemu-user-execve.patch new file mode 100644 index 0000000..78c0e57 --- /dev/null +++ b/qemu-user-execve.patch @@ -0,0 +1,261 @@ +https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/ +https://github.com/resin-io/qemu/commit/782e5bb77014ff136f7bb6133a911e5f53e914a7 + +https://github.com/resin-io/qemu/commit/782e5bb77014ff136f7bb6133a911e5f53e914a7#commitcomment-17193923 +It has gone through review[1][2][3] and I'm waiting for the maintainer of the linux-user subsystem to accept it in his tree. + +[1] https://patchwork.ozlabs.org/patch/569452/ +[2] https://patchwork.ozlabs.org/patch/573877/ +[3] https://patchwork.ozlabs.org/patch/582756/ + +From patchwork Mon Feb 15 05:51:47 2016 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v3] linux-user: add option to intercept execve() syscalls +From: Petros Angelatos +X-Patchwork-Id: 582756 +Message-Id: <1455515507-26877-1-git-send-email-petrosagg@resin.io> +To: qemu-devel@nongnu.org +Cc: lucas.kaldstrom@hotmail.co.uk, peter.maydell@linaro.org, + riku.voipio@iki.fi, + laurent@vivier.eu, Petros Angelatos +Date: Sun, 14 Feb 2016 21:51:47 -0800 + +In order for one to use QEMU user mode emulation under a chroot, it is +required to use binfmt_misc. This can be avoided by QEMU never doing a +raw execve() to the host system. + +Introduce a new option, -execve, that uses the current QEMU interpreter +to intercept execve(). + +qemu_execve() will prepend the interpreter path , similar to what +binfmt_misc would do, and then pass the modified execve() to the host. + +It is necessary to parse hashbang scripts in that function otherwise +the kernel will try to run the interpreter of a script without QEMU and +get an invalid exec format error. + +Signed-off-by: Petros Angelatos +Tested-by: Laurent Vivier +Reviewed-by: Laurent Vivier +--- +v3 changes: + - rebase the patchset against current code + +--- qemu-2.7.0/linux-user/main.c~ 2016-09-26 12:07:20.000000000 +0300 ++++ qemu-2.7.0/linux-user/main.c 2016-09-26 12:09:24.258470304 +0300 +@@ -18,6 +18,7 @@ + */ + #include "qemu/osdep.h" + #include "qemu-version.h" ++#include + #include + #include + +@@ -75,6 +76,7 @@ static void usage(int exitcode); + + static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX; + const char *qemu_uname_release; ++const char *qemu_execve_path; + + /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so + we allocate a bigger stack. Need a better solution, for example +@@ -3824,6 +3826,38 @@ static void handle_arg_guest_base(const char *arg) + have_guest_base = 1; + } + ++static void handle_arg_execve(const char *arg) ++{ ++ const char *execfn; ++ char buf[PATH_MAX]; ++ char *ret; ++ int len; ++ ++ /* try getauxval() */ ++ execfn = (const char *) getauxval(AT_EXECFN); ++ ++ if (execfn != 0) { ++ ret = realpath(execfn, buf); ++ ++ if (ret != NULL) { ++ qemu_execve_path = strdup(buf); ++ return; ++ } ++ } ++ ++ /* try /proc/self/exe */ ++ len = readlink("/proc/self/exe", buf, sizeof(buf) - 1); ++ ++ if (len != -1) { ++ buf[len] = '\0'; ++ qemu_execve_path = strdup(buf); ++ return; ++ } ++ ++ fprintf(stderr, "qemu_execve: unable to determine intepreter's path\n"); ++ exit(EXIT_FAILURE); ++} ++ + static void handle_arg_reserved_va(const char *arg) + { + char *p; +@@ -3909,6 +3943,8 @@ static const struct qemu_argument arg_table[] = { + "uname", "set qemu uname release string to 'uname'"}, + {"B", "QEMU_GUEST_BASE", true, handle_arg_guest_base, + "address", "set guest_base address to 'address'"}, ++ {"execve", "QEMU_EXECVE", false, handle_arg_execve, ++ "", "use this interpreter when a process calls execve()"}, + {"R", "QEMU_RESERVED_VA", true, handle_arg_reserved_va, + "size", "reserve 'size' bytes for guest virtual address space"}, + {"d", "QEMU_LOG", true, handle_arg_log, +diff --git a/linux-user/qemu.h b/linux-user/qemu.h +index bd90cc3..0d9b058 100644 +--- a/linux-user/qemu.h ++++ b/linux-user/qemu.h +@@ -140,6 +140,7 @@ void init_task_state(TaskState *ts); + void task_settid(TaskState *); + void stop_all_tasks(void); + extern const char *qemu_uname_release; ++extern const char *qemu_execve_path; + extern unsigned long mmap_min_addr; + + /* ??? See if we can avoid exposing so much of the loader internals. */ +--- qemu-2.7.0/linux-user/syscall.c~ 2016-09-26 12:10:36.000000000 +0300 ++++ qemu-2.7.0/linux-user/syscall.c 2016-09-26 12:13:54.312490312 +0300 +@@ -99,6 +99,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -5842,6 +5843,118 @@ static target_timer_t get_timer_id(abi_long arg) + return timerid; + } + ++/* qemu_execve() Must return target values and target errnos. */ ++static abi_long qemu_execve(char *filename, char *argv[], ++ char *envp[]) ++{ ++ char *i_arg = NULL, *i_name = NULL; ++ char **new_argp; ++ int argc, fd, ret, i, offset = 3; ++ char *cp; ++ char buf[BINPRM_BUF_SIZE]; ++ ++ /* normal execve case */ ++ if (qemu_execve_path == NULL || *qemu_execve_path == 0) { ++ return get_errno(execve(filename, argv, envp)); ++ } ++ ++ for (argc = 0; argv[argc] != NULL; argc++) { ++ /* nothing */ ; ++ } ++ ++ fd = open(filename, O_RDONLY); ++ if (fd == -1) { ++ return get_errno(fd); ++ } ++ ++ ret = read(fd, buf, BINPRM_BUF_SIZE); ++ if (ret == -1) { ++ close(fd); ++ return get_errno(ret); ++ } ++ ++ /* if we have less than 2 bytes, we can guess it is not executable */ ++ if (ret < 2) { ++ close(fd); ++ return -host_to_target_errno(ENOEXEC); ++ } ++ ++ close(fd); ++ ++ /* adapted from the kernel ++ * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/binfmt_script.c ++ */ ++ if ((buf[0] == '#') && (buf[1] == '!')) { ++ /* ++ * This section does the #! interpretation. ++ * Sorta complicated, but hopefully it will work. -TYT ++ */ ++ ++ buf[BINPRM_BUF_SIZE - 1] = '\0'; ++ cp = strchr(buf, '\n'); ++ if (cp == NULL) { ++ cp = buf + BINPRM_BUF_SIZE - 1; ++ } ++ *cp = '\0'; ++ while (cp > buf) { ++ cp--; ++ if ((*cp == ' ') || (*cp == '\t')) { ++ *cp = '\0'; ++ } else { ++ break; ++ } ++ } ++ for (cp = buf + 2; (*cp == ' ') || (*cp == '\t'); cp++) { ++ /* nothing */ ; ++ } ++ if (*cp == '\0') { ++ return -ENOEXEC; /* No interpreter name found */ ++ } ++ i_name = cp; ++ i_arg = NULL; ++ for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++) { ++ /* nothing */ ; ++ } ++ while ((*cp == ' ') || (*cp == '\t')) { ++ *cp++ = '\0'; ++ } ++ if (*cp) { ++ i_arg = cp; ++ } ++ ++ if (i_arg) { ++ offset = 5; ++ } else { ++ offset = 4; ++ } ++ } ++ ++ new_argp = alloca((argc + offset + 1) * sizeof(void *)); ++ ++ /* Copy the original arguments with offset */ ++ for (i = 0; i < argc; i++) { ++ new_argp[i + offset] = argv[i]; ++ } ++ ++ new_argp[0] = strdup(qemu_execve_path); ++ new_argp[1] = strdup("-0"); ++ new_argp[offset] = filename; ++ new_argp[argc + offset] = NULL; ++ ++ if (i_name) { ++ new_argp[2] = i_name; ++ new_argp[3] = i_name; ++ ++ if (i_arg) { ++ new_argp[4] = i_arg; ++ } ++ } else { ++ new_argp[2] = argv[0]; ++ } ++ ++ return get_errno(safe_execve(qemu_execve_path, new_argp, envp)); ++} ++ + /* do_syscall() should always have a single exit point at the end so + that actions, such as logging of syscall results, can be performed. + All errnos that do_syscall() returns must be -TARGET_. */ +@@ -7703,7 +7703,7 @@ + * before the execve completes and makes it the other + * program's problem. + */ +- ret = get_errno(safe_execve(p, argp, envp)); ++ ret = qemu_execve(p, argp, envp); + unlock_user(p, arg1, 0); + + goto execve_end; diff --git a/qemu.spec b/qemu.spec index 330e93a..5cde328 100644 --- a/qemu.spec +++ b/qemu.spec @@ -23,6 +23,7 @@ %bcond_without usbredir # usb network redirection support %bcond_without system_seabios # system seabios binary %bcond_without snappy # snappy compression library +%bcond_without user_static # build linux-user static packages %bcond_with lttng # lttng-ust trace backend support %bcond_with systemtap # SystemTap/dtrace trace backend support @@ -30,15 +31,19 @@ %undefine with_gtk3 %endif +%ifarch x32 +%undefine with_xen +%endif + Summary: QEMU CPU Emulator Summary(pl.UTF-8): QEMU - emulator procesora Name: qemu -Version: 2.6.2 +Version: 2.8.0 Release: 1 License: GPL v2 Group: Applications/Emulators Source0: http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2 -# Source0-md5: bdf1f3d0c177ebeb35a079a4bc3fc74e +# Source0-md5: 17940dce063b6ce450a12e719a6c9c43 # Loads kvm kernel modules at boot Source3: kvm-modules-load.conf # Creates /dev/kvm @@ -52,9 +57,10 @@ Source12: 99-%{name}-guest-agent.rules Patch0: %{name}-cflags.patch Patch1: vgabios-widescreens.patch Patch2: %{name}-whitelist.patch -Patch3: %{name}-xattr.patch -Patch4: libjpeg-boolean.patch -Patch5: %{name}-sh.patch +Patch3: %{name}-user-execve.patch +Patch4: %{name}-xattr.patch +Patch5: libjpeg-boolean.patch +Patch6: x32.patch URL: http://www.qemu-project.org/ %{?with_gl:BuildRequires: OpenGL-GLX-devel} %{?with_gl:BuildRequires: OpenGL-devel} @@ -125,6 +131,12 @@ BuildRequires: gtk+2-devel >= 2:2.18.0 BuildRequires: gtk+3-devel >= 3.0.0 %{?with_vte:BuildRequires: vte2.90-devel >= 0.32.0} %endif +%if %{with user_static} +BuildRequires: glib2-static +BuildRequires: glibc-static +BuildRequires: pcre-static +BuildRequires: zlib-static +%endif Requires: %{name}-img = %{version}-%{release} Requires: %{name}-system-aarch64 = %{version}-%{release} Requires: %{name}-system-alpha = %{version}-%{release} @@ -215,7 +227,6 @@ Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd Requires: glib2 >= 1:2.22 -%{?with_libnfs:Requires: libnfs >= 1.9.3} Requires: libssh2 >= 1.2.8 Provides: group(qemu) Provides: user(qemu) @@ -282,6 +293,17 @@ dobrą szybkość emulacji dzięki użyciu translacji dynamicznej. Ten pakiet udostępnia emulację trybu użytkownika środowisk QEMU. +%package user-static +Summary: QEMU user mode emulation of qemu targets static build +Group: Development/Tools + +%description user-static +QEMU is a generic and open source processor emulator which achieves a +good emulation speed by using dynamic translation. + +This package provides the user mode emulation of qemu targets built as +static binaries + %package system-aarch64 Summary: QEMU system emulator for AArch64 Summary(pl.UTF-8): QEMU - emulator systemu z procesorem AArch64 @@ -694,6 +716,7 @@ Summary: QEMU module for 'dmg' block devices Summary(pl.UTF-8): Moduł QEMU dla urządeń blokowych typu 'dmg' Group: Development/Tools Requires: %{name}-common = %{version}-%{release} +Requires: bzip2-libs %description module-block-dmg 'dmg' block device support for QEMU. @@ -727,6 +750,19 @@ Requires: libiscsi >= 1.9.0 %description module-block-iscsi -l pl.UTF-8 Moduł QEMU dla urządeń blokowych typu 'iscsi'. +%package module-block-nfs +Summary: QEMU module for 'nfs' block devices +Summary(pl.UTF-8): Moduł QEMU dla urządeń blokowych typu 'nfs' +Group: Development/Tools +Requires: %{name}-common = %{version}-%{release} +Requires: libnfs >= 1.9.3 + +%description module-block-nfs +'nfs' block device support for QEMU. + +%description module-block-nfs -l pl.UTF-8 +Moduł QEMU dla urządeń blokowych typu 'nfs'. + %package module-block-rbd Summary: QEMU module for 'rbd' block devices Summary(pl.UTF-8): Moduł QEMU dla urządeń blokowych typu 'rbd' @@ -759,21 +795,44 @@ Moduł QEMU dla urządeń blokowych typu 'ssh'. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # workaround for conflict with alsa/error.h ln -s ../error.h qapi/error.h %build -./configure \ - --extra-cflags="%{rpmcflags} %{rpmcppflags} -fPIE -DPIE" \ - --extra-ldflags="%{rpmldflags} -pie -Wl,-z,relro -Wl,-z,now" \ + +build() { + local target=$1 + shift + + install -d build-$target + cd build-$target + + ../configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} \ --sysconfdir=%{_sysconfdir} \ + --localstatedir=%{_localstatedir} \ + --interp-prefix=%{_libdir}/qemu/lib-%%M \ --cc="%{__cc}" \ --host-cc="%{__cc}" \ --disable-strip \ + --enable-trace-backends="nop%{?with_systemtap:,dtrace}%{?with_lttng:,ust}" \ + --enable-kvm \ + "$@" + + %{__make} \ + V=1 \ + %{!?with_smartcard:CONFIG_USB_SMARTCARD=n} + + cd .. +} + +build dynamic \ + --extra-cflags="%{rpmcflags} %{rpmcppflags} -fPIE -DPIE" \ + --extra-ldflags="%{rpmldflags} -pie -Wl,-z,relro -Wl,-z,now" \ %{__enable_disable xseg archipelago} \ --enable-attr \ %{__enable_disable bluetooth bluez} \ @@ -793,7 +852,6 @@ ln -s ../error.h qapi/error.h %{__enable_disable spice} \ %{__enable_disable smartcard smartcard} \ --enable-tpm \ - --enable-trace-backends="nop%{?with_systemtap:,dtrace}%{?with_lttng:,ust}" \ %{__enable_disable usbredir usb-redir} \ --enable-uuid \ --enable-vde \ @@ -802,7 +860,6 @@ ln -s ../error.h qapi/error.h --enable-vnc-png \ --enable-vnc-sasl \ %{!?with_vte:--disable-vte} \ - --enable-kvm \ %{__enable_disable xen} \ --enable-modules \ --disable-netmap \ @@ -810,16 +867,36 @@ ln -s ../error.h qapi/error.h --enable-lzo \ %{__enable_disable snappy} \ --audio-drv-list="alsa%{?with_iss:,oss}%{?with_sdl:,sdl}%{?with_esd:,esd}%{?with_pulseaudio:,pa}" \ - --interp-prefix=%{_libdir}/qemu/lib-%%M \ %if %{without gtk2} && %{without gtk3} --disable-gtk %else --with-gtkabi="%{?with_gtk2:2.0}%{!?with_gtk2:3.0}" %endif -%{__make} \ - V=1 \ - %{!?with_smartcard:CONFIG_USB_SMARTCARD=n} +%if %{with user_static} +build static \ + --disable-brlapi \ + --disable-cap-ng \ + --disable-curl \ + --disable-curses \ + --disable-gcrypt \ + --disable-gnutls \ + --disable-gtk \ + --disable-guest-agent \ + --disable-guest-agent-msi \ + --disable-libnfs \ + --disable-nettle \ + --disable-pie \ + --disable-sdl \ + --disable-spice \ + --disable-tcmalloc \ + --disable-tools \ + --disable-uuid \ + --enable-user \ + --disable-system \ + --static + +%endif # rebuild patched vesa tables with additional widescreen modes. %{__make} -C roms/vgabios stdvga-bios @@ -828,11 +905,23 @@ ln -s ../error.h qapi/error.h %install rm -rf $RPM_BUILD_ROOT -install -d \ +install -d $RPM_BUILD_ROOT/usr/lib/binfmt.d \ $RPM_BUILD_ROOT/etc/{qemu,sysconfig,udev/rules.d,modules-load.d} \ $RPM_BUILD_ROOT{%{_sysconfdir}/sasl,%{_sbindir}} -%{__make} install \ +%if %{with user_static} +%{__make} -C build-static install \ + %{!?with_smartcard:CONFIG_USB_SMARTCARD=n} \ + DESTDIR=$RPM_BUILD_ROOT + +# Give all QEMU user emulators a -static suffix +for src in $RPM_BUILD_ROOT%{_bindir}/qemu-*; do + mv $src $src-static +done + +%endif + +%{__make} -C build-dynamic install \ %{!?with_smartcard:CONFIG_USB_SMARTCARD=n} \ DESTDIR=$RPM_BUILD_ROOT @@ -846,8 +935,7 @@ EOF install -p qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl/qemu.conf -%ifarch %{ix86} %{x8664} -install -p scripts/kvm/kvm_stat $RPM_BUILD_ROOT%{_bindir} +%ifarch %{ix86} %{x8664} x32 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/modules-load.d/kvm.conf install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d %endif @@ -861,7 +949,7 @@ install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf install -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d # packaged as %doc -%{__rm} $RPM_BUILD_ROOT%{_docdir}/qemu/qemu-{doc,tech}.html +%{__rm} $RPM_BUILD_ROOT%{_docdir}/qemu/qemu-doc.html %{__rm} $RPM_BUILD_ROOT%{_docdir}/qemu/qmp-commands.txt # install patched vesa tables with additional widescreen modes. @@ -906,7 +994,8 @@ fi %files common -f %{name}.lang %defattr(644,root,root,755) -%doc LICENSE README qemu-doc.html qemu-tech.html qmp-commands.txt +%doc LICENSE README +%doc build-dynamic/qemu-doc.html %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/qemu-ifup %config(noreplace) %verify(not md5 mtime size) /etc/ksmtuned.conf %config(noreplace) %verify(not md5 mtime size) /etc/sasl/qemu.conf @@ -915,6 +1004,7 @@ fi %attr(640,root,qemu) %config(noreplace) %verify(not md5 mtime size) /etc/qemu/bridge.conf %attr(755,root,root) %{_bindir}/virtfs-proxy-helper %attr(755,root,root) %{_bindir}/qemu-nbd +%attr(755,root,root) %{_bindir}/qemu-tilegx %attr(755,root,root) %{_libdir}/qemu-bridge-helper %attr(755,root,root) %{_sbindir}/ksmctl %attr(755,root,root) %{_sbindir}/ksmtuned @@ -925,21 +1015,22 @@ fi %dir %{_datadir}/qemu %{_datadir}/%{name}/keymaps %{_datadir}/%{name}/qemu-icon.bmp -%{_datadir}/%{name}/trace-events +%{_datadir}/%{name}/trace-events-all # various bios images # all should be probably moved to the right system subpackage -%{_datadir}/%{name}/QEMU,cgthree.bin -%{_datadir}/%{name}/QEMU,tcx.bin %{_datadir}/%{name}/bamboo.dtb +%{_datadir}/%{name}/efi-e1000e.rom %{_datadir}/%{name}/efi-e1000.rom %{_datadir}/%{name}/efi-eepro100.rom %{_datadir}/%{name}/efi-ne2k_pci.rom %{_datadir}/%{name}/efi-pcnet.rom %{_datadir}/%{name}/efi-rtl8139.rom %{_datadir}/%{name}/efi-virtio.rom +%{_datadir}/%{name}/efi-vmxnet3.rom %{_datadir}/%{name}/kvmvapic.bin %{_datadir}/%{name}/linuxboot.bin +%{_datadir}/%{name}/linuxboot_dma.bin %{_datadir}/%{name}/multiboot.bin %{_datadir}/%{name}/openbios-ppc %{_datadir}/%{name}/openbios-sparc* @@ -953,9 +1044,12 @@ fi %{_datadir}/%{name}/pxe-pcnet.rom %{_datadir}/%{name}/pxe-rtl8139.rom %{_datadir}/%{name}/pxe-virtio.rom +%{_datadir}/%{name}/QEMU,cgthree.bin %{_datadir}/%{name}/qemu_logo_no_text.svg +%{_datadir}/%{name}/QEMU,tcx.bin %{_datadir}/%{name}/s390-ccw.img %{_datadir}/%{name}/sgabios.bin +%{_datadir}/%{name}/skiboot.lid %{_datadir}/%{name}/slof.bin %{_datadir}/%{name}/spapr-rtas.bin %{_datadir}/%{name}/vgabios.bin @@ -1006,10 +1100,41 @@ fi %attr(755,root,root) %{_bindir}/qemu-sparc %attr(755,root,root) %{_bindir}/qemu-sparc32plus %attr(755,root,root) %{_bindir}/qemu-sparc64 -%attr(755,root,root) %{_bindir}/qemu-tilegx -%attr(755,root,root) %{_bindir}/qemu-unicore32 %attr(755,root,root) %{_bindir}/qemu-x86_64 +%if %{with user_static} +%files user-static +%defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/qemu-aarch64-static +%attr(755,root,root) %{_bindir}/qemu-alpha-static +%attr(755,root,root) %{_bindir}/qemu-arm-static +%attr(755,root,root) %{_bindir}/qemu-armeb-static +%attr(755,root,root) %{_bindir}/qemu-cris-static +%attr(755,root,root) %{_bindir}/qemu-i386-static +%attr(755,root,root) %{_bindir}/qemu-m68k-static +%attr(755,root,root) %{_bindir}/qemu-microblaze-static +%attr(755,root,root) %{_bindir}/qemu-microblazeel-static +%attr(755,root,root) %{_bindir}/qemu-mips-static +%attr(755,root,root) %{_bindir}/qemu-mips64-static +%attr(755,root,root) %{_bindir}/qemu-mips64el-static +%attr(755,root,root) %{_bindir}/qemu-mipsel-static +%attr(755,root,root) %{_bindir}/qemu-mipsn32-static +%attr(755,root,root) %{_bindir}/qemu-mipsn32el-static +%attr(755,root,root) %{_bindir}/qemu-or32-static +%attr(755,root,root) %{_bindir}/qemu-ppc-static +%attr(755,root,root) %{_bindir}/qemu-ppc64-static +%attr(755,root,root) %{_bindir}/qemu-ppc64abi32-static +%attr(755,root,root) %{_bindir}/qemu-ppc64le-static +%attr(755,root,root) %{_bindir}/qemu-s390x-static +%attr(755,root,root) %{_bindir}/qemu-sh4-static +%attr(755,root,root) %{_bindir}/qemu-sh4eb-static +%attr(755,root,root) %{_bindir}/qemu-sparc-static +%attr(755,root,root) %{_bindir}/qemu-sparc32plus-static +%attr(755,root,root) %{_bindir}/qemu-sparc64-static +%attr(755,root,root) %{_bindir}/qemu-tilegx-static +%attr(755,root,root) %{_bindir}/qemu-x86_64-static +%endif + %files system-aarch64 %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/qemu-system-aarch64 @@ -1088,10 +1213,9 @@ fi %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/qemu-system-i386 %attr(755,root,root) %{_bindir}/qemu-system-x86_64 -%ifarch %{ix86} %{x8664} +%ifarch %{ix86} %{x8664} x32 %config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/kvm.conf %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/80-kvm.rules -%attr(755,root,root) %{_bindir}/kvm_stat %endif %{_datadir}/%{name}/bios.bin %{_datadir}/%{name}/bios-256k.bin @@ -1120,7 +1244,7 @@ fi %files module-block-dmg %defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/%{name}/block-dmg.so +%attr(755,root,root) %{_libdir}/%{name}/block-dmg-bz2.so %if %{with glusterfs} %files module-block-gluster @@ -1134,6 +1258,12 @@ fi %attr(755,root,root) %{_libdir}/%{name}/block-iscsi.so %endif +%if %{with libnfs} +%files module-block-nfs +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/block-nfs.so +%endif + %if %{with ceph} %files module-block-rbd %defattr(644,root,root,755) diff --git a/x32.patch b/x32.patch new file mode 100644 index 0000000..beee3de --- /dev/null +++ b/x32.patch @@ -0,0 +1,41 @@ +--- qemu-2.2.0/configure~ 2015-03-26 19:52:14.000000000 +0100 ++++ qemu-2.2.0/configure 2015-03-26 19:56:34.255072716 +0100 +@@ -1904,7 +1904,7 @@ + + if test "$seccomp" != "no" ; then + case "$cpu" in +- i386|x86_64) ++ i386|x86_64|x32) + libseccomp_minver="2.1.0" + ;; + arm|aarch64) +@@ -2932,7 +2932,7 @@ + ########################################## + # TPM passthrough is only on x86 Linux + +-if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then ++if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64 -o "$cpu" = x32; then + tpm_passthrough=$tpm + else + tpm_passthrough=no +@@ -4161,7 +4161,7 @@ + + # Mac OS X ships with a broken assembler + roms= +-if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ ++if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "x32" \) -a \ + "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ + "$softmmu" = yes ; then + roms="optionrom" + +--- qemu-2.6.0/include/qemu/atomic.h~ 2016-07-17 18:37:57.000000000 +0200 ++++ qemu-2.6.0/include/qemu/atomic.h 2016-07-17 18:38:33.485893530 +0200 +@@ -20,7 +20,7 @@ + /* Compiler barrier */ + #define barrier() ({ asm volatile("" ::: "memory"); (void)0; }) + +-#ifdef __ATOMIC_RELAXED ++#if defined(__ATOMIC_RELAXED) && !defined(__ILP32__) + /* For C11 atomic ops */ + + /* Manual memory barriers -- 2.44.0