qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Nan Li <nli@suse.com>
Cc: qemu-devel@nongnu.org, ptesarik@suse.com
Subject: Re: [Qemu-devel] [PATCH 2/2] Dump: add command "fuse-mount"
Date: Mon, 9 May 2016 17:30:13 +0100	[thread overview]
Message-ID: <20160509163013.GF14467@redhat.com> (raw)
In-Reply-To: <1462663968-26607-3-git-send-email-nli@suse.com>

On Sun, May 08, 2016 at 07:32:48AM +0800, Nan Li wrote:
> Add a "fuse-mount" command to support the Filesystem in Userspace (FUSE).
> It can mount or unmount the filesystem with both hmp and qmp commands.
> It calls the API function qemu_fuse_main(int argc, char *argv[]).
> 
> Signed-off-by: Nan Li <nli@suse.com>
> ---
>  dump.c           | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>  hmp-commands.hx  | 19 +++++++++++++++++++
>  hmp.c            | 12 ++++++++++++
>  hmp.h            |  1 +
>  qapi-schema.json | 15 +++++++++++++++
>  qmp-commands.hx  | 31 +++++++++++++++++++++++++++++++
>  6 files changed, 126 insertions(+)
> 
> diff --git a/dump.c b/dump.c
> index 9726f1f..7599f06 100644
> --- a/dump.c
> +++ b/dump.c
> @@ -26,6 +26,10 @@
>  #include "qapi/qmp/qerror.h"
>  #include "qmp-commands.h"
>  #include "qapi-event.h"
> +#ifdef CONFIG_FUSE
> +#include <sys/mount.h>
> +#include "fuse-mem.h"
> +#endif
>  
>  #include <zlib.h>
>  #ifdef CONFIG_LZO
> @@ -1846,3 +1850,47 @@ DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp)
>  
>      return cap;
>  }
> +
> +#ifdef CONFIG_FUSE
> +static void *fuse_process(void *data)
> +{
> +    pid_t pid;
> +    int argc = 2;
> +    char *argv[2];
> +    char programname[] = "fuse-mount-process";
> +    argv[0] = programname;
> +    argv[1] = (char *)data;
> +    int ret;
> +
> +    if ((pid = fork()) < 0)
> +        perror("fork() is failed");
> +    else if (pid == 0) {
> +        ret = qemu_fuse_main(argc, argv);

If you fork() in a multi-threaded program, then you are restricted to
only use POSIX APIs declared async signal safe, until such time as
you execve().  I've not looked at the code, but I'm not imagining that
fuse_main() is going to be safe in this respect.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-05-09 16:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07 23:32 [Qemu-devel] [PATCH 0/2] Dump: add a Filesystem in Userspace and command "fuse-mount" Nan Li
2016-05-07 23:32 ` [Qemu-devel] [PATCH 1/2] Dump: introduce a Filesystem in Userspace Nan Li
2016-05-09 15:52   ` Eric Blake
2016-05-09 16:13     ` Daniel P. Berrange
2016-05-09 16:20       ` Petr Tesarik
2016-05-09 16:32         ` Daniel P. Berrange
2016-05-10  6:19           ` Petr Tesarik
2016-05-10  8:39             ` Daniel P. Berrange
2016-05-10  5:59     ` Petr Tesarik
2016-05-10  8:48       ` Daniel P. Berrange
2016-05-10  9:42         ` Petr Tesarik
2016-05-10 11:26           ` Nan Li
2016-05-10  9:56       ` Stefan Hajnoczi
2016-05-10 11:02         ` Nan Li
2016-05-10 11:55         ` Petr Tesarik
2016-05-12 10:09           ` Stefan Hajnoczi
2016-05-12 10:30             ` Petr Tesarik
2016-05-07 23:32 ` [Qemu-devel] [PATCH 2/2] Dump: add command "fuse-mount" Nan Li
2016-05-09 16:30   ` Daniel P. Berrange [this message]
2016-05-09 16:48   ` Eric Blake
2016-05-10 11:32     ` Nan Li
2016-05-10  9:47 ` [Qemu-devel] [PATCH 0/2] Dump: add a Filesystem in Userspace and " Stefan Hajnoczi
2016-05-10  9:50 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160509163013.GF14467@redhat.com \
    --to=berrange@redhat.com \
    --cc=nli@suse.com \
    --cc=ptesarik@suse.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).