git.iko.soy/typeable/nixpkgs
on master help sign in
xen: 4.8.3 -> 4.8.5, unbreak (#67119)

* xen: 4.8.3 -> 4.8.5, unbreak It was broken during GlusterFs upgrade: https://github.com/NixOS/nixpkgs/pull/66736

commitd9617978fb78de81f3a2952a344b19be8388add4 authorFlorian Klink <flokli@flokli.de> dateWed 21 Aug 2019, 23:29 (7 years ago) parent88f57d48fe244e
3 files changed+106−12
pkgs/applications/virtualization/xen/4.8.nix+9−10 pkgs/applications/virtualization/xen/generic.nix+2−2 pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diff+95
pkgs/applications/virtualization/xen/4.8.nix+9−10
@@ -43,6 +43,11 @@ let
4343 sha256 = "0gaz93kb33qc0jx6iphvny0yrd17i8zhcl3a9ky5ylc2idz0wiwa";
4444 };
4545
46+ # Ported from
47+ #"https://xenbits.xen.org/gitweb/?p=qemu-xen.git;a=patch;h=e014dbe74e0484188164c61ff6843f8a04a8cb9d";
48+ #"https://xenbits.xen.org/gitweb/?p=qemu-xen.git;a=patch;h=0e3b891fefacc0e49f3c8ffa3a753b69eb7214d2";
49+ qemuGlusterfs6Fix = ./qemu-gluster-6-compat.diff;
50+
4651 qemuDeps = [
4752 udev pciutils xorg.libX11 SDL pixman acl glusterfs spice-protocol usbredir
4853 alsaLib
@@ -50,11 +55,11 @@ let
5055in
5156
5257callPackage (import ./generic.nix (rec {
53− version = "4.8.3";
58+ version = "4.8.5";
5459
5560 src = fetchurl {
5661 url = "https://downloads.xenproject.org/release/xen/${version}/xen-${version}.tar.gz";
57− sha256 = "0vhkpyy5x7kc36hnav95fn194ngsmc3m2xcc78vccs00gdf6m8q9";
62+ sha256 = "04xcf01jad1lpqnmjblzhnjzp0bss9fjd9awgcycjx679arbaxqz";
5863 };
5964
6065 # Sources needed to build tools and firmwares.
@@ -67,6 +72,7 @@ callPackage (import ./generic.nix (rec {
6772 };
6873 patches = [
6974 qemuMemfdBuildFix
75+ qemuGlusterfs6Fix
7076 ];
7177 buildInputs = qemuDeps;
7278 meta.description = "Xen's fork of upstream Qemu";
@@ -155,13 +161,8 @@ callPackage (import ./generic.nix (rec {
155161 ++ optional (withInternalOVMF) "--enable-ovmf";
156162
157163 patches = with xsa; flatten [
158− # XSA_231 to XSA-251 are fixed in 4.8.3 (verified with git log)
159− XSA_252_49
160164 # 253: 4.8 not affected
161165 # 254: no patch supplied by xen project (Meltdown/Spectre)
162− XSA_255_49_1
163− XSA_255_49_2
164− XSA_256_48
165166 xenlockprofpatch
166167 xenpmdpatch
167168 ];
@@ -176,10 +177,8 @@ callPackage (import ./generic.nix (rec {
176177 -i tools/libxl/libxl_device.c
177178 '';
178179
179− passthru = {
180− qemu-system-i386 = if withInternalQemu
180+ passthru.qemu-system-i386 = if withInternalQemu
181181 then "lib/xen/bin/qemu-system-i386"
182182 else throw "this xen has no qemu builtin";
183− };
184183
185184})) ({ ocamlPackages = ocaml-ng.ocamlPackages_4_05; } // args)
pkgs/applications/virtualization/xen/generic.nix+2−2
@@ -121,8 +121,8 @@ stdenv.mkDerivation (rec {
121121
122122 patches = [ ./0000-fix-ipxe-src.patch
123123 ./0000-fix-install-python.patch
124− ./acpica-utils-20180427.patch]
125− ++ (config.patches or []);
124+ ] ++ optional (versionOlder version "4.8.5") ./acpica-utils-20180427.patch
125+ ++ (config.patches or []);
126126
127127 postPatch = ''
128128 ### Hacks
pkgs/applications/virtualization/xen/qemu-gluster-6-compat.diffnew file+95
@@ -0,0 +1,95 @@
1+diff --git a/block/gluster.c b/block/gluster.c
2+index 01b479fbb9..29552e1186 100644
3+--- a/block/gluster.c
4++++ b/block/gluster.c
5+@@ -15,6 +15,10 @@
6+ #include "qemu/uri.h"
7+ #include "qemu/error-report.h"
8+
9++#ifdef CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT
10++# define glfs_ftruncate(fd, offset) glfs_ftruncate(fd, offset, NULL, NULL)
11++#endif
12++
13+ #define GLUSTER_OPT_FILENAME "filename"
14+ #define GLUSTER_OPT_VOLUME "volume"
15+ #define GLUSTER_OPT_PATH "path"
16+@@ -613,7 +617,11 @@ static void qemu_gluster_complete_aio(void *opaque)
17+ /*
18+ * AIO callback routine called from GlusterFS thread.
19+ */
20+-static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
21++static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret,
22++#ifdef CONFIG_GLUSTERFS_IOCB_HAS_STAT
23++ struct glfs_stat *pre, struct glfs_stat *post,
24++#endif
25++ void *arg)
26+ {
27+ GlusterAIOCB *acb = (GlusterAIOCB *)arg;
28+
29+diff --git a/configure b/configure
30+index 4b808f9d17..89fb27fd0d 100755
31+--- a/configure
32++++ b/configure
33+@@ -301,6 +301,8 @@ glusterfs=""
34+ glusterfs_xlator_opt="no"
35+ glusterfs_discard="no"
36+ glusterfs_zerofill="no"
37++glusterfs_ftruncate_has_stat="no"
38++glusterfs_iocb_has_stat="no"
39+ archipelago="no"
40+ gtk=""
41+ gtkabi=""
42+@@ -3444,6 +3446,38 @@ if test "$glusterfs" != "no" ; then
43+ if $pkg_config --atleast-version=6 glusterfs-api; then
44+ glusterfs_zerofill="yes"
45+ fi
46++ cat > $TMPC << EOF
47++#include <glusterfs/api/glfs.h>
48++
49++int
50++main(void)
51++{
52++ /* new glfs_ftruncate() passes two additional args */
53++ return glfs_ftruncate(NULL, 0, NULL, NULL);
54++}
55++EOF
56++ if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
57++ glusterfs_ftruncate_has_stat="yes"
58++ fi
59++ cat > $TMPC << EOF
60++#include <glusterfs/api/glfs.h>
61++
62++/* new glfs_io_cbk() passes two additional glfs_stat structs */
63++static void
64++glusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data)
65++{}
66++
67++int
68++main(void)
69++{
70++ glfs_io_cbk iocb = &glusterfs_iocb;
71++ iocb(NULL, 0 , NULL, NULL, NULL);
72++ return 0;
73++}
74++EOF
75++ if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
76++ glusterfs_iocb_has_stat="yes"
77++ fi
78+ else
79+ if test "$glusterfs" = "yes" ; then
80+ feature_not_found "GlusterFS backend support" \
81+@@ -5415,6 +5449,14 @@ if test "$archipelago" = "yes" ; then
82+ echo "ARCHIPELAGO_LIBS=$archipelago_libs" >> $config_host_mak
83+ fi
84+
85++if test "$glusterfs_ftruncate_has_stat" = "yes" ; then
86++ echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak
87++fi
88++
89++if test "$glusterfs_iocb_has_stat" = "yes" ; then
90++ echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak
91++fi
92++
93+ if test "$libssh2" = "yes" ; then
94+ echo "CONFIG_LIBSSH2=m" >> $config_host_mak
95+ echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak