Blame 0036-virtiofsd-Add-Makefile-wiring-for-virtiofsd-contrib.patch

1d442b
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
1d442b
Date: Mon, 27 Jan 2020 19:01:05 +0000
1d442b
Subject: [PATCH] virtiofsd: Add Makefile wiring for virtiofsd contrib
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
Wire up the building of the virtiofsd in tools.
1d442b
1d442b
virtiofsd relies on Linux-specific system calls and seccomp.  Anyone
1d442b
wishing to port it to other host operating systems should do so
1d442b
carefully and without reducing security.
1d442b
1d442b
Only allow building on Linux hosts.
1d442b
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit 81bfc42dcf473bc8d3790622633410da72d8e622)
1d442b
---
1d442b
 Makefile                      | 10 ++++++++++
1d442b
 Makefile.objs                 |  1 +
1d442b
 tools/virtiofsd/Makefile.objs |  9 +++++++++
1d442b
 3 files changed, 20 insertions(+)
1d442b
 create mode 100644 tools/virtiofsd/Makefile.objs
1d442b
1d442b
diff --git a/Makefile b/Makefile
1d442b
index b437a346d7..10fd31e705 100644
1d442b
--- a/Makefile
1d442b
+++ b/Makefile
1d442b
@@ -330,6 +330,10 @@ endif
1d442b
 endif
1d442b
 endif
1d442b
 
1d442b
+ifdef CONFIG_LINUX
1d442b
+HELPERS-y += virtiofsd$(EXESUF)
1d442b
+endif
1d442b
+
1d442b
 # Sphinx does not allow building manuals into the same directory as
1d442b
 # the source files, so if we're doing an in-tree QEMU build we must
1d442b
 # build the manuals into a subdirectory (and then install them from
1d442b
@@ -430,6 +434,7 @@ dummy := $(call unnest-vars,, \
1d442b
                 elf2dmp-obj-y \
1d442b
                 ivshmem-client-obj-y \
1d442b
                 ivshmem-server-obj-y \
1d442b
+                virtiofsd-obj-y \
1d442b
                 rdmacm-mux-obj-y \
1d442b
                 libvhost-user-obj-y \
1d442b
                 vhost-user-scsi-obj-y \
1d442b
@@ -674,6 +679,11 @@ rdmacm-mux$(EXESUF): LIBS += "-libumad"
1d442b
 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
1d442b
 	$(call LINK, $^)
1d442b
 
1d442b
+ifdef CONFIG_LINUX # relies on Linux-specific syscalls
1d442b
+virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
1d442b
+	$(call LINK, $^)
1d442b
+endif
1d442b
+
1d442b
 vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
1d442b
 	$(call LINK, $^)
1d442b
 
1d442b
diff --git a/Makefile.objs b/Makefile.objs
1d442b
index 11ba1a36bd..b5f667a4ba 100644
1d442b
--- a/Makefile.objs
1d442b
+++ b/Makefile.objs
1d442b
@@ -125,6 +125,7 @@ vhost-user-blk-obj-y = contrib/vhost-user-blk/
1d442b
 rdmacm-mux-obj-y = contrib/rdmacm-mux/
1d442b
 vhost-user-input-obj-y = contrib/vhost-user-input/
1d442b
 vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
1d442b
+virtiofsd-obj-y = tools/virtiofsd/
1d442b
 
1d442b
 ######################################################################
1d442b
 trace-events-subdirs =
1d442b
diff --git a/tools/virtiofsd/Makefile.objs b/tools/virtiofsd/Makefile.objs
1d442b
new file mode 100644
1d442b
index 0000000000..45a807500d
1d442b
--- /dev/null
1d442b
+++ b/tools/virtiofsd/Makefile.objs
1d442b
@@ -0,0 +1,9 @@
1d442b
+virtiofsd-obj-y = buffer.o \
1d442b
+                  fuse_opt.o \
1d442b
+                  fuse_log.o \
1d442b
+                  fuse_lowlevel.o \
1d442b
+                  fuse_signals.o \
1d442b
+                  fuse_virtio.o \
1d442b
+                  helper.o \
1d442b
+                  passthrough_ll.o
1d442b
+