Skip to contentSkip to conversation

officializing xenstore control/feature-balloon entry

PATCH In review Yann Dirson 3 participants 8 messages May 10, 2023 – May 25, 2023

lore
Share & tools
lore
#0 lore raw

cover officializing xenstore control/feature-balloon entry

The main topic of this patch series is the ~/control/feature-balloon entry used by XAPI, prompted by the report of xe-guest-utilities on FreeBSD not being able to report the feature when using just libxl on the host.

First patch is a bit off-topic, but included here because it fixes the text from which this feature description was adapted from.

Yann Dirson (3):
docs: fix complex-and-wrong xenstore-path wording
docs: document ~/control/feature-balloon
libxl: create ~/control/feature-balloon

 docs/misc/xenstore-paths.pandoc | 16 ++++++++++------
 tools/libs/light/libxl_create.c |  3 +++
 2 files changed, 13 insertions(+), 6 deletions(-)
Signature · 8 lines
2.30.2



Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
w: vates.fr | xcp-ng.org | xen-orchestra.com
#1 lore raw

PATCH 1/3 docs: fix complex-and-wrong xenstore-path wording

"0 or 1 ... to indicate whether it is capable or incapable, respectively" is luckily just swapped words. Making this shorter will
make the reading easier.

---
 docs/misc/xenstore-paths.pandoc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
docs/misc/xenstore-paths.pandoc +4 -6
index f07ef90f63..a604f6b1c6 100644
@@ -454,9 +454,8 @@ The precise protocol is not yet documented.
 #### ~/control/feature-suspend = (""|"0"|"1") [w]
 
 These may be initialized to "" by the toolstack and may then be set
-to 0 or 1 by a guest to indicate whether it is capable or incapable,
-respectively, of responding to the corresponding command when written
-to ~/control/shutdown.
+to 0 or 1 by a guest to indicate whether it is capable of responding
+to the corresponding command when written to ~/control/shutdown.
 A toolstack may then sample the feature- value at the point of issuing
 a PV control command and respond accordingly:
 
@@ -507,9 +506,8 @@ string back to the control node.
 #### ~/control/feature-laptop-slate-mode = (""|"0"|"1") [w]
 
 This may be initialized to "" by the toolstack and may then be set
-to 0 or 1 by a guest to indicate whether it is capable or incapable,
-respectively, of responding to a mode value written to
-~/control/laptop-slate-mode.
+to 0 or 1 by a guest to indicate whether it is capable of responding
+to a mode value written to ~/control/laptop-slate-mode.
 
 ### Domain Controlled Paths
 
Signature · 8 lines
2.30.2



Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
w: vates.fr | xcp-ng.org | xen-orchestra.com
#3 lore raw

PATCH 2/3 docs: document ~/control/feature-balloon

In reply to Yann Dirson

This flag has been in use by XAPI for a long time (was present at creation of the github xen-api/squeezed repo in 2013), and could be used by other toolstacks.

---
 docs/misc/xenstore-paths.pandoc | 6 ++++++
 1 file changed, 6 insertions(+)
docs/misc/xenstore-paths.pandoc +6 -0
index a604f6b1c6..6c4e2c3da2 100644
@@ -509,6 +509,12 @@ This may be initialized to "" by the toolstack and may then be set
 to 0 or 1 by a guest to indicate whether it is capable of responding
 to a mode value written to ~/control/laptop-slate-mode.
 
+#### ~/control/feature-balloon
+
+This may be initialized to "" by the toolstack and may then be set to
+0 or 1 by a guest to indicate whether it is capable of memory
+ballooning, and responds to values written to ~/memory/target.
+
 ### Domain Controlled Paths
 
 #### ~/data/* [w]
Signature · 8 lines
2.30.2



Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
w: vates.fr | xcp-ng.org | xen-orchestra.com
#4 lore raw

Re: [PATCH 2/3] docs: document ~/control/feature-balloon

docs/misc/xenstore-paths.pandoc This may be initialized to "" by the toolstack and may then be set · line 516

Quoted 11 lines · Yann Dirson
docs/misc/xenstore-paths.pandoc +5 -0
@@ -509,6 +509,12 @@ This may be initialized to "" by the toolstack and may then be set
 to 0 or 1 by a guest to indicate whether it is capable of responding
 to a mode value written to ~/control/laptop-slate-mode.
 
+#### ~/control/feature-balloon
+
+This may be initialized to "" by the toolstack and may then be set to
+0 or 1 by a guest to indicate whether it is capable of memory
+ballooning, and responds to values written to ~/memory/target.

Besides correctly saying "may", I guess this wants to go further and also clarify what the (intended) behavior is when the node is absent. Aiui PV guests are always expected to have a balloon driver, so the assumed value likely needs to be "1" there. Furthermore I'm afraid it doesn't really become clear what value this node is if it's only optionally present, while its absence doesn't really allow uniform assumptions towards a default value.

Jan

#5 lore raw

Re: [PATCH 2/3] docs: document ~/control/feature-balloon

Quoted 7 lines · Jan Beulich
Quoted 6 lines · Yann Dirson
docs/misc/xenstore-paths.pandoc +0 -0
@@ -509,6 +509,12 @@ This may be initialized to "" by the toolstack and may then be set
  to 0 or 1 by a guest to indicate whether it is capable of responding
  to a mode value written to ~/control/laptop-slate-mode.
 
Quoted 13 lines

docs/misc/xenstore-paths.pandoc This may be initialized to "" by the toolstack and may then be set · line 516

Quoted 5 lines
docs/misc/xenstore-paths.pandoc +5 -0
+#### ~/control/feature-balloon
+
+This may be initialized to "" by the toolstack and may then be set to
+0 or 1 by a guest to indicate whether it is capable of memory
+ballooning, and responds to values written to ~/memory/target.

Besides correctly saying "may", I guess this wants to go further and also clarify what the (intended) behavior is when the node is absent. Aiui PV guests are always expected to have a balloon driver, so the assumed value likely needs to be "1" there. Furthermore I'm afraid it doesn't really become clear what value this node is if it's only optionally present, while its absence doesn't really allow uniform assumptions towards a default value.

Things are indeed more complicated than I originally identified, the way this xenstore entry is used currently seems to make it difficult to introduce it in a backward-compatible manner

I guess this and a number of details ought to be discussed at the XAPI level first.

Details: the squeezed assumption [1] is that a domain which has not set this to 1 is not ready yet to get ballooned, which implies the default has to be 0 whatever the guest type, as it requires to know the total number of pages used by the domain to be stable. So I guess we can see it as not being "not just a feature flag".

[1]
https://github.com/xapi-project/xen-api/tree/master/ocaml/squeezed/doc/design#environmental-assumptions

Signature · 9 lines
Yann Dirson | Vates Platform Developer
XCP-ng & Xen Orchestra - Vates solutions
w: vates.tech | xcp-ng.org | xen-orchestra.com


Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
w: vates.fr | xcp-ng.org | xen-orchestra.com
#6 lore raw

PATCH 3/3 libxl: create ~/control/feature-balloon

In reply to Yann Dirson

Like other feature controls it has to be created by the toolstack before the guest can advertise the feature.

---
 tools/libs/light/libxl_create.c | 3 +++
 1 file changed, 3 insertions(+)
tools/libs/light/libxl_create.c +3 -0
index ec8eab02c2..85eccc90cd 100644
@@ -863,6 +863,9 @@ retry_transaction:
     libxl__xs_mknod(gc, t,
                     GCSPRINTF("%s/control/sysrq", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/control/feature-balloon", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
 
     libxl__xs_mknod(gc, t,
                     GCSPRINTF("%s/data", dom_path),
Signature · 8 lines
2.30.2



Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
w: vates.fr | xcp-ng.org | xen-orchestra.com
#7 lore raw
In reply to Yann Dirson
Quoted 8 lines · Yann Dirson

The main topic of this patch series is the ~/control/feature-balloon entry used by XAPI, prompted by the report of xe-guest-utilities on FreeBSD not being able to report the feature when using just libxl on the host.

First patch is a bit off-topic, but included here because it fixes the text from which this feature description was adapted from.

Quoted 8 lines

Yann Dirson (3):
docs: fix complex-and-wrong xenstore-path wording
docs: document ~/control/feature-balloon
libxl: create ~/control/feature-balloon

 docs/misc/xenstore-paths.pandoc | 16 ++++++++++------
 tools/libs/light/libxl_create.c |  3 +++
 2 files changed, 13 insertions(+), 6 deletions(-)

You may want to re-send this series with maintainers properly Cc-ed. For the docs changes I wouldn't go by get_maintainer.pl, but rather Cc the xenstore maintainers. (I guess this file ought to be added to that section, on top of what was recently added there.)

Jan