diff mbox series

[025/104] virtiofsd: Add Makefile wiring for virtiofsd contrib

Message ID 20191212163904.159893-26-dgilbert@redhat.com (mailing list archive)
State New, archived
Headers show
Series virtiofs daemon [all] | expand

Commit Message

Dr. David Alan Gilbert Dec. 12, 2019, 4:37 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Wire up the building of the virtiofsd in contrib.

virtiofsd relies on Linux-specific system calls and seccomp.  Anyone
wishing to port it to other host operating systems should do so
carefully and without reducing security.

Only allow building on Linux hosts.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 Makefile                      |  8 ++++++++
 Makefile.objs                 |  1 +
 tools/virtiofsd/Makefile.objs | 10 ++++++++++
 3 files changed, 19 insertions(+)
 create mode 100644 tools/virtiofsd/Makefile.objs

Comments

Liam Merwick Dec. 13, 2019, 4:02 p.m. UTC | #1
On 12/12/2019 16:37, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Wire up the building of the virtiofsd in contrib.

s/contrib/tools/

otherwise

Reviewed-by: Liam Merwick <liam.merwick@oracle.com>

> 
> virtiofsd relies on Linux-specific system calls and seccomp.  Anyone
> wishing to port it to other host operating systems should do so
> carefully and without reducing security.
> 
> Only allow building on Linux hosts.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   Makefile                      |  8 ++++++++
>   Makefile.objs                 |  1 +
>   tools/virtiofsd/Makefile.objs | 10 ++++++++++
>   3 files changed, 19 insertions(+)
>   create mode 100644 tools/virtiofsd/Makefile.objs
> 
> diff --git a/Makefile b/Makefile
> index b437a346d7..b7f7019a50 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -322,6 +322,8 @@ HELPERS-y =
>   HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
>   
>   ifdef CONFIG_LINUX
> +HELPERS-y += virtiofsd$(EXESUF)
> +
>   ifdef CONFIG_VIRGL
>   ifdef CONFIG_GBM
>   HELPERS-y += vhost-user-gpu$(EXESUF)
> @@ -430,6 +432,7 @@ dummy := $(call unnest-vars,, \
>                   elf2dmp-obj-y \
>                   ivshmem-client-obj-y \
>                   ivshmem-server-obj-y \
> +                virtiofsd-obj-y \
>                   rdmacm-mux-obj-y \
>                   libvhost-user-obj-y \
>                   vhost-user-scsi-obj-y \
> @@ -674,6 +677,11 @@ rdmacm-mux$(EXESUF): LIBS += "-libumad"
>   rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
>   	$(call LINK, $^)
>   
> +ifdef CONFIG_LINUX # relies on Linux-specific syscalls
> +virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
> +	$(call LINK, $^)
> +endif
> +
>   vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
>   	$(call LINK, $^)
>   
> diff --git a/Makefile.objs b/Makefile.objs
> index 11ba1a36bd..b5f667a4ba 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -125,6 +125,7 @@ vhost-user-blk-obj-y = contrib/vhost-user-blk/
>   rdmacm-mux-obj-y = contrib/rdmacm-mux/
>   vhost-user-input-obj-y = contrib/vhost-user-input/
>   vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
> +virtiofsd-obj-y = tools/virtiofsd/
>   
>   ######################################################################
>   trace-events-subdirs =
> diff --git a/tools/virtiofsd/Makefile.objs b/tools/virtiofsd/Makefile.objs
> new file mode 100644
> index 0000000000..67be16332c
> --- /dev/null
> +++ b/tools/virtiofsd/Makefile.objs
> @@ -0,0 +1,10 @@
> +virtiofsd-obj-y = buffer.o \
> +                  fuse_opt.o \
> +                  fuse_log.o \
> +                  fuse_loop_mt.o \
> +                  fuse_lowlevel.o \
> +                  fuse_signals.o \
> +                  fuse_virtio.o \
> +                  helper.o \
> +                  passthrough_ll.o
> +
>
Dr. David Alan Gilbert Dec. 13, 2019, 4:56 p.m. UTC | #2
* Liam Merwick (liam.merwick@oracle.com) wrote:
> On 12/12/2019 16:37, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> > 
> > Wire up the building of the virtiofsd in contrib.
> 
> s/contrib/tools/

Ah! My sed of s-contrib/virtiofsd-tools/virtiofsd-
wasn't smart enough for that!

> otherwise
> 
> Reviewed-by: Liam Merwick <liam.merwick@oracle.com>

Thanks.

Dave

> 
> > 
> > virtiofsd relies on Linux-specific system calls and seccomp.  Anyone
> > wishing to port it to other host operating systems should do so
> > carefully and without reducing security.
> > 
> > Only allow building on Linux hosts.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >   Makefile                      |  8 ++++++++
> >   Makefile.objs                 |  1 +
> >   tools/virtiofsd/Makefile.objs | 10 ++++++++++
> >   3 files changed, 19 insertions(+)
> >   create mode 100644 tools/virtiofsd/Makefile.objs
> > 
> > diff --git a/Makefile b/Makefile
> > index b437a346d7..b7f7019a50 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -322,6 +322,8 @@ HELPERS-y =
> >   HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
> >   ifdef CONFIG_LINUX
> > +HELPERS-y += virtiofsd$(EXESUF)
> > +
> >   ifdef CONFIG_VIRGL
> >   ifdef CONFIG_GBM
> >   HELPERS-y += vhost-user-gpu$(EXESUF)
> > @@ -430,6 +432,7 @@ dummy := $(call unnest-vars,, \
> >                   elf2dmp-obj-y \
> >                   ivshmem-client-obj-y \
> >                   ivshmem-server-obj-y \
> > +                virtiofsd-obj-y \
> >                   rdmacm-mux-obj-y \
> >                   libvhost-user-obj-y \
> >                   vhost-user-scsi-obj-y \
> > @@ -674,6 +677,11 @@ rdmacm-mux$(EXESUF): LIBS += "-libumad"
> >   rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
> >   	$(call LINK, $^)
> > +ifdef CONFIG_LINUX # relies on Linux-specific syscalls
> > +virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
> > +	$(call LINK, $^)
> > +endif
> > +
> >   vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
> >   	$(call LINK, $^)
> > diff --git a/Makefile.objs b/Makefile.objs
> > index 11ba1a36bd..b5f667a4ba 100644
> > --- a/Makefile.objs
> > +++ b/Makefile.objs
> > @@ -125,6 +125,7 @@ vhost-user-blk-obj-y = contrib/vhost-user-blk/
> >   rdmacm-mux-obj-y = contrib/rdmacm-mux/
> >   vhost-user-input-obj-y = contrib/vhost-user-input/
> >   vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
> > +virtiofsd-obj-y = tools/virtiofsd/
> >   ######################################################################
> >   trace-events-subdirs =
> > diff --git a/tools/virtiofsd/Makefile.objs b/tools/virtiofsd/Makefile.objs
> > new file mode 100644
> > index 0000000000..67be16332c
> > --- /dev/null
> > +++ b/tools/virtiofsd/Makefile.objs
> > @@ -0,0 +1,10 @@
> > +virtiofsd-obj-y = buffer.o \
> > +                  fuse_opt.o \
> > +                  fuse_log.o \
> > +                  fuse_loop_mt.o \
> > +                  fuse_lowlevel.o \
> > +                  fuse_signals.o \
> > +                  fuse_virtio.o \
> > +                  helper.o \
> > +                  passthrough_ll.o
> > +
> > 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Daniel P. Berrangé Jan. 3, 2020, 3:41 p.m. UTC | #3
On Thu, Dec 12, 2019 at 04:37:45PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Wire up the building of the virtiofsd in contrib.
> 
> virtiofsd relies on Linux-specific system calls and seccomp.  Anyone
> wishing to port it to other host operating systems should do so
> carefully and without reducing security.
> 
> Only allow building on Linux hosts.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  Makefile                      |  8 ++++++++
>  Makefile.objs                 |  1 +
>  tools/virtiofsd/Makefile.objs | 10 ++++++++++
>  3 files changed, 19 insertions(+)
>  create mode 100644 tools/virtiofsd/Makefile.objs

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index b437a346d7..b7f7019a50 100644
--- a/Makefile
+++ b/Makefile
@@ -322,6 +322,8 @@  HELPERS-y =
 HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
 
 ifdef CONFIG_LINUX
+HELPERS-y += virtiofsd$(EXESUF)
+
 ifdef CONFIG_VIRGL
 ifdef CONFIG_GBM
 HELPERS-y += vhost-user-gpu$(EXESUF)
@@ -430,6 +432,7 @@  dummy := $(call unnest-vars,, \
                 elf2dmp-obj-y \
                 ivshmem-client-obj-y \
                 ivshmem-server-obj-y \
+                virtiofsd-obj-y \
                 rdmacm-mux-obj-y \
                 libvhost-user-obj-y \
                 vhost-user-scsi-obj-y \
@@ -674,6 +677,11 @@  rdmacm-mux$(EXESUF): LIBS += "-libumad"
 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
 
+ifdef CONFIG_LINUX # relies on Linux-specific syscalls
+virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
+	$(call LINK, $^)
+endif
+
 vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
 	$(call LINK, $^)
 
diff --git a/Makefile.objs b/Makefile.objs
index 11ba1a36bd..b5f667a4ba 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -125,6 +125,7 @@  vhost-user-blk-obj-y = contrib/vhost-user-blk/
 rdmacm-mux-obj-y = contrib/rdmacm-mux/
 vhost-user-input-obj-y = contrib/vhost-user-input/
 vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
+virtiofsd-obj-y = tools/virtiofsd/
 
 ######################################################################
 trace-events-subdirs =
diff --git a/tools/virtiofsd/Makefile.objs b/tools/virtiofsd/Makefile.objs
new file mode 100644
index 0000000000..67be16332c
--- /dev/null
+++ b/tools/virtiofsd/Makefile.objs
@@ -0,0 +1,10 @@ 
+virtiofsd-obj-y = buffer.o \
+                  fuse_opt.o \
+                  fuse_log.o \
+                  fuse_loop_mt.o \
+                  fuse_lowlevel.o \
+                  fuse_signals.o \
+                  fuse_virtio.o \
+                  helper.o \
+                  passthrough_ll.o
+