From: Anthony PERARD Subject: Re: [PATCH v3 6/9] libxl: add Qdisk backend launch helper Date: Mon, 18 Nov 2013 17:44:19 +0000 Message-ID: <20131118174419.GE2663@perard.uk.xensource.com> References: <1384786591-3020-1-git-send-email-roger.pau@citrix.com> <1384786591-3020-7-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ViSs3-0001vS-Py for xen-devel@lists.xenproject.org; Mon, 18 Nov 2013 17:44:23 +0000 Content-Disposition: inline In-Reply-To: <1384786591-3020-7-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: xen-devel@lists.xenproject.org, Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, Nov 18, 2013 at 03:56:28PM +0100, Roger Pau Monne wrote: > Current Qemu launch functions in libxl require the usage of data > structures only avaialbe on domain creation. All this information is > not need in order to launch a Qemu instance to serve Qdisk backends, > so introduce a new simplified helper that can be used to launch > Qemu/Qdisk, that will be used to launch Qdisk in driver domains. > = > Signed-off-by: Roger Pau Monn=E9 > Cc: Ian Jackson > Cc: Ian Campbell > Cc: Anthony PERARD > Cc: Stefano Stabellini > --- > tools/libxl/libxl_dm.c | 146 ++++++++++++++++++++++++++++++++++++= +----- > tools/libxl/libxl_internal.h | 6 ++ > 2 files changed, 136 insertions(+), 16 deletions(-) > = > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index b4798b8..64123aa 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -1320,18 +1335,91 @@ static void device_model_spawn_outcome(libxl__egc= *egc, > dmss->callback(egc, dmss, rc); > } > = > -int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid) > +void libxl__spawn_qdisk_backend(libxl__egc *egc, libxl__dm_spawn_state *= dmss) > { > - char *pid; > - int ret; > + STATE_AO_GC(dmss->spawn.ao); > + flexarray_t *dm_args; > + char **args; > + const char *dm; > + int logfile_w, null, rc; > + uint32_t domid =3D dmss->guest_domid; > + > + /* Always use qemu-xen as device model */ > + dm =3D qemu_xen_path(gc); > + > + dm_args =3D flexarray_make(gc, 15, 1); > + flexarray_vappend(dm_args, dm, "-xen-domid", > + GCSPRINTF("%d", domid), NULL); > + flexarray_append(dm_args, "-xen-attach"); > + flexarray_vappend(dm_args, "-name", > + GCSPRINTF("domain-%u", domid), NULL); > + flexarray_append(dm_args, "-nographic"); > + flexarray_vappend(dm_args, "-M", "xenpv", NULL); > + flexarray_vappend(dm_args, "-monitor", "/dev/null", NULL); > + flexarray_vappend(dm_args, "-serial", "/dev/null", NULL); > + flexarray_vappend(dm_args, "-parallel", "/dev/null", NULL); You might want to look at the -nodefaults option of QEMU instead of using -nographic -monitor -serial -parallel. -- = Anthony PERARD