summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzer0def2019-12-14 21:58:25 +0100
committerzer0def2019-12-18 23:06:30 +0100
commitc497f93248042f738632af63987ea82be832b22e (patch)
treec00b5899016e492fb44eda89c0ca59cddd8d34f7
parentc788700353645ad0b344b582025e1a40e343ab4a (diff)
downloadaur-c497f93248042f738632af63987ea82be832b22e.tar.gz
Forked virtiofsd.
-rw-r--r--.SRCINFO125
-rw-r--r--.gitignore4
-rw-r--r--0001-add-time-to-seccomp.patch26
-rw-r--r--0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch50
-rw-r--r--65-kvm.rules2
-rw-r--r--PKGBUILD299
-rw-r--r--qemu-ga.service8
-rw-r--r--qemu.install8
8 files changed, 184 insertions, 338 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 327701c7ca0e..5212de3b503e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,121 +1,20 @@
-pkgbase = qemu-git
- pkgdesc = A generic and open source machine emulator and virtualizer. Git version.
- pkgver = v4.2.0.r0.gb0ca999a43
+pkgbase = virtiofsd
+ pkgdesc = QEMU VirtioFSd
+ pkgver = 0.3
pkgrel = 1
- epoch = 9
- url = http://wiki.qemu.org/
+ url = https://virtio-fs.gitlab.io/
arch = i686
arch = x86_64
license = GPL2
license = LGPL2.1
- makedepends = spice-protocol
- makedepends = python
- makedepends = ceph
- makedepends = libiscsi
- makedepends = glusterfs
- makedepends = git
- depends = dtc
- depends = virglrenderer
- depends = sdl2
- depends = vte3
- depends = libpulse
- depends = seabios
- depends = gnutls
- depends = libpng
- depends = libaio
- depends = numactl
- depends = jemalloc
- depends = xfsprogs
- depends = libnfs
- depends = lzo
- depends = snappy
- depends = curl
- depends = vde2
- depends = libcap-ng
- depends = spice
- depends = libcacard
- depends = usbredir
- source = git://git.qemu.org/qemu.git
- source = qemu-ga.service
- source = 65-kvm.rules
+ makedepends = pixman>=0.21.8
+ makedepends = python2
+ source = git+https://gitlab.com/virtio-fs/qemu.git#tag=virtio-fs-v0.3
+ source = 0001-add-time-to-seccomp.patch
+ source = 0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch
sha256sums = SKIP
- sha256sums = 0b4f3283973bb3bc876735f051d8eaab68f0065502a3a5012141fad193538ea1
- sha256sums = 60dcde5002c7c0b983952746e6fb2cf06d6c5b425d64f340f819356e561e7fc7
+ sha256sums = 7801e6e947c4203e797c7befd6b381c23b69e07bf8ae91f77d5b621c7c059f1b
+ sha256sums = bd5ca1495c998fac8988cdf0cab5677bf96d69ca19eea6252207a9a7c28afcdf
-pkgname = qemu-git
- optdepends = qemu-arch-extra-git: extra architectures support
- provides = qemu-headless
- provides = qemu
- provides = qemu-kvm
- provides = qemu-spice
- conflicts = qemu-headless
- conflicts = qemu
- conflicts = kvm
- conflicts = kvm-git
- conflicts = qemu-spice
- replaces = qemu-kvm
-
-pkgname = qemu-headless-git
- pkgdesc = QEMU without GUI. Git version.
- depends = seabios
- depends = gnutls
- depends = libpng
- depends = libaio
- depends = numactl
- depends = jemalloc
- depends = xfsprogs
- depends = libnfs
- depends = lzo
- depends = snappy
- depends = curl
- depends = vde2
- depends = libcap-ng
- depends = spice
- depends = libcacard
- depends = usbredir
- optdepends = qemu-headless-arch-extra-git: extra architectures support
- conflicts = qemu-headless
-
-pkgname = qemu-arch-extra-git
- pkgdesc = QEMU for foreign architectures. Git version.
- depends = qemu
- provides = qemu-arch-extra
- conflicts = qemu-arch-extra
- options = !strip
-
-pkgname = qemu-headless-arch-extra-git
- pkgdesc = QEMU without GUI, for foreign architectures. Git version.
- depends = qemu-headless
- provides = qemu-headless-arch-extra
- conflicts = qemu-headless-arch-extra
- options = !strip
-
-pkgname = qemu-block-iscsi-git
- pkgdesc = QEMU iSCSI block module. Git version.
- depends = glib2
- depends = libiscsi
- depends = jemalloc
- provides = qemu-block-iscsi
- conflicts = qemu-block-iscsi
-
-pkgname = qemu-block-rbd-git
- pkgdesc = QEMU RBD block module. Git version.
- depends = glib2
- depends = ceph
- provides = qemu-block-rbd
- conflicts = qemu-block-rbd
-
-pkgname = qemu-block-gluster-git
- pkgdesc = QEMU GlusterFS block module. Git version.
- depends = glib2
- depends = glusterfs
- provides = qemu-block-gluster
- conflicts = qemu-block-gluster
-
-pkgname = qemu-guest-agent-git
- pkgdesc = QEMU Guest Agent. Git version.
- depends = gcc-libs
- depends = glib2
- provides = qemu-guest-agent
- conflicts = qemu-guest-agent
+pkgname = virtiofsd
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..05c6d4d4c97b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
diff --git a/0001-add-time-to-seccomp.patch b/0001-add-time-to-seccomp.patch
new file mode 100644
index 000000000000..deadcb5b0924
--- /dev/null
+++ b/0001-add-time-to-seccomp.patch
@@ -0,0 +1,26 @@
+From 2317a63d2acab16be4655ec87542a2bf3d75551b Mon Sep 17 00:00:00 2001
+From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
+Date: Thu, 26 Sep 2019 18:41:34 +0100
+Subject: [PATCH] virtiofsd: Add time to seccomp
+
+Needed by static builds
+
+Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
+---
+ contrib/virtiofsd/seccomp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/contrib/virtiofsd/seccomp.c b/contrib/virtiofsd/seccomp.c
+index 3b92c6ee13..374bab2bef 100644
+--- a/contrib/virtiofsd/seccomp.c
++++ b/contrib/virtiofsd/seccomp.c
+@@ -75,6 +75,7 @@ static const int syscall_whitelist[] = {
+ SCMP_SYS(setresuid),
+ SCMP_SYS(set_robust_list),
+ SCMP_SYS(symlinkat),
++ SCMP_SYS(time), /* Rarely needed, except on static builds */
+ SCMP_SYS(tgkill),
+ SCMP_SYS(unlinkat),
+ SCMP_SYS(utimensat),
+--
+2.21.0
diff --git a/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch b/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch
new file mode 100644
index 000000000000..03f8f5c1b9eb
--- /dev/null
+++ b/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch
@@ -0,0 +1,50 @@
+From 47adda63e398a179b6211763377c8f61c5d62f5a Mon Sep 17 00:00:00 2001
+From: Sebastien Boeuf <sebastien.boeuf@intel.com>
+Date: Wed, 7 Aug 2019 07:15:32 -0700
+Subject: [PATCH] libvhost-user: Fix the VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD
+ check
+
+Vhost user protocol features are set as a bitmask. And the following
+constant VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD value is 10 because the bit
+10 indicates if the features is set or not.
+
+The proper way to check for the presence or absence of this feature is
+to shift 1 by the value of this constant and then mask it with the
+actual bitmask representing the supported protocol features.
+
+This patch aims to fix the current code as it was not doing the
+shifting, but instead it was masking directly with the value of the
+constant itself.
+
+Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
+---
+ contrib/libvhost-user/libvhost-user.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
+index 215ce22b79..626e2a035f 100644
+--- a/contrib/libvhost-user/libvhost-user.c
++++ b/contrib/libvhost-user/libvhost-user.c
+@@ -1129,7 +1129,8 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,
+
+ vmsg.fd_num = fd_num;
+
+- if ((dev->protocol_features & VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) == 0) {
++ if ((dev->protocol_features &
++ (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) == 0) {
+ return false;
+ }
+
+@@ -2554,7 +2555,8 @@ int64_t vu_fs_cache_request(VuDev *dev, VhostUserSlaveRequest req, int fd,
+
+ vmsg.fd_num = fd_num;
+
+- if ((dev->protocol_features & VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) == 0) {
++ if ((dev->protocol_features &
++ (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) == 0) {
+ return -EINVAL;
+ }
+
+--
+2.20.1
+
diff --git a/65-kvm.rules b/65-kvm.rules
deleted file mode 100644
index 569ded9f972f..000000000000
--- a/65-kvm.rules
+++ /dev/null
@@ -1,2 +0,0 @@
-KERNEL=="kvm", GROUP="kvm", MODE="0660"
-KERNEL=="vhost-net", GROUP="kvm", MODE="0660", TAG+="uaccess", OPTIONS+="static_node=vhost-net"
diff --git a/PKGBUILD b/PKGBUILD
index e72a168c8e80..840e66d6774d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,61 +4,37 @@
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Sébastien "Seblu" Luttringer <seblu@seblu.net>
-pkgbase=qemu-git
-_gitname=qemu
-pkgname=(qemu-git qemu-headless-git qemu-arch-extra-git qemu-headless-arch-extra-git qemu-block-{iscsi-git,rbd-git,gluster-git} qemu-guest-agent-git)
-pkgdesc="A generic and open source machine emulator and virtualizer. Git version."
-pkgver=v4.2.0.r0.gb0ca999a43
+pkgname=virtiofsd
+pkgdesc="QEMU VirtioFSd"
+pkgver=0.3
pkgrel=1
-epoch=9
arch=(i686 x86_64)
license=(GPL2 LGPL2.1)
-url="http://wiki.qemu.org/"
-_headlessdeps=(seabios gnutls libpng libaio numactl jemalloc xfsprogs libnfs lzo snappy curl vde2 libcap-ng spice libcacard usbredir)
-depends=(dtc virglrenderer sdl2 vte3 libpulse "${_headlessdeps[@]}")
-makedepends=(spice-protocol python ceph libiscsi glusterfs git)
-source=(git://git.qemu.org/qemu.git
- qemu-ga.service
- 65-kvm.rules)
-sha256sums=('SKIP'
- '0b4f3283973bb3bc876735f051d8eaab68f0065502a3a5012141fad193538ea1'
- '60dcde5002c7c0b983952746e6fb2cf06d6c5b425d64f340f819356e561e7fc7')
-
-case $CARCH in
- i?86) _corearch=i386 ;;
- x86_64) _corearch=x86_64 ;;
-esac
-
-pkgver() {
- cd "${srcdir}/${_gitname}"
- git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
-}
+url="https://virtio-fs.gitlab.io/"
+makedepends=('pixman>=0.21.8' 'python2')
+source=(
+ "git+https://gitlab.com/virtio-fs/qemu.git#tag=virtio-fs-v${pkgver}"
+ 0001-add-time-to-seccomp.patch
+ 0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch
+)
+sha256sums=(
+ 'SKIP'
+ '7801e6e947c4203e797c7befd6b381c23b69e07bf8ae91f77d5b621c7c059f1b'
+ 'bd5ca1495c998fac8988cdf0cab5677bf96d69ca19eea6252207a9a7c28afcdf'
+)
prepare() {
- cd "${srcdir}/${_gitname}"
- mkdir build-{full,headless}
- mkdir -p extra-arch-{full,headless}/usr/{bin,share/qemu}
+ cd "${srcdir}/qemu"
+ # https://github.com/kata-containers/packaging/tree/master/qemu/patches/virtiofsd needed for tag virtio-fs-v0.3
+ patch -p1 <${srcdir}/0001-add-time-to-seccomp.patch
+ patch -p1 <${srcdir}/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch
#cd "${srcdir}/${_gitname}"
sed -i 's/vte-2\.90/vte-2.91/g' configure
}
-build() {
- _build full \
- --audio-drv-list="pa alsa sdl"
-
- _build headless \
- --audio-drv-list= \
- --disable-bluez \
- --disable-sdl \
- --disable-gtk \
- --disable-vte \
- --disable-opengl \
- --disable-virglrenderer
-}
-
-_build() (
- cd ${srcdir}/${_gitname}/build-$1
+build() (
+ cd ${srcdir}/qemu
# qemu vs. make 4 == bad
export ARFLAGS=rv
@@ -66,172 +42,81 @@ _build() (
# http://permalink.gmane.org/gmane.comp.emulators.qemu/238740
export CFLAGS+=" -fPIC"
- ../configure \
+ ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib/qemu \
- --python=/usr/bin/python2 \
- --smbd=/usr/bin/smbd \
- --enable-modules \
- --enable-sdl \
- --enable-jemalloc \
- --disable-werror \
- "${@:2}"
-
- make
+ --disable-avx2 \
+ --disable-bluez \
+ --disable-brlapi \
+ --disable-docs \
+ --disable-curses \
+ --disable-gtk \
+ --disable-opengl \
+ --disable-sdl \
+ --disable-spice \
+ --disable-vte \
+ --disable-vnc \
+ --disable-vnc-jpeg \
+ --disable-vnc-png \
+ --disable-vnc-sasl \
+ --disable-auth-pam \
+ --disable-fdt \
+ --disable-glusterfs \
+ --disable-libiscsi \
+ --disable-libnfs \
+ --disable-libssh \
+ --disable-bzip2 \
+ --disable-lzo \
+ --disable-snappy \
+ --disable-tpm \
+ --disable-slirp \
+ --disable-libusb \
+ --disable-usb-redir \
+ --disable-tcg \
+ --disable-debug-tcg \
+ --disable-tcg-interpreter \
+ --disable-qom-cast-debug \
+ --disable-tcmalloc \
+ --disable-curl \
+ --disable-rdma \
+ --disable-tools \
+ --disable-xen \
+ --disable-linux-aio \
+ --disable-libpmem \
+ --disable-virglrenderer \
+ --disable-replication \
+ --disable-smartcard \
+ --disable-guest-agent \
+ --disable-guest-agent-msi \
+ --disable-vvfat \
+ --disable-vdi \
+ --disable-qed \
+ --disable-qcow1 \
+ --disable-bochs \
+ --disable-cloop \
+ --disable-dmg \
+ --disable-parallels \
+ --disable-vxhs \
+ --disable-capstone \
+ --enable-kvm \
+ --enable-vhost-net \
+ --enable-virtfs \
+ --enable-attr \
+ --enable-cap-ng \
+ --enable-malloc-trim \
+ --target-list=x86_64-softmmu \
+ --extra-cflags=" -O3 -falign-functions=32 -D_FORTIFY_SOURCE=2 -fPIE" \
+ --extra-ldflags=" -pie -z noexecstack -z relro -z now" \
+ --with-pkgversion=virtiofs-v0.3 \
+ --python=/usr/bin/python2
+
+ # vhost-user debugging in virtiofs
+ #sed -i 's%#define LIBVHOST_USER_DEBUG 0%#define LIBVHOST_USER_DEBUG 1%' contrib/libvhost-user/libvhost-user.c
+ make virtiofsd
)
-package_qemu-git() {
- optdepends=('qemu-arch-extra-git: extra architectures support')
- conflicts=('qemu-headless' 'qemu' 'kvm' 'kvm-git' 'qemu-spice')
- provides=('qemu-headless' 'qemu' 'qemu-kvm' 'qemu-spice')
- replaces=(qemu-kvm)
-
- _package full
-}
-
-package_qemu-headless-git() {
- pkgdesc="QEMU without GUI. Git version."
- depends=("${_headlessdeps[@]}")
- optdepends=('qemu-headless-arch-extra-git: extra architectures support')
- conflicts=('qemu-headless')
-
- _package headless
-}
-
-_package() {
- optdepends+=('ovmf: Tianocore UEFI firmware for qemu'
- 'samba: SMB/CIFS server support'
- 'qemu-block-iscsi-git: iSCSI block support'
- 'qemu-block-rbd-git: RBD block support'
- 'qemu-block-gluster-git: glusterfs block support')
- install=qemu.install
- options=(!strip)
-
- make -C ${srcdir}/${_gitname}/build-$1 DESTDIR="$pkgdir" install "${@:2}"
-
- # systemd stuff
- install -Dm644 65-kvm.rules "$pkgdir/usr/lib/udev/rules.d/65-kvm.rules"
-
- # remove conflicting /var/run directory
- cd "$pkgdir"
- rm -r var
-
- cd usr/lib
- tidy_strip
-
- # bridge_helper needs suid
- # https://bugs.archlinux.org/task/32565
- chmod u+s qemu/qemu-bridge-helper
-
- # remove split block modules
- rm qemu/block-{iscsi,rbd,gluster}.so
-
- cd ../bin
- tidy_strip
-
- # remove extra arch
- for _bin in qemu-*; do
- [[ -f $_bin ]] || continue
-
- case ${_bin#qemu-} in
- # guest agent
- ga) rm "$_bin"; continue ;;
-
- # tools
- img|io|nbd) continue ;;
-
- # core emu
- system-${_corearch}) continue ;;
- esac
-
- mv "$_bin" "$srcdir/$_gitname/extra-arch-$1/usr/bin"
- done
-
- cd ../share/qemu
- for _blob in *; do
- [[ -f $_blob ]] || continue
-
- case $_blob in
- # provided by seabios package
- bios.bin|acpi-dsdt.aml|bios-256k.bin|vgabios-cirrus.bin|vgabios-qxl.bin|\
- vgabios-stdvga.bin|vgabios-bochs-display.bin|vgabios-ramfb.bin|vgabios-vmware.bin|vgabios-virtio.bin) rm "$_blob"; continue ;;
-
-
- # iPXE ROMs
- efi-*|pxe-*) continue ;;
-
- # core blobs
- kvmvapic.bin|linuxboot*|multiboot.bin|sgabios.bin|vgabios*) continue ;;
-
- # Trace events definitions
- trace-events*) continue ;;
-
- # Logos
- *.bmp|*.svg) continue ;;
- esac
-
- mv "$_blob" "$srcdir/$_gitname/extra-arch-$1/usr/share/qemu"
- done
+package() {
+ install -Dm755 {${srcdir}/qemu,${pkgdir}/usr/bin}/virtiofsd
}
-
-package_qemu-arch-extra-git() {
- pkgdesc="QEMU for foreign architectures. Git version."
- depends=(qemu)
- provides=(qemu-arch-extra)
- conflicts=(qemu-arch-extra)
- options=(!strip)
-
- mv $srcdir/$_gitname/extra-arch-full/usr "$pkgdir"
-}
-
-package_qemu-headless-arch-extra-git() {
- pkgdesc="QEMU without GUI, for foreign architectures. Git version."
- depends=(qemu-headless)
- options=(!strip)
- conflicts=(qemu-headless-arch-extra)
- provides=(qemu-headless-arch-extra)
-
- mv $srcdir/$_gitname/extra-arch-headless/usr "$pkgdir"
-}
-
-package_qemu-block-iscsi-git() {
- pkgdesc="QEMU iSCSI block module. Git version."
- depends=(glib2 libiscsi jemalloc)
- conflicts=(qemu-block-iscsi)
- provides=(qemu-block-iscsi)
-
- install -D $srcdir/$_gitname/build-full/block-iscsi.so "$pkgdir/usr/lib/qemu/block-iscsi.so"
-}
-
-package_qemu-block-rbd-git() {
- pkgdesc="QEMU RBD block module. Git version."
- depends=(glib2 ceph)
- conflicts=(qemu-block-rbd)
- provides=(qemu-block-rbd)
-
- install -D $srcdir/$_gitname/build-full/block-rbd.so "$pkgdir/usr/lib/qemu/block-rbd.so"
-}
-
-package_qemu-block-gluster-git() {
- pkgdesc="QEMU GlusterFS block module. Git version."
- depends=(glib2 glusterfs)
- conflicts=(qemu-block-gluster)
- provides=(qemu-block-gluster)
-
- install -D $srcdir/$_gitname/build-full/block-gluster.so "$pkgdir/usr/lib/qemu/block-gluster.so"
-}
-
-package_qemu-guest-agent-git() {
- pkgdesc="QEMU Guest Agent. Git version."
- depends=(gcc-libs glib2)
- conflicts=(qemu-guest-agent)
- provides=(qemu-guest-agent)
-
- install -D $srcdir/$_gitname/build-full/qemu-ga "$pkgdir/usr/bin/qemu-ga"
- install -Dm644 $srcdir/qemu-ga.service "$pkgdir/usr/lib/systemd/system/qemu-ga.service"
- install -Dm755 "$srcdir/$_gitname/scripts/qemu-guest-agent/fsfreeze-hook" "$pkgdir/etc/qemu/fsfreeze-hook"
-}
-
-# vim:set ts=2 sw=2 et:
diff --git a/qemu-ga.service b/qemu-ga.service
deleted file mode 100644
index e5eb469f9d49..000000000000
--- a/qemu-ga.service
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=QEMU Guest Agent
-
-[Service]
-ExecStart=/usr/bin/qemu-ga
-
-[Install]
-WantedBy=multi-user.target
diff --git a/qemu.install b/qemu.install
deleted file mode 100644
index 9fe850d4ed7e..000000000000
--- a/qemu.install
+++ /dev/null
@@ -1,8 +0,0 @@
-# Arg 1: the new package version
-post_install() {
- # trigger events on modules files when already loaded
- for _f in /sys/devices/virtual/misc/{kvm,vhost-net}; do
- [[ -e "$_f" ]] && udevadm trigger "$_f"
- done
- :
-}