summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2019-08-24 08:19:05 +0200
committerVladimír Čunát <v@cunat.cz>2019-08-24 08:55:37 +0200
commit2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1 (patch)
tree36de0660dc2c9f3731bd8b60ec852ca0c452efce /pkgs/applications/virtualization
parent84a91208a948be5eca97ea182c4256d9d6ecf171 (diff)
parent8943fb5f24b9e1aa1d577be4e214d166643269fd (diff)
downloadnixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar.gz
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar.bz2
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar.lz
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar.xz
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.tar.zst
nixpkgs-2e6bf42a2207d5ecfe6e67de2def6e004a0eb1f1.zip
Merge branch 'master' into staging-next
There ver very many conflicts, basically all due to
name -> pname+version.  Fortunately, almost everything was auto-resolved
by kdiff3, and for now I just fixed up a couple evaluation problems,
as verified by the tarball job.  There might be some fallback to these
conflicts, but I believe it should be minimal.

Hydra nixpkgs: ?compare=1538299
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/OVMF/default.nix64
-rw-r--r--pkgs/applications/virtualization/looking-glass-client/default.nix21
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix2
-rw-r--r--pkgs/applications/virtualization/virt-viewer/default.nix5
-rw-r--r--pkgs/applications/virtualization/xen/4.8.nix19
-rw-r--r--pkgs/applications/virtualization/xen/generic.nix4
-rw-r--r--pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diff95
7 files changed, 134 insertions, 76 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix
index c858f4c4d6d..ecf6f1c5421 100644
--- a/pkgs/applications/virtualization/OVMF/default.nix
+++ b/pkgs/applications/virtualization/OVMF/default.nix
@@ -1,4 +1,9 @@
-{ stdenv, lib, edk2, nasm, iasl, seabios, openssl, secureBoot ? false }:
+{ stdenv, lib, edk2, utillinux, nasm, iasl
+, csmSupport ? false, seabios ? null
+, secureBoot ? false
+}:
+
+assert csmSupport -> seabios != null;
 
 let
 
@@ -12,60 +17,25 @@ let
     throw "Unsupported architecture";
 
   version = (builtins.parseDrvName edk2.name).version;
-
-  src = edk2.src;
 in
 
-stdenv.mkDerivation (edk2.setup projectDscPath {
+edk2.mkDerivation projectDscPath {
   name = "OVMF-${version}";
 
-  inherit src;
-
   outputs = [ "out" "fd" ];
 
-  # TODO: properly include openssl for secureBoot
-  buildInputs = [nasm iasl] ++ stdenv.lib.optionals (secureBoot == true) [ openssl ];
-
-  hardeningDisable = [ "stackprotector" "pic" "fortify" ];
+  buildInputs = [ utillinux nasm iasl ];
 
-  unpackPhase = ''
-    # $fd is overwritten during the build
-    export OUTPUT_FD=$fd
+  hardeningDisable = [ "format" "stackprotector" "pic" "fortify" ];
 
-    for file in \
-      "${src}"/{UefiCpuPkg,MdeModulePkg,IntelFrameworkModulePkg,PcAtChipsetPkg,FatBinPkg,EdkShellBinPkg,MdePkg,ShellPkg,OptionRomPkg,IntelFrameworkPkg,FatPkg,CryptoPkg,SourceLevelDebugPkg};
-    do
-      ln -sv "$file" .
-    done
+  buildFlags =
+    lib.optional secureBoot "-DSECURE_BOOT_ENABLE=TRUE"
+    ++ lib.optionals csmSupport [ "-D CSM_ENABLE" "-D FD_SIZE_2MB" ];
 
-    ${if stdenv.isAarch64 then ''
-      ln -sv ${src}/ArmPkg .
-      ln -sv ${src}/ArmPlatformPkg .
-      ln -sv ${src}/ArmVirtPkg .
-      ln -sv ${src}/EmbeddedPkg .
-      ln -sv ${src}/OvmfPkg .
-    '' else if seabios != null then ''
-        cp -r ${src}/OvmfPkg .
-        chmod +w OvmfPkg/Csm/Csm16
-        cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin
-    '' else ''
-        ln -sv ${src}/OvmfPkg .
-    ''}
-
-    ${lib.optionalString secureBoot ''
-      ln -sv ${src}/SecurityPkg .
-      ln -sv ${src}/CryptoPkg .
-    ''}
+  postPatch = lib.optionalString csmSupport ''
+    cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin
   '';
 
-  buildPhase = if stdenv.isAarch64 then ''
-      build -n $NIX_BUILD_CORES
-    '' else if seabios == null then ''
-      build -n $NIX_BUILD_CORES ${lib.optionalString secureBoot "-DSECURE_BOOT_ENABLE=TRUE"}
-    '' else ''
-      build -n $NIX_BUILD_CORES -D CSM_ENABLE -D FD_SIZE_2MB ${lib.optionalString secureBoot "-DSECURE_BOOT_ENABLE=TRUE"}
-    '';
-
   postFixup = if stdenv.isAarch64 then ''
     mkdir -vp $fd/FV
     mkdir -vp $fd/AAVMF
@@ -77,8 +47,8 @@ stdenv.mkDerivation (edk2.setup projectDscPath {
     dd of=$fd/AAVMF/QEMU_EFI-pflash.raw       if=$fd/FV/QEMU_EFI.fd conv=notrunc
     dd of=$fd/AAVMF/vars-template-pflash.raw if=/dev/zero bs=1M    count=64
   '' else ''
-    mkdir -vp $OUTPUT_FD/FV
-    mv -v $out/FV/OVMF{,_CODE,_VARS}.fd $OUTPUT_FD/FV
+    mkdir -vp $fd/FV
+    mv -v $out/FV/OVMF{,_CODE,_VARS}.fd $fd/FV
   '';
 
   dontPatchELF = true;
@@ -89,4 +59,4 @@ stdenv.mkDerivation (edk2.setup projectDscPath {
     license = stdenv.lib.licenses.bsd2;
     platforms = ["x86_64-linux" "i686-linux" "aarch64-linux"];
   };
-})
+}
diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix
index 9420a40805d..0f53a5c4f14 100644
--- a/pkgs/applications/virtualization/looking-glass-client/default.nix
+++ b/pkgs/applications/virtualization/looking-glass-client/default.nix
@@ -1,33 +1,26 @@
 { stdenv, fetchFromGitHub, fetchpatch
 , cmake, pkgconfig, SDL2, SDL, SDL2_ttf, openssl, spice-protocol, fontconfig
-, libX11, freefont_ttf, nettle, libconfig
+, libX11, freefont_ttf, nettle, libconfig, wayland, libpthreadstubs, libXdmcp
+, libXfixes, libbfd
 }:
 
 stdenv.mkDerivation rec {
   pname = "looking-glass-client";
-  version = "a12";
+  version = "B1";
 
   src = fetchFromGitHub {
     owner = "gnif";
     repo = "LookingGlass";
     rev = version;
-    sha256 = "0r6bvl9q94039r6ff4f2bg8si95axx9w8bf1h1qr5730d2kv5yxq";
+    sha256 = "0vykv7yjz4fima9d82m83acd8ab72nq4wyzyfs1c499i27wz91ia";
   };
 
   nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [
     SDL SDL2 SDL2_ttf openssl spice-protocol fontconfig
-    libX11 freefont_ttf nettle libconfig cmake
-  ];
-
-  patches = [
-    # Fix obsolete spice header usage. Remove with the next release. See https://github.com/gnif/LookingGlass/pull/126
-    (fetchpatch {
-      url = "https://github.com/gnif/LookingGlass/commit/2567447b24b28458ba0f09c766a643ad8d753255.patch";
-      sha256 = "04j2h75rpxd71szry15f31r6s0kgk96i8q9khdv9q3i2fvkf242n";
-      stripLen = 1;
-    })
+    libX11 freefont_ttf nettle libconfig wayland libpthreadstubs
+    libXdmcp libXfixes libbfd cmake
   ];
 
   enableParallelBuilding = true;
@@ -50,7 +43,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://looking-glass.hostfission.com/;
     license = licenses.gpl2Plus;
-    maintainers = [ maintainers.pneumaticat ];
+    maintainers = [ maintainers.alexbakker ];
     platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index b6a6ebde540..42860966fe1 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -77,6 +77,6 @@ python3Packages.buildPythonApplication rec {
     license = licenses.gpl2;
     # exclude Darwin since libvirt-glib currently doesn't build there
     platforms = platforms.linux;
-    maintainers = with maintainers; [ qknight offline fpletz ];
+    maintainers = with maintainers; [ qknight offline fpletz globin ];
   };
 }
diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix
index 9c307d8e9ba..eb5d53c2b89 100644
--- a/pkgs/applications/virtualization/virt-viewer/default.nix
+++ b/pkgs/applications/virtualization/virt-viewer/default.nix
@@ -1,9 +1,10 @@
 { stdenv, fetchurl, pkgconfig, intltool, glib, libxml2, gtk3, gtk-vnc, gmp
-, libgcrypt, gnupg, cyrus_sasl, shared-mime-info, libvirt, yajl, xen
+, libgcrypt, gnupg, cyrus_sasl, shared-mime-info, libvirt, yajl
 , gsettings-desktop-schemas, wrapGAppsHook, libvirt-glib, libcap_ng, numactl
 , libapparmor, gst_all_1
 , spiceSupport ? true
 , spice-gtk ? null, spice-protocol ? null, libcap ? null, gdbm ? null
+, xenSupport ? false, xen ? null
 }:
 
 assert spiceSupport ->
@@ -26,7 +27,7 @@ stdenv.mkDerivation rec {
     glib libxml2 gtk3 gtk-vnc gmp libgcrypt gnupg cyrus_sasl shared-mime-info
     libvirt yajl gsettings-desktop-schemas libvirt-glib
     libcap_ng numactl libapparmor
-  ] ++ optionals stdenv.isx86_64 [
+  ] ++ optionals xenSupport [
     xen
   ] ++ optionals spiceSupport [
     spice-gtk spice-protocol libcap gdbm
diff --git a/pkgs/applications/virtualization/xen/4.8.nix b/pkgs/applications/virtualization/xen/4.8.nix
index 2a59cd1f061..8ad8edde8cc 100644
--- a/pkgs/applications/virtualization/xen/4.8.nix
+++ b/pkgs/applications/virtualization/xen/4.8.nix
@@ -43,6 +43,11 @@ let
     sha256 = "0gaz93kb33qc0jx6iphvny0yrd17i8zhcl3a9ky5ylc2idz0wiwa";
   };
 
+  # Ported from
+  #"https://xenbits.xen.org/gitweb/?p=qemu-xen.git;a=patch;h=e014dbe74e0484188164c61ff6843f8a04a8cb9d";
+  #"https://xenbits.xen.org/gitweb/?p=qemu-xen.git;a=patch;h=0e3b891fefacc0e49f3c8ffa3a753b69eb7214d2";
+  qemuGlusterfs6Fix = ./qemu-gluster-6-compat.diff;
+
   qemuDeps = [
     udev pciutils xorg.libX11 SDL pixman acl glusterfs spice-protocol usbredir
     alsaLib
@@ -50,11 +55,11 @@ let
 in
 
 callPackage (import ./generic.nix (rec {
-  version = "4.8.3";
+  version = "4.8.5";
 
   src = fetchurl {
     url = "https://downloads.xenproject.org/release/xen/${version}/xen-${version}.tar.gz";
-    sha256 = "0vhkpyy5x7kc36hnav95fn194ngsmc3m2xcc78vccs00gdf6m8q9";
+    sha256 = "04xcf01jad1lpqnmjblzhnjzp0bss9fjd9awgcycjx679arbaxqz";
   };
 
   # Sources needed to build tools and firmwares.
@@ -67,6 +72,7 @@ callPackage (import ./generic.nix (rec {
       };
       patches = [
         qemuMemfdBuildFix
+        qemuGlusterfs6Fix
       ];
       buildInputs = qemuDeps;
       meta.description = "Xen's fork of upstream Qemu";
@@ -155,13 +161,8 @@ callPackage (import ./generic.nix (rec {
     ++ optional (withInternalOVMF) "--enable-ovmf";
 
   patches = with xsa; flatten [
-    # XSA_231 to XSA-251 are fixed in 4.8.3 (verified with git log)
-    XSA_252_49
     # 253: 4.8 not affected
     # 254: no patch supplied by xen project (Meltdown/Spectre)
-    XSA_255_49_1
-    XSA_255_49_2
-    XSA_256_48
     xenlockprofpatch
     xenpmdpatch
   ];
@@ -176,10 +177,8 @@ callPackage (import ./generic.nix (rec {
       -i tools/libxl/libxl_device.c
   '';
 
-  passthru = {
-    qemu-system-i386 = if withInternalQemu
+  passthru.qemu-system-i386 = if withInternalQemu
       then "lib/xen/bin/qemu-system-i386"
       else throw "this xen has no qemu builtin";
-  };
 
 })) ({ ocamlPackages = ocaml-ng.ocamlPackages_4_05; } // args)
diff --git a/pkgs/applications/virtualization/xen/generic.nix b/pkgs/applications/virtualization/xen/generic.nix
index 8dc2dffc6b6..8093d4752a0 100644
--- a/pkgs/applications/virtualization/xen/generic.nix
+++ b/pkgs/applications/virtualization/xen/generic.nix
@@ -121,8 +121,8 @@ stdenv.mkDerivation (rec {
 
   patches = [ ./0000-fix-ipxe-src.patch
               ./0000-fix-install-python.patch
-              ./acpica-utils-20180427.patch]
-         ++ (config.patches or []);
+            ] ++ optional (versionOlder version "4.8.5") ./acpica-utils-20180427.patch
+            ++ (config.patches or []);
 
   postPatch = ''
     ### Hacks
diff --git a/pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diff b/pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diff
new file mode 100644
index 00000000000..7ec6ad3aba6
--- /dev/null
+++ b/pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diff
@@ -0,0 +1,95 @@
+diff --git a/block/gluster.c b/block/gluster.c
+index 01b479fbb9..29552e1186 100644
+--- a/block/gluster.c
++++ b/block/gluster.c
+@@ -15,6 +15,10 @@
+ #include "qemu/uri.h"
+ #include "qemu/error-report.h"
+ 
++#ifdef CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT
++# define glfs_ftruncate(fd, offset) glfs_ftruncate(fd, offset, NULL, NULL)
++#endif
++
+ #define GLUSTER_OPT_FILENAME        "filename"
+ #define GLUSTER_OPT_VOLUME          "volume"
+ #define GLUSTER_OPT_PATH            "path"
+@@ -613,7 +617,11 @@ static void qemu_gluster_complete_aio(void *opaque)
+ /*
+  * AIO callback routine called from GlusterFS thread.
+  */
+-static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
++static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret,
++#ifdef CONFIG_GLUSTERFS_IOCB_HAS_STAT
++                                 struct glfs_stat *pre, struct glfs_stat *post,
++#endif
++                                 void *arg)
+ {
+     GlusterAIOCB *acb = (GlusterAIOCB *)arg;
+ 
+diff --git a/configure b/configure
+index 4b808f9d17..89fb27fd0d 100755
+--- a/configure
++++ b/configure
+@@ -301,6 +301,8 @@ glusterfs=""
+ glusterfs_xlator_opt="no"
+ glusterfs_discard="no"
+ glusterfs_zerofill="no"
++glusterfs_ftruncate_has_stat="no"
++glusterfs_iocb_has_stat="no"
+ archipelago="no"
+ gtk=""
+ gtkabi=""
+@@ -3444,6 +3446,38 @@ if test "$glusterfs" != "no" ; then
+     if $pkg_config --atleast-version=6 glusterfs-api; then
+       glusterfs_zerofill="yes"
+     fi
++    cat > $TMPC << EOF
++#include <glusterfs/api/glfs.h>
++
++int
++main(void)
++{
++	/* new glfs_ftruncate() passes two additional args */
++	return glfs_ftruncate(NULL, 0, NULL, NULL);
++}
++EOF
++    if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
++      glusterfs_ftruncate_has_stat="yes"
++    fi
++    cat > $TMPC << EOF
++#include <glusterfs/api/glfs.h>
++
++/* new glfs_io_cbk() passes two additional glfs_stat structs */
++static void
++glusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data)
++{}
++
++int
++main(void)
++{
++	glfs_io_cbk iocb = &glusterfs_iocb;
++	iocb(NULL, 0 , NULL, NULL, NULL);
++	return 0;
++}
++EOF
++    if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
++      glusterfs_iocb_has_stat="yes"
++    fi
+   else
+     if test "$glusterfs" = "yes" ; then
+       feature_not_found "GlusterFS backend support" \
+@@ -5415,6 +5449,14 @@ if test "$archipelago" = "yes" ; then
+   echo "ARCHIPELAGO_LIBS=$archipelago_libs" >> $config_host_mak
+ fi
+ 
++if test "$glusterfs_ftruncate_has_stat" = "yes" ; then
++  echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak
++fi
++
++if test "$glusterfs_iocb_has_stat" = "yes" ; then
++  echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak
++fi
++
+ if test "$libssh2" = "yes" ; then
+   echo "CONFIG_LIBSSH2=m" >> $config_host_mak
+   echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak