All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, julien@xen.org,
	Bertrand.Marquis@arm.com, Luca Miccio <lucmiccio@gmail.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	wl@xen.org, anthony.perard@citrix.com, jgross@suse.com
Subject: Re: [XEN PATCH 3/7] tools: add a late_init argument to xs_introduce_domain
Date: Sat, 8 Jan 2022 03:35:16 +0100	[thread overview]
Message-ID: <Ydj4ZFQUBjTWfvyZ@mail-itl> (raw)
In-Reply-To: <20220108004912.3820176-3-sstabellini@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4291 bytes --]

On Fri, Jan 07, 2022 at 04:49:08PM -0800, Stefano Stabellini wrote:
> From: Luca Miccio <lucmiccio@gmail.com>
> 
> Add a late_init argument to xs_introduce_domain to handle dom0less
> guests whose xenstore interfaces are initialized after boot.
> 
> This patch mechanically adds the new parameter; it doesn't change
> behaviors.
> 
> Signed-off-by: Luca Miccio <lucmiccio@gmail.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>

I realize there is not much sense in making the parameter usable in the
Python API, since it's only useful for xenstored. So, for the Python part:

Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

> CC: wl@xen.org
> CC: anthony.perard@citrix.com
> CC: jgross@suse.com
> CC: marmarek@invisiblethingslab.com
> ---
>  tools/include/xenstore.h          | 3 ++-
>  tools/libs/light/libxl_dom.c      | 3 ++-
>  tools/libs/store/xs.c             | 8 ++++++--
>  tools/python/xen/lowlevel/xs/xs.c | 2 +-
>  4 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/include/xenstore.h b/tools/include/xenstore.h
> index 2b3f69fb61..1a302b5ff9 100644
> --- a/tools/include/xenstore.h
> +++ b/tools/include/xenstore.h
> @@ -226,7 +226,8 @@ bool xs_transaction_end(struct xs_handle *h, xs_transaction_t t,
>  bool xs_introduce_domain(struct xs_handle *h,
>  			 unsigned int domid,
>  			 unsigned long mfn,
> -                         unsigned int eventchn); 
> +			 unsigned int eventchn,
> +			 bool late_init);
>  
>  /* Set the target of a domain
>   * This tells the store daemon that a domain is targetting another one, so
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index 2abaab439c..bacfdfa9df 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -497,7 +497,8 @@ retry_transaction:
>      if (!xs_transaction_end(ctx->xsh, t, 0))
>          if (errno == EAGAIN)
>              goto retry_transaction;
> -    xs_introduce_domain(ctx->xsh, domid, state->store_mfn, state->store_port);
> +    xs_introduce_domain(ctx->xsh, domid, state->store_mfn, state->store_port,
> +                        false);
>      free(vm_path);
>      return 0;
>  }
> diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
> index 7a9a8b1656..dd47d607fd 100644
> --- a/tools/libs/store/xs.c
> +++ b/tools/libs/store/xs.c
> @@ -1089,16 +1089,18 @@ bool xs_transaction_end(struct xs_handle *h, xs_transaction_t t,
>   */
>  bool xs_introduce_domain(struct xs_handle *h,
>  			 unsigned int domid, unsigned long mfn,
> -			 unsigned int eventchn)
> +			 unsigned int eventchn, bool late_init)
>  {
>  	char domid_str[MAX_STRLEN(domid)];
>  	char mfn_str[MAX_STRLEN(mfn)];
>  	char eventchn_str[MAX_STRLEN(eventchn)];
> -	struct iovec iov[3];
> +	char late_init_str[MAX_STRLEN(late_init)];
> +	struct iovec iov[4];
>  
>  	snprintf(domid_str, sizeof(domid_str), "%u", domid);
>  	snprintf(mfn_str, sizeof(mfn_str), "%lu", mfn);
>  	snprintf(eventchn_str, sizeof(eventchn_str), "%u", eventchn);
> +	snprintf(late_init_str, sizeof(late_init_str), "%u", late_init);
>  
>  	iov[0].iov_base = domid_str;
>  	iov[0].iov_len = strlen(domid_str) + 1;
> @@ -1106,6 +1108,8 @@ bool xs_introduce_domain(struct xs_handle *h,
>  	iov[1].iov_len = strlen(mfn_str) + 1;
>  	iov[2].iov_base = eventchn_str;
>  	iov[2].iov_len = strlen(eventchn_str) + 1;
> +	iov[3].iov_base = late_init_str;
> +	iov[3].iov_len = strlen(late_init_str) + 1;
>  
>  	return xs_bool(xs_talkv(h, XBT_NULL, XS_INTRODUCE, iov,
>  				ARRAY_SIZE(iov), NULL));
> diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
> index 0dad7fa5f2..dc667fb231 100644
> --- a/tools/python/xen/lowlevel/xs/xs.c
> +++ b/tools/python/xen/lowlevel/xs/xs.c
> @@ -678,7 +678,7 @@ static PyObject *xspy_introduce_domain(XsHandle *self, PyObject *args)
>          return NULL;
>  
>      Py_BEGIN_ALLOW_THREADS
> -    result = xs_introduce_domain(xh, dom, page, port);
> +    result = xs_introduce_domain(xh, dom, page, port, false);
>      Py_END_ALLOW_THREADS
>  
>      return none(result);
> -- 
> 2.25.1
> 

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-01-08  2:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08  0:49 [XEN PATCH 0/7] dom0less PV drivers Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 1/7] xen: introduce XENFEAT_xenstore_late_init Stefano Stabellini
2022-01-08  3:41   ` Julien Grall
2022-01-10 22:55     ` Stefano Stabellini
2022-01-11 11:01       ` David Vrabel
2022-01-11 22:52         ` Stefano Stabellini
2022-01-10  9:46   ` Jan Beulich
2022-01-10 23:08     ` Stefano Stabellini
2022-01-11  7:14       ` Jan Beulich
2022-01-11 22:51         ` Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 2/7] xen: introduce _evtchn_alloc_unbound Stefano Stabellini
2022-01-10 10:25   ` Jan Beulich
2022-01-11 22:49     ` Stefano Stabellini
2022-01-12  7:42       ` Jan Beulich
2022-01-13  0:45         ` Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 3/7] tools: add a late_init argument to xs_introduce_domain Stefano Stabellini
2022-01-08  2:35   ` Marek Marczykowski-Górecki [this message]
2022-01-13  0:49     ` Stefano Stabellini
2022-01-08  3:46   ` Julien Grall
2022-01-08  0:49 ` [XEN PATCH 4/7] xen: introduce xen,enhanced dom0less property Stefano Stabellini
2022-01-11  3:31   ` Volodymyr Babchuk
2022-01-11 23:03     ` Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 5/7] xen/arm: configure dom0less domain for enabling xenstore after boot Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 6/7] xenstored: do_introduce: handle the late_init case Stefano Stabellini
2022-01-08  2:39   ` Marek Marczykowski-Górecki
2022-01-13  0:51     ` Stefano Stabellini
2022-01-08  3:54   ` Julien Grall
2022-01-10 22:48     ` Stefano Stabellini
2022-01-08  0:49 ` [XEN PATCH 7/7] tools: add example application to initialize dom0less PV drivers Stefano Stabellini
2022-01-08  4:02   ` Julien Grall
2022-01-10 22:57     ` Stefano Stabellini

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=Ydj4ZFQUBjTWfvyZ@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=lucmiccio@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.