Message ID | 20220108004912.3820176-3-sstabellini@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | dom0less PV drivers | expand |
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 >
Hi, On 08/01/2022 00:49, 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> > 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) The interface of libstore is meant to be stable/versioned. So I don't think you can change xs_introduce_domain(). > { > 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); Cheers,
On Sat, 8 Jan 2022, Marek Marczykowski-Górecki wrote: > 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> Thanks Marek for the quick comeback and for the ack. This patch will get dropped in the next version of the series.
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);