tools/xenstore: add some new features to the documentation
v3 cover tools/xenstore: add some new features to the documentation
In the past there have been spotted some shortcomings in the Xenstore interface, which should be repaired. Those are in detail:
- Using driver domains for large number of domains needs per domain Xenstore quota [1]. The feedback sent was rather slim (one reply), but it was preferring a new set of wire commands.
- XSA-349 [2] has shown that the current definition of watches is not optimal, as it will trigger lots of events when a single one would
suffice: for detecting new backend devices the backends in the Linux kernel are registering a watch for e.g. "/local/domain/0/backend" which will fire for ANY sub-node written below this node (on a test machine this added up to 91 watch events for only 3 devices). This can be limited dramatically by extending the XS_WATCH command to take another optional parameter specifying the depth of subdirectories to be considered for sending watch events ("0" would trigger a watch event only if the watched node itself being written).
- New features like above being added might make migration of guests between hosts with different Xenstore variants harder, so it should be possible to set the available feature set per domain. For socket connections it should be possible to read the available features.
- The special watches @introduceDomain and @releaseDomain are rather cumbersome to use, as they only tell you that SOME domain has been introduced/released. Any consumer of those watches needs to scan all domains on the host in order to find out the domid, causing significant pressure on the dominfo hypercall (imagine a system with 1000 domains running and one domain dying - there will be more than 1000 watch events triggered and 1000 xl daemons will try to find out whether "their" domain has died). Those watches should be enhanced to optionally be specific to a single domain and to let the event carry the related domid.
As some of those extensions will need to be considered in the Xenstore migration stream, they should be defined in one go (in fact the 4th one wouldn't need that, but it can easily be connected to the 2nd one). As such extensions need to be flagged in the "features" in the ring page anyway, it is fine to implement them independently.
Add the documentation of the new commands/features.
[1]: https://lists.xen.org/archives/html/xen-devel/2020-06/msg00291.html
[2]: http://xenbits.xen.org/xsa/advisory-349.html
Changes in V3:
- patch 1 removed, as already committed
- new patch 1
- minor clarifications in patch 2
- new patch 5
Changes in V2:
- added new patch 1
- remove feature bits for dom0-only features
- get-features without domid returns Xenstore supported features
- get/set-quota without domid for global quota access
Juergen Gross (5):
tools/xenstore: minor fix of the migration stream doc tools/xenstore: add documentation for new set/get-feature commands tools/xenstore: add documentation for new set/get-quota commands tools/xenstore: add documentation for extended watch command tools/xenstore: add migration stream extensions for new features
docs/designs/xenstore-migration.md | 91 +++++++++++++++++++++++++++--- docs/misc/xenstore-ring.txt | 1 + docs/misc/xenstore.txt | 50 +++++++++++++++- 3 files changed, 132 insertions(+), 10 deletions(-)
Signature · 1 line
2.35.3
PATCH v3 1/5 tools/xenstore: minor fix of the migration stream doc
Drop mentioning the non-existent read-only socket in the migration stream description document.
---
V3:
- new patch
--- docs/designs/xenstore-migration.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
docs/designs/xenstore-migration.md +3 -5
@@ -129,11 +129,9 @@ xenstored state that needs to be restored. | `evtchn-fd` | The file descriptor used to communicate with | | | the event channel driver | -xenstored will resume in the original process context. Hence `rw-socket-fd` and -`ro-socket-fd` simply specify the file descriptors of the sockets. Sockets -are not always used, however, and so -1 will be used to denote an unused -socket. - +xenstored will resume in the original process context. Hence `rw-socket-fd` +simply specifies the file descriptor of the socket. Sockets are not always +used, however, and so -1 will be used to denote an unused socket. \pagebreak
Signature · 1 line
2.35.3
Re: [PATCH v3 1/5] tools/xenstore: minor fix of the migration stream doc
Hi Juergen,
Quoted 2 lines · Juergen Gross
Drop mentioning the non-existent read-only socket in the migration stream description document.
I would suggest to mention in the commit message (or possibly use Fixes tags) that this was dropped in 8868a0e3f674 ("docs: update the xenstore migration stream documentation).
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 2/5 tools/xenstore: add documentation for new set/get-feature commands
In reply to Juergen GrossAdd documentation for two new Xenstore wire commands SET_FEATURE and GET_FEATURE used to set or query the Xenstore features visible in the ring page of a given domain.
---
V2:
- remove feature bit (Julien Grall)
- GET_FEATURE without domid will return Xenstore supported features (triggered by Julien Grall)
V3:
- clarify that guest only sees a copy of features (Julien Grall)
- add remark that SET_FEATURE will be rejected after INTRODUCE of a domain (Julien Grall)
--- docs/misc/xenstore.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
docs/misc/xenstore.txt +17 -0
@@ -331,6 +331,23 @@ SET_TARGET <domid>|<tdomid>| xenstored prevents the use of SET_TARGET other than by dom0. +GET_FEATURE [<domid>|] <value>| +SET_FEATURE <domid>|<value>| + Returns or sets the contents of the "feature" field copied to + offset 2064 of the Xenstore ring page of the domain specified by + <domid>. <value> is a decimal number being a logical or of the + feature bits as defined in docs/misc/xenstore-ring.txt. Trying + to set a bit for a feature not being supported by the running + Xenstore will be denied. Providing no <domid> with the + GET_FEATURE command will return the features which are supported + by Xenstore. + + SET_FEATURE for a domain will be rejected after the INTRODUCE + command for this domain has been sent to xenstored. + + xenstored prevents the use of GET_FEATURE and SET_FEATURE other + than by dom0. + ---------- Miscellaneous ---------- CONTROL <command>|[<parameters>|]
Signature · 1 line
2.35.3
Re: [PATCH v3 2/5] tools/xenstore: add documentation for new set/get-feature commands
Hi Juergen,
Quoted 5 lines · Juergen Gross
Add documentation for two new Xenstore wire commands
SET_FEATUREandGET_FEATUREused to set or query the Xenstore features visible in the ring page of a given domain.Signed-off-by Juergen Gross <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 3/5 tools/xenstore: add documentation for new set/get-quota commands
In reply to Juergen GrossAdd documentation for two new Xenstore wire commands SET_QUOTA and GET_QUOTA used to set or query the global Xenstore quota or those of a given domain.
---
V2:
- remove feature bit (Julien Grall)
- add possibility to access global quota and to query supported quotas
--- docs/misc/xenstore.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
docs/misc/xenstore.txt +17 -0
@@ -348,6 +348,23 @@ SET_FEATURE <domid>|<value>| xenstored prevents the use of GET_FEATURE and SET_FEATURE other than by dom0. +GET_QUOTA [[<domid>|]<quota>|] <value>| +SET_QUOTA [<domid>|]<quota>|<value>| + Returns or sets a quota value for the domain being specified by + <domid>. Omitting <domid> will return or set the global quota + values, which are the default values for new domains. <quota> is + one of "nodes", "watches", "transactions", "node-size", + "permissions", or any other implementation defined value. For + GET_QUOTA it is possible to omit the <quota> parameter together + with the <domid> parameter, which will return a single string of + all supported <quota> values separated by blanks. <value> is a + decimal number specifying the quota value, with "0" having the + special meaning of quota checks being disabled. The initial quota + settings for a domain are the global ones of Xenstore. + + xenstored prevents the use of GET_QUOTA and SET_QUOTA other + than by dom0. + ---------- Miscellaneous ---------- CONTROL <command>|[<parameters>|]
Signature · 1 line
2.35.3
PATCH v3 4/5 tools/xenstore: add documentation for extended watch command
In reply to Juergen GrossAdd documentation for an extension of the WATCH command used to limit the scope of watched paths. Additionally it enables to receive more information in the events related to special watches (@introduceDomain or @releaseDomain).
--- docs/misc/xenstore-ring.txt | 1 + docs/misc/xenstore.txt | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
docs/misc/xenstore-ring.txt +1 -0
@@ -69,6 +69,7 @@ Bit Description ----------------------------------------------------------------- 0 Ring reconnection (see the ring reconnection feature below) 1 Connection error indicator (see connection error feature below) +2 WATCH can take a third parameter limiting its scope The "Connection state" field is used to request a ring close and reconnect. The "Connection state" field only contains valid data if the server has
docs/misc/xenstore.txt +13 -3
@@ -187,7 +187,7 @@ SET_PERMS <path>|<perm-as-string>|+? ---------- Watches ---------- -WATCH <wpath>|<token>|? +WATCH <wpath>|<token>|[<depth>|]? Adds a watch. When a <path> is modified (including path creation, removal,
@@ -198,7 +198,11 @@ WATCH <wpath>|<token>|? matching watch results in a WATCH_EVENT message (see below). The event's path matches the watch's <wpath> if it is an child - of <wpath>. + of <wpath>. This match can be limited by specifying <depth> (a + decimal value of 0 or larger): it denotes the directory levels + below <wpath> to consider for a match ("0" would not match for + a child of <wpath>, "1" would match only for a direct child, + etc.). <wpath> can be a <path> to watch or @<wspecial>. In the latter case <wspecial> may have any syntax but it matches
@@ -209,7 +213,13 @@ WATCH <wpath>|<token>|? shutdown, and also on RELEASE and domain destruction <wspecial> events are sent to privileged callers or explicitly - via SET_PERMS enabled domains only. + via SET_PERMS enabled domains only. The semantics for a + specification of <depth> differ for generating <wspecial> + events: specifying "1" will report the related domid by using + @<wspecial>/<domid> for the reported path. Other <depth> + values are not supported. + For @releaseDomain it is possible to watch only for a specific + domain by specifying @releaseDomain/<domid> for the path. When a watch is first set up it is triggered once straight away, with <path> equal to <wpath>. Watches may be triggered
Signature · 1 line
2.35.3
PATCH v3 5/5 tools/xenstore: add migration stream extensions for new features
In reply to Juergen GrossExtend the definition of the Xenstore migration stream to cover new features:
- per domain features
- extended watches (watch depth)
- per domain quota
---
V3:
- new patch
--- docs/designs/xenstore-migration.md | 85 ++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 3 deletions(-)
docs/designs/xenstore-migration.md +82 -3
@@ -43,7 +43,13 @@ the setting of the endianness bit. |-----------|---------------------------------------------------| | `ident` | 0x78656e73746f7265 ('xenstore' in ASCII) | | | | -| `version` | 0x00000001 (the version of the specification) | +| `version` | The version of the specification, defined values: | +| | 0x00000001: all fields without any explicitly | +| | mentioned version dependency are | +| | valid. | +| | 0x00000002: all fields valid for version 1 plus | +| | fields explicitly stated to be | +| | supported in version 2 are valid. | | | | | `flags` | 0 (LSB): Endianness: 0 = little, 1 = big | | | |
@@ -117,7 +123,17 @@ xenstored state that needs to be restored. | rw-socket-fd | +-------------------------------+ | evtchn-fd | ++---------------+---------------+ +| n-dom-quota | n-glob-quota | ++---------------+---------------+ +| quota-val 1 | ++-------------------------------+ +... +-------------------------------+ +| quota-val N | ++-------------------------------+ +| quota-names +... ```
@@ -128,6 +144,22 @@ xenstored state that needs to be restored. | | | | `evtchn-fd` | The file descriptor used to communicate with | | | the event channel driver | +| | | +| `n-dom-quota` | Number of quota values which apply per | +| | domain. Valid only for version 2 and later. | +| | | +| `n-glob-quota` | Number of quota values which apply globally | +| | only. Valid only for version 2 and later. | +| | | +| `quota-val` | Quota values, first the ones applying per | +| | domain, then the ones applying globally. A | +| | value of 0 has the semantics of "unlimited". | +| | Valid only for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Valid only for version 2 and later. | + xenstored will resume in the original process context. Hence `rw-socket-fd` simply specifies the file descriptor of the socket. Sockets are not always
@@ -145,7 +177,7 @@ the domain being migrated. ``` 0 1 2 3 4 5 6 7 octet +-------+-------+-------+-------+-------+-------+-------+-------+ -| conn-id | conn-type | | +| conn-id | conn-type | n-quota | +-------------------------------+---------------+---------------+ | conn-spec ...
@@ -154,6 +186,17 @@ the domain being migrated. +---------------+---------------+-------------------------------+ | data ... ++-------------------------------+ +| features | ++-------------------------------+ +| quota-val 1 | ++-------------------------------+ +... ++-------------------------------+ +| quota-val N | ++-------------------------------+ +| quota-names +... ```
@@ -167,6 +210,10 @@ the domain being migrated. | | 0x0001: socket | | | 0x0002 - 0xFFFF: reserved for future use | | | | +| `n-quota` | Number of quota values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | | `conn-spec` | See below | | | | | `in-data-len` | The length (in octets) of any data read |
@@ -182,6 +229,22 @@ the domain being migrated. | `data` | Pending data: first in-data-len octets of | | | read data, then out-data-len octets of | | | written data (any of both may be empty) | +| | | +| `features` | Value of the feature field visible by the | +| | guest at offset 2064 of the ring page. | +| | Aligned to the next 4 octet boundary. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | +| `quota-val` | Quota values, a value of 0 has the semantics | +| | "unlimited". | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | In case of live update the connection record for the connection via which the live update command was issued will contain the response for the live
@@ -247,7 +310,7 @@ by a connection for which there is `CONNECTION_DATA` record previously present. ``` 0 1 2 3 octet -+-------+-------+-------+-------+ ++---------------+---------------+ | conn-id | +---------------+---------------+ | wpath-len | token-len |
@@ -256,6 +319,9 @@ by a connection for which there is `CONNECTION_DATA` record previously present. ... | token ... ++---------------+---------------+ +| depth | | ++---------------+---------------+ ```
@@ -275,6 +341,13 @@ by a connection for which there is `CONNECTION_DATA` record previously present. | | | | `token` | The watch identifier token, as specified in the | | | `WATCH` operation | +| | | +| `depth` | The number of directory levels below the | +| | watched path to consider for a match. This | +| | field is aligned to the next 4 octet boundary. | +| | A value of 0xffff is used for unlimited depth. | +| | This field is valid only for version 2 and | +| | higher. | \pagebreak
@@ -406,6 +479,12 @@ A node permission specifier has the following format: Note that perm1 defines the domain owning the node. See [4] for more explanation of node permissions. +\pagebreak + +### DOMAIN_DATA + + + * * * [1] See https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/designs/non-cooperative-migration.md
Signature · 1 line
2.35.3
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Hi,
Quoted 21 lines · Juergen Gross
Extend the definition of the Xenstore migration stream to cover new features:
- per domain features
- extended watches (watch depth)
- per domain quotaSigned-off-by Juergen Gross <[email protected]>---
V3:
- new patch--- docs/designs/xenstore-migration.md | 85 ++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 3 deletions(-)docs/designs/xenstore-migration.md +0
-0@@ -43,7 +43,13 @@ the setting of the endianness bit. |-----------|---------------------------------------------------|
docs/designs/xenstore-migration.md the setting of the endianness bit. · line 52
Quoted 10 lines
docs/designs/xenstore-migration.md +7
-1| `ident` | 0x78656e73746f7265 ('xenstore' in ASCII) | | | | -| `version` | 0x00000001 (the version of the specification) | +| `version` | The version of the specification, defined values: | +| | 0x00000001: all fields without any explicitly | +| | mentioned version dependency are | +| | valid. | +| | 0x00000002: all fields valid for version 1 plus | +| | fields explicitly stated to be | +| | supported in version 2 are valid. |
I am a bit concerned with the bump of the versions. It means, it will be necessary for Xenstored to know whether the new Xenstored speaks v1 or v2. This is less an issue when Live-Migration (although there is a fleet management problem) but it will be one for Live-Update if we need to rollback.
So I am wondering if we can avoid to bump the version and use other means to detect the difference.
Quoted 22 lines
docs/designs/xenstore-migration.md +10
-0| | | | `flags` | 0 (LSB): Endianness: 0 = little, 1 = big | | | |@@ -117,7 +123,17 @@ xenstored state that needs to be restored. | rw-socket-fd | +-------------------------------+ | evtchn-fd | ++---------------+---------------+ +| n-dom-quota | n-glob-quota | ++---------------+---------------+ +| quota-val 1 | ++-------------------------------+ +... +-------------------------------+ +| quota-val N | ++-------------------------------+ +| quota-names +... ```
docs/designs/xenstore-migration.md xenstored state that needs to be restored. · line 150
Quoted 7 lines
docs/designs/xenstore-migration.md +4
-0@@ -128,6 +144,22 @@ xenstored state that needs to be restored. | | | | `evtchn-fd` | The file descriptor used to communicate with | | | the event channel driver | +| | | +| `n-dom-quota` | Number of quota values which apply per | +| | domain. Valid only for version 2 and later. | +| | |
I think we can avoid extending the structure here by creating a separate record for the quota.
With that, the new Xenstored don't need specific code to deal with rollback because, as AFAICT, unimplemented records are ignored by existing Xenstored.
docs/designs/xenstore-migration.md xenstored state that needs to be restored.
Quoted 10 lines
docs/designs/xenstore-migration.md +10
-0+| `n-glob-quota` | Number of quota values which apply globally | +| | only. Valid only for version 2 and later. | +| | | +| `quota-val` | Quota values, first the ones applying per | +| | domain, then the ones applying globally. A | +| | value of 0 has the semantics of "unlimited". | +| | Valid only for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | > +| | Valid only for version 2 and later. |
From my understanding, both version of Xenstored needs to agree on the quota names. So it means the name have to be defined as part of the spec. At which point, I think it would be better to use ID.
Also, can you clarify what would happen if the stream contains a quota not supported by the new Xenstored?
Quoted 43 lines
docs/designs/xenstore-migration.md +17
-1+ xenstored will resume in the original process context. Hence `rw-socket-fd` simply specifies the file descriptor of the socket. Sockets are not always@@ -145,7 +177,7 @@ the domain being migrated. ``` 0 1 2 3 4 5 6 7 octet +-------+-------+-------+-------+-------+-------+-------+-------+ -| conn-id | conn-type | | +| conn-id | conn-type | n-quota | +-------------------------------+---------------+---------------+ | conn-spec@@ -154,6 +186,17 @@ the domain being migrated. +---------------+---------------+-------------------------------+ | data ++-------------------------------+ +| features | ++-------------------------------+ +| quota-val 1 | ++-------------------------------+ +... ++-------------------------------+ +| quota-val N | ++-------------------------------+ +| quota-names +... ```@@ -167,6 +210,10 @@ the domain being migrated. | | 0x0001: socket | | | 0x0002 - 0xFFFF: reserved for future use | | | | +| `n-quota` | Number of quota values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | | `conn-spec` | See below | | | | | `in-data-len` | The length (in octets) of any data read |
docs/designs/xenstore-migration.md the domain being migrated. · line 236
Quoted 8 lines
docs/designs/xenstore-migration.md +5
-0@@ -182,6 +229,22 @@ the domain being migrated. | `data` | Pending data: first in-data-len octets of | | | read data, then out-data-len octets of | | | written data (any of both may be empty) | +| | | +| `features` | Value of the feature field visible by the | +| | guest at offset 2064 of the ring page. | +| | Aligned to the next 4 octet boundary. | +| | Only for `conn-type` 0 (shared ring). |
For the purpose of the stream, I would consider to make it available for the socket connection. This could potentially be used in the future to allow each application to have a different behavior when socket is used.
I can't make my mind yet if we can avoid bumping the version for this field. What would happen if we need to rollback?
docs/designs/xenstore-migration.md the domain being migrated. · line 242
Quoted 5 lines
docs/designs/xenstore-migration.md +5
-0+| | Only valid for version 2 and later. | > +| | | +| `quota-val` | Quota values, a value of 0 has the semantics | +| | "unlimited". | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |
I would suggest to be very obvious and say the value will override the value (if any)
docs/designs/xenstore-migration.md the domain being migrated. · line 247
Quoted 5 lines
docs/designs/xenstore-migration.md +5
-0+| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |
As for the "global" quotas, I would move the quotas in a separate record. In this case, this would also be useful to avoid having may dynamic length field within the same record.
Quoted 23 lines
docs/designs/xenstore-migration.md +4
-1In case of live update the connection record for the connection via which the live update command was issued will contain the response for the live@@ -247,7 +310,7 @@ by a connection for which there is `CONNECTION_DATA` record previously present. ``` 0 1 2 3 octet -+-------+-------+-------+-------+ ++---------------+---------------+ | conn-id | +---------------+---------------+ | wpath-len | token-len |@@ -256,6 +319,9 @@ by a connection for which there is `CONNECTION_DATA` record previously present. | token ++---------------+---------------+ +| depth | | ++---------------+---------------+ ```
docs/designs/xenstore-migration.md by a connection for which there is `CONNECTION_DATA` record previously present. · line 350
Quoted 10 lines
docs/designs/xenstore-migration.md +7
-0@@ -275,6 +341,13 @@ by a connection for which there is `CONNECTION_DATA` record previously present. | | | | `token` | The watch identifier token, as specified in the | | | `WATCH` operation | +| | | +| `depth` | The number of directory levels below the | +| | watched path to consider for a match. This | +| | field is aligned to the next 4 octet boundary. | +| | A value of 0xffff is used for unlimited depth. | +| | This field is valid only for version 2 and | +| | higher. |
If we are going to bump the stream version, then I think we should move the field before token/path.
docs/designs/xenstore-migration.md A node permission specifier has the following format: · line 487
Quoted 13 lines
docs/designs/xenstore-migration.md +6
-0\pagebreak@@ -406,6 +479,12 @@ A node permission specifier has the following format: Note that perm1 defines the domain owning the node. See [4] for more explanation of node permissions. +\pagebreak + +### DOMAIN_DATA + + +
What this section is for?
Cheers,
Quoted 3 lines
docs/designs/xenstore-migration.md +0
-0* * * [1] See https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/designs/non-cooperative-migration.md
Signature · 1 line
Julien Grall
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Quoted 37 lines · Julien Grall
Hi,
Quoted 23 lines · Juergen Gross
Extend the definition of the Xenstore migration stream to cover new features:
- per domain features
- extended watches (watch depth)
- per domain quotaSigned-off-by Juergen Gross <[email protected]>---
V3:
- new patch
---
docs/designs/xenstore-migration.md| 85 ++++++++++++++++++++++++++++--1 file changed, 82 insertions(+), 3 deletions(-)docs/designs/xenstore-migration.md +0
-0@@ -43,7 +43,13 @@ the setting of the endianness bit.|-----------|---------------------------------------------------| | `ident` | 0x78656e73746f7265 ('xenstore' in ASCII) | | | |Quoted 8 lines
-| `version` | 0x00000001 (the version of the specification) | +| `version` | The version of the specification, defined values: | +| | 0x00000001: all fields without any explicitly | +| | mentioned version dependency are | +| | valid. | +| | 0x00000002: all fields valid for version 1 plus | +| | fields explicitly stated to be | +| | supported in version 2 are valid. |I am a bit concerned with the bump of the versions. It means, it will be necessary for Xenstored to know whether the new Xenstored speaks v1 or v2. This is less an issue when Live-Migration (although there is a fleet management problem) but it will be one for Live-Update if we need to rollback.
Quoted 1 line
So I am wondering if we can avoid to bump the version and use other means to detect the difference.
In the end this is exactly what the version was meant to be used for.
I think it would make much more sense to think about the way to handle a bump of the version in a compatible way.
My idea was to add a xenstored command line parameter for limiting the migration stream version to be used to a specified version, causing new features probably to not be available, though.
I don't see how e.g. a rollback would be doable in case a domain already started to use a new feature like the third parameter when setting a watch. Even if we'd drop the depth information when rolling back a watch set afterwards with an additional depth added would be rejected by the older xenstored, which would be unexpected failure for the guest.
It might make sense to try to use the V1 stream when doing a live update, e.g. covering the case when the SET_FEATURE command was used for each active guest to limit the features to V1 compatible ones. A force parameter might be used to use the V1 stream even if guests are using V2 features, risking breakage of those guests.
Quoted 31 lines
Quoted 21 lines
| | | | `flags` | 0 (LSB): Endianness: 0 = little, 1 = big | | | |docs/designs/xenstore-migration.md +0
-0@@ -117,7 +123,17 @@ xenstored state that needs to be restored.| rw-socket-fd | +-------------------------------+ | evtchn-fd |++---------------+---------------+
+| n-dom-quota | n-glob-quota |
++---------------+---------------+
+| quota-val 1 |
++-------------------------------+
+...+-------------------------------+ +| quota-val N |++-------------------------------+
+| quota-names
+...
```docs/designs/xenstore-migration.md +0
-0@@ -128,6 +144,22 @@ xenstored state that needs to be restored.Quoted 7 lines
| | | | `evtchn-fd` | The file descriptor used to communicate with | | | the event channel driver | +| | | +| `n-dom-quota` | Number of quota values which apply per | +| | domain. Valid only for version 2 and later. | +| | |I think we can avoid extending the structure here by creating a separate record for the quota.
Quoted 1 line
With that, the new Xenstored don't need specific code to deal with rollback because, as AFAICT, unimplemented records are ignored by existing Xenstored.
For quota this would be possible regarding the functionality, but there are use cases which might suffer in case quota are not being accepted by the new instance (e.g. driver domains needing higher quota).
OTOH this is no guest visible interface, so I'm on the edge to add this data to V1. This would even be possible using the global record of V1, as the length information of the record allows to add new fields without having to bump the version.
Quoted 13 lines
Quoted 12 lines
+| `n-glob-quota` | Number of quota values which apply globally | +| | only. Valid only for version 2 and later. | +| | | +| `quota-val` | Quota values, first the ones applying per | +| | domain, then the ones applying globally. A | +| | value of 0 has the semantics of "unlimited". | +| | Valid only for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | > +| | Valid only for version 2 and later. |
Quoted 2 lines
From my understanding, both version of Xenstored needs to agree on the quota
names. So it means the name have to be defined as part of the spec. At which point, I think it would be better to use ID.
I don't think so. For one the minimal set of quota names has been defined already in patch 3. And even with using an ID you'd have the same problem again, but without having the possibility to add variant specific quota (remember that there already has been a statement that doing a live update from C to OCAML or vice versa would probably break users due to some deviations in behavior).
Quoted 1 line
Also, can you clarify what would happen if the stream contains a quota not supported by the new Xenstored?
Yes, I'll add a sentence that those should be ignored.
Quoted 43 lines
Quoted 43 lines
+
xenstored will resume in the original process context. Hencerw-socket-fdsimply specifies the file descriptor of the socket. Sockets are not alwaysdocs/designs/xenstore-migration.md +0
-0@@ -145,7 +177,7 @@ the domain being migrated.```
0 1 2 3 4 5 6 7 octet+-------+-------+-------+-------+-------+-------+-------+-------+ -| conn-id | conn-type | | +| conn-id | conn-type | n-quota | +-------------------------------+---------------+---------------+ | conn-spec...
docs/designs/xenstore-migration.md +0
-0@@ -154,6 +186,17 @@ the domain being migrated.+---------------+---------------+-------------------------------+ | data...
++-------------------------------+
+| features |
++-------------------------------+
+| quota-val 1 |
++-------------------------------+
+...
++-------------------------------+
+| quota-val N |
++-------------------------------+
+| quota-names
+...
```docs/designs/xenstore-migration.md +0
-0@@ -167,6 +210,10 @@ the domain being migrated.| | 0x0001: socket | | | 0x0002 - 0xFFFF: reserved for future use | | | | +| `n-quota` | Number of quota values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | | `conn-spec` | See below | | | | | `in-data-len` | The length (in octets) of any data read |docs/designs/xenstore-migration.md +0
-0@@ -182,6 +229,22 @@ the domain being migrated.| `data` | Pending data: first in-data-len octets of | | | read data, then out-data-len octets of |
Quoted 8 lines
Quoted 6 lines
| | written data (any of both may be empty) | +| | | +| `features` | Value of the feature field visible by the | +| | guest at offset 2064 of the ring page. | +| | Aligned to the next 4 octet boundary. | +| | Only for `conn-type` 0 (shared ring). |For the purpose of the stream, I would consider to make it available for the socket connection. This could potentially be used in the future to allow each application to have a different behavior when socket is used.
This would break the use of xenstore-stubdom for such a setup.
Quoted 1 line
I can't make my mind yet if we can avoid bumping the version for this field. What would happen if we need to rollback?
I think an active usage of the new features and a rollback are mutually exclusive. See above.
Quoted 9 lines
Quoted 7 lines
+| | Only valid for version 2 and later. | > +| | | +| `quota-val` | Quota values, a value of 0 has the semantics | +| | "unlimited". | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |I would suggest to be very obvious and say the value will override the value (if any)
Okay.
Quoted 8 lines
Quoted 6 lines
+| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |As for the "global" quotas, I would move the quotas in a separate record. In this case, this would also be useful to avoid having may dynamic length field within the same record.
I like having the data together more.
But I'm not really feeling strong about that.
Quoted 27 lines
Quoted 27 lines
In case of live update the connection record for the connection via which the live update command was issued will contain the response for the live
docs/designs/xenstore-migration.md +0
-0@@ -247,7 +310,7 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
```
0 1 2 3 octet
-+-------+-------+-------+-------+
++---------------+---------------+| conn-id | +---------------+---------------+ | wpath-len | token-len |docs/designs/xenstore-migration.md +0
-0@@ -256,6 +319,9 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
...
| token
...
++---------------+---------------+
+| depth | |
++---------------+---------------+
```docs/designs/xenstore-migration.md +0
-0@@ -275,6 +341,13 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
| | | | `token` | The watch identifier token, as specified in the | | | `WATCH` operation | +| | |
Quoted 8 lines
Quoted 6 lines
+| `depth` | The number of directory levels below the | +| | watched path to consider for a match. This | +| | field is aligned to the next 4 octet boundary. | +| | A value of 0xffff is used for unlimited depth. | +| | This field is valid only for version 2 and | +| | higher. |If we are going to bump the stream version, then I think we should move the field before token/path.
I thought about that, but liked it better to be able to keep a common struct layout for the record with the V2 fields being at the end.
Main reason is the ability to avoid duplication of code for being able to handle both versions.
Quoted 13 lines
docs/designs/xenstore-migration.md A node permission specifier has the following format: · line 487
Quoted 11 lines
\pagebreak
docs/designs/xenstore-migration.md +0
-0@@ -406,6 +479,12 @@ A node permission specifier has the following format:Note that perm1 defines the domain owning the node. See [4] for more explanation of node permissions.
+\pagebreakdocs/designs/xenstore-migration.md +5
-0+ +### DOMAIN_DATA + + +What this section is for?
Oh that is a stale result of a previous variant considering an own record type for quota and feature information. :-)
Juergen
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Hi Juergen,
Quoted 38 lines · Juergen Gross
Quoted 35 lines · Julien Grall
Quoted 23 lines · Juergen Gross
Extend the definition of the Xenstore migration stream to cover new features:
- per domain features
- extended watches (watch depth)
- per domain quotaSigned-off-by Juergen Gross <[email protected]>---
V3:
- new patch
---
docs/designs/xenstore-migration.md| 85 ++++++++++++++++++++++++++++--1 file changed, 82 insertions(+), 3 deletions(-)docs/designs/xenstore-migration.md +0
-0@@ -43,7 +43,13 @@ the setting of the endianness bit.|-----------|---------------------------------------------------| | `ident` | 0x78656e73746f7265 ('xenstore' in ASCII) | | | |Quoted 8 lines
-| `version` | 0x00000001 (the version of the specification) | +| `version` | The version of the specification, defined values: | +| | 0x00000001: all fields without any explicitly | +| | mentioned version dependency are | +| | valid. | +| | 0x00000002: all fields valid for version 1 plus | +| | fields explicitly stated to be | +| | supported in version 2 are valid. |I am a bit concerned with the bump of the versions. It means, it will be necessary for Xenstored to know whether the new Xenstored speaks v1 or v2. This is less an issue when Live-Migration (although there is a fleet management problem) but it will be one for Live-Update if we need to rollback.
Quoted 1 line
So I am wondering if we can avoid to bump the version and use other means to detect the difference.
Quoted 8 lines
In the end this is exactly what the version was meant to be used for.
I think it would make much more sense to think about the way to handle a bump of the version in a compatible way.
My idea was to add a xenstored command line parameter for limiting the migration stream version to be used to a specified version, causing new features probably to not be available, though.
I think this is fine. Someone that cares about rollback will also likely care about fleet diversity. So they will want to avoid enabling a feature until they know it can work everywhere.
Quoted 6 lines
I don't see how e.g. a rollback would be doable in case a domain already started to use a new feature like the third parameter when setting a watch. Even if we'd drop the depth information when rolling back a watch set afterwards with an additional depth added would be rejected by the older xenstored, which would be unexpected failure for the guest.
See above.
Quoted 6 lines
It might make sense to try to use the V1 stream when doing a live update, e.g. covering the case when the
SET_FEATUREcommand was used for each active guest to limit the features to V1 compatible ones. A force parameter might be used to use the V1 stream even if guests are using V2 features, risking breakage of those guests.
I don't have a strong opinion on this yet. I might have some when seen the code :).
[...]
Quoted 3 lines
This would even be possible using the global record of V1, as the length information of the record allows to add new fields without having to bump the version.
I was actually thinking about this when writing the e-mail last week. There are no dynamic length array in the global records so far, so using the length information would be ok. I am more concerned about the others because we are mixing fixed and dynamic length.
This means it is more difficult to read the code and the layout.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
+| `n-glob-quota` | Number of quota values which apply globally | +| | only. Valid only for version 2 and later. | +| | | +| `quota-val` | Quota values, first the ones applying per | +| | domain, then the ones applying globally. A | +| | value of 0 has the semantics of "unlimited". | +| | Valid only for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | > +| | Valid only for version 2 and later. |
Quoted 4 lines
Quoted 1 line
From my understanding, both version of Xenstored needs to agree on the quota names. So it means the name have to be defined as part of the spec. At which point, I think it would be better to use ID.
I don't think so. For one the minimal set of quota names has been defined already in patch 3.
Someone reading the migration stream will not necessarily read the Xenstore protocol. So I think we should either make them explicit in the documentation or have a link to the other document.
Quoted 2 lines
And even with using an ID you'd have the same problem
again, but without having the possibility to add variant specific quota
Fair enough.
Quoted 3 lines
(remember that there already has been a statement that doing a live update from C to OCAML or vice versa would probably break users due to some deviations in behavior)
I can't find such statement in public documentation. Do you have a link?
That said, a guest doesn't have a (easy?) way to know how Xenstored is implemented. So it is quite concerning to hear some of them may rely on behaviors. How did that happen?
Quoted 57 lines
Quoted 2 lines
Also, can you clarify what would happen if the stream contains a quota not supported by the new Xenstored?
Yes, I'll add a sentence that those should be ignored.
Quoted 43 lines
Quoted 43 lines
+
xenstored will resume in the original process context. Hencerw-socket-fdsimply specifies the file descriptor of the socket. Sockets are not alwaysdocs/designs/xenstore-migration.md +0
-0@@ -145,7 +177,7 @@ the domain being migrated.```
0 1 2 3 4 5 6 7 octet+-------+-------+-------+-------+-------+-------+-------+-------+ -| conn-id | conn-type | | +| conn-id | conn-type | n-quota | +-------------------------------+---------------+---------------+ | conn-spec...
docs/designs/xenstore-migration.md +0
-0@@ -154,6 +186,17 @@ the domain being migrated.+---------------+---------------+-------------------------------+ | data...
++-------------------------------+
+| features |
++-------------------------------+
+| quota-val 1 |
++-------------------------------+
+...
++-------------------------------+
+| quota-val N |
++-------------------------------+
+| quota-names
+...
```docs/designs/xenstore-migration.md +0
-0@@ -167,6 +210,10 @@ the domain being migrated.| | 0x0001: socket | | | 0x0002 - 0xFFFF: reserved for future use | | | | +| `n-quota` | Number of quota values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | | `conn-spec` | See below | | | | | `in-data-len` | The length (in octets) of any data read |docs/designs/xenstore-migration.md +0
-0@@ -182,6 +229,22 @@ the domain being migrated.| `data` | Pending data: first in-data-len octets of | | | read data, then out-data-len octets of |Quoted 8 lines
Quoted 6 lines
| | written data (any of both may be empty) | +| | | +| `features` | Value of the feature field visible by the | +| | guest at offset 2064 of the ring page. | +| | Aligned to the next 4 octet boundary. | +| | Only for `conn-type` 0 (shared ring). |For the purpose of the stream, I would consider to make it available for the socket connection. This could potentially be used in the future to allow each application to have a different behavior when socket is used.
Quoted 1 line
This would break the use of xenstore-stubdom for such a setup.
I am not sure why it would break the use of xenstore-stubdom. An application will already need to cope with the case Xenstored doesn't support a feature.
At which point, it would be easy to say "I don't want this feature" when using a socket.
Quoted 11 lines
Quoted 2 lines
I can't make my mind yet if we can avoid bumping the version for this field. What would happen if we need to rollback?
I think an active usage of the new features and a rollback are mutually exclusive. See above.
Quoted 6 lines
Quoted 5 lines
+| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |
Quoted 3 lines
Quoted 1 line
As for the "global" quotas, I would move the quotas in a separate record. In this case, this would also be useful to avoid having may dynamic length field within the same record.
I like having the data together more.
Which is fine so long the code doesn't become too horrible to read/maintain. I think having dynamic length array in the middle of the record makes it trickier.
This will only become worse as we introduce new fields in newer revision. So at which point would you say the record has grown too much?
To me, this is already the point and we have plenty of record ID to handle that.
Quoted 36 lines
Quoted 27 lines
Quoted 27 lines
In case of live update the connection record for the connection via which the live update command was issued will contain the response for the live
docs/designs/xenstore-migration.md +0
-0@@ -247,7 +310,7 @@ by a connection for which there is
CONNECTION_DATArecord previously present.
```
0 1 2 3 octet
-+-------+-------+-------+-------+
++---------------+---------------+| conn-id | +---------------+---------------+ | wpath-len | token-len |docs/designs/xenstore-migration.md +0
-0@@ -256,6 +319,9 @@ by a connection for which there is
CONNECTION_DATArecord previously present.
...
| token
...
++---------------+---------------+
+| depth | |
++---------------+---------------+
```docs/designs/xenstore-migration.md +0
-0@@ -275,6 +341,13 @@ by a connection for which there is
CONNECTION_DATArecord previously present.| | | | `token` | The watch identifier token, as specified in the | | | `WATCH` operation | +| | |Quoted 8 lines
Quoted 6 lines
+| `depth` | The number of directory levels below the | +| | watched path to consider for a match. This | +| | field is aligned to the next 4 octet boundary. | +| | A value of 0xffff is used for unlimited depth. | +| | This field is valid only for version 2 and | +| | higher. |If we are going to bump the stream version, then I think we should move the field before token/path.
Quoted 5 lines
I thought about that, but liked it better to be able to keep a common struct layout for the record with the V2 fields being at the end.
Main reason is the ability to avoid duplication of code for being able to handle both versions.
The cons is you can't easily describe the record in "struct ...". As I wrote above, I think have dynamic length array in the middle of a record is wrong.
I have looked at the code, I don't think there will be enough code duplication to warrant adding fixed field at the end of the record.
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Quoted 43 lines · Julien Grall
Hi Juergen,
Quoted 40 lines · Juergen Gross
Quoted 35 lines · Julien Grall
Quoted 23 lines · Juergen Gross
Extend the definition of the Xenstore migration stream to cover new features:
- per domain features
- extended watches (watch depth)
- per domain quotaSigned-off-by Juergen Gross <[email protected]>---
V3:
- new patch
---
docs/designs/xenstore-migration.md| 85 ++++++++++++++++++++++++++++--1 file changed, 82 insertions(+), 3 deletions(-)docs/designs/xenstore-migration.md +0
-0@@ -43,7 +43,13 @@ the setting of the endianness bit.|-----------|---------------------------------------------------| | `ident` | 0x78656e73746f7265 ('xenstore' in ASCII) | | | |Quoted 8 lines
-| `version` | 0x00000001 (the version of the specification) | +| `version` | The version of the specification, defined values: | +| | 0x00000001: all fields without any explicitly | +| | mentioned version dependency are | +| | valid. | +| | 0x00000002: all fields valid for version 1 plus | +| | fields explicitly stated to be | +| | supported in version 2 are valid. |I am a bit concerned with the bump of the versions. It means, it will be necessary for Xenstored to know whether the new Xenstored speaks v1 or v2. This is less an issue when Live-Migration (although there is a fleet management problem) but it will be one for Live-Update if we need to rollback.
Quoted 1 line
So I am wondering if we can avoid to bump the version and use other means to detect the difference.
In the end this is exactly what the version was meant to be used for.
Quoted 8 lines
Quoted 6 lines
I think it would make much more sense to think about the way to handle a bump of the version in a compatible way.
My idea was to add a xenstored command line parameter for limiting the migration stream version to be used to a specified version, causing new features probably to not be available, though.
I think this is fine. Someone that cares about rollback will also likely care about fleet diversity. So they will want to avoid enabling a feature until they know it can work everywhere.
That was the idea, yes.
Quoted 43 lines
Quoted 7 lines
I don't see how e.g. a rollback would be doable in case a domain already started to use a new feature like the third parameter when setting a watch. Even if we'd drop the depth information when rolling back a watch set afterwards with an additional depth added would be rejected by the older xenstored, which would be unexpected failure for the guest.
See above.
Quoted 6 lines
It might make sense to try to use the V1 stream when doing a live update, e.g. covering the case when the
SET_FEATUREcommand was used for each active guest to limit the features to V1 compatible ones. A force parameter might be used to use the V1 stream even if guests are using V2 features, risking breakage of those guests.I don't have a strong opinion on this yet. I might have some when seen the code :).
[...]
Quoted 3 lines
This would even be possible using the global record of V1, as the length information of the record allows to add new fields without having to bump the version.
I was actually thinking about this when writing the e-mail last week. There are no dynamic length array in the global records so far, so using the length information would be ok. I am more concerned about the others because we are mixing fixed and dynamic length.
This means it is more difficult to read the code and the layout.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
+| `n-glob-quota` | Number of quota values which apply globally | +| | only. Valid only for version 2 and later. | +| | | +| `quota-val` | Quota values, first the ones applying per | +| | domain, then the ones applying globally. A | +| | value of 0 has the semantics of "unlimited". | +| | Valid only for version 2 and later. | +| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | > +| | Valid only for version 2 and later. |
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
From my understanding, both version of Xenstored needs to agree on the quota names. So it means the name have to be defined as part of the spec. At which point, I think it would be better to use ID.
I don't think so. For one the minimal set of quota names has been defined already in patch 3.
Someone reading the migration stream will not necessarily read the Xenstore protocol. So I think we should either make them explicit in the documentation or have a link to the other document.
I'll add a link to the other doc.
Quoted 10 lines
Quoted 3 lines
And even with using an ID you'd have the same problem
again, but without having the possibility to add variant specific quotaFair enough.
Quoted 3 lines
(remember that there already has been a statement that doing a live update from C to OCAML or vice versa would probably break users due to some deviations in behavior)
I can't find such statement in public documentation. Do you have a link?
No, not really. IIRC this was a remark of Andrew back when we introduced LU of Xenstore. It might even have been at the time the discussion was only on the security ML.
Note that "users" doesn't need to imply guests, it might be related to dom0 side users, like e.g. XAPI.
Quoted 1 line
That said, a guest doesn't have a (easy?) way to know how Xenstored is implemented. So it is quite concerning to hear some of them may rely on behaviors. How did that happen?
Lack of communication between OCAML and C Xenstore maintainers back then?
Quoted 58 lines
Quoted 58 lines
Quoted 3 lines
Also, can you clarify what would happen if the stream contains a quota not supported by the new Xenstored?
Yes, I'll add a sentence that those should be ignored.
Quoted 51 lines
Quoted 41 lines
+
xenstored will resume in the original process context. Hencerw-socket-fdsimply specifies the file descriptor of the socket. Sockets are not alwaysdocs/designs/xenstore-migration.md +0
-0@@ -145,7 +177,7 @@ the domain being migrated.```
0 1 2 3 4 5 6 7 octet+-------+-------+-------+-------+-------+-------+-------+-------+ -| conn-id | conn-type | | +| conn-id | conn-type | n-quota | +-------------------------------+---------------+---------------+ | conn-spec...
docs/designs/xenstore-migration.md +0
-0@@ -154,6 +186,17 @@ the domain being migrated.+---------------+---------------+-------------------------------+ | data...
++-------------------------------+
+| features |
++-------------------------------+
+| quota-val 1 |
++-------------------------------+
+...
++-------------------------------+
+| quota-val N |
++-------------------------------+
+| quota-names
+...
```docs/designs/xenstore-migration.md +0
-0@@ -167,6 +210,10 @@ the domain being migrated.| | 0x0001: socket | | | 0x0002 - 0xFFFF: reserved for future use | | | | +| `n-quota` | Number of quota values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. | +| | | | `conn-spec` | See below | | | | | `in-data-len` | The length (in octets) of any data read |docs/designs/xenstore-migration.md +0
-0@@ -182,6 +229,22 @@ the domain being migrated.Quoted 8 lines
| `data` | Pending data: first in-data-len octets of | | | read data, then out-data-len octets of | | | written data (any of both may be empty) | +| | | +| `features` | Value of the feature field visible by the | +| | guest at offset 2064 of the ring page. | +| | Aligned to the next 4 octet boundary. | +| | Only for `conn-type` 0 (shared ring). |For the purpose of the stream, I would consider to make it available for the socket connection. This could potentially be used in the future to allow each application to have a different behavior when socket is used.
Quoted 3 lines
Quoted 1 line
This would break the use of xenstore-stubdom for such a setup.
I am not sure why it would break the use of xenstore-stubdom. An application will already need to cope with the case Xenstored doesn't support a feature.
Someone relying to be able to switch off a feature on a socket connection might get into trouble trying to do the same when running with xenstore-stubdom. Switching a feature off will either not work, or switch the feature off for all dom0 connections (which is a single one, of course).
Quoted 1 line
At which point, it would be easy to say "I don't want this feature" when using a socket.
I don't see the value of that. If you don't want a feature, just don't use it.
Quoted 14 lines
Quoted 14 lines
Quoted 3 lines
I can't make my mind yet if we can avoid bumping the version for this field. What would happen if we need to rollback?
I think an active usage of the new features and a rollback are mutually exclusive. See above.
Quoted 7 lines
Quoted 5 lines
+| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |As for the "global" quotas, I would move the quotas in a separate record. In this case, this would also be useful to avoid having may dynamic length field within the same record.
Quoted 7 lines
Quoted 1 line
I like having the data together more.
Which is fine so long the code doesn't become too horrible to read/maintain. I think having dynamic length array in the middle of the record makes it trickier.
This will only become worse as we introduce new fields in newer revision. So at which point would you say the record has grown too much?
To me, this is already the point and we have plenty of record ID to handle that.
Fair enough.
Other questions arising from that:
- Should we have different record types for global and per-domain quota?
- Should we split global quota into two record types (per-domain settable and global acting ones)?
- Combination of above (one record type for per-domain quota, usable for global default with "invalid domid", and one record type for the global acting ones like max. path-length)?
Quoted 37 lines
Quoted 37 lines
Quoted 36 lines
Quoted 24 lines
In case of live update the connection record for the connection via which the live update command was issued will contain the response for the live
docs/designs/xenstore-migration.md +0
-0@@ -247,7 +310,7 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
```
0 1 2 3 octet
-+-------+-------+-------+-------+
++---------------+---------------+| conn-id | +---------------+---------------+ | wpath-len | token-len |docs/designs/xenstore-migration.md +0
-0@@ -256,6 +319,9 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
...
| token
...
++---------------+---------------+
+| depth | |
++---------------+---------------+
```docs/designs/xenstore-migration.md +0
-0@@ -275,6 +341,13 @@ by a connection for which there is `CONNECTION_DATA`record previously present.
Quoted 10 lines
| | | | `token` | The watch identifier token, as specified in the | | | `WATCH` operation | +| | | +| `depth` | The number of directory levels below the | +| | watched path to consider for a match. This | +| | field is aligned to the next 4 octet boundary. | +| | A value of 0xffff is used for unlimited depth. | +| | This field is valid only for version 2 and | +| | higher. |If we are going to bump the stream version, then I think we should move the field before token/path.
Quoted 7 lines
Quoted 5 lines
I thought about that, but liked it better to be able to keep a common struct layout for the record with the V2 fields being at the end.
Main reason is the ability to avoid duplication of code for being able to handle both versions.
The cons is you can't easily describe the record in "struct ...". As I wrote above, I think have dynamic length array in the middle of a record is wrong.
You've got a point here.
Quoted 1 line
I have looked at the code, I don't think there will be enough code duplication to warrant adding fixed field at the end of the record.
Okay, lets go with a new record type then.
Should that always be used, or only if the depth information has been specified (IOW: is the old watch record format invalid in V2)?
Juergen
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Hi Juergen,
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Julien Grall
Quoted 1 line
This would break the use of xenstore-stubdom for such a setup.
I am not sure why it would break the use of xenstore-stubdom. An application will already need to cope with the case Xenstored doesn't support a feature.
Someone relying to be able to switch off a feature on a socket connection might get into trouble trying to do the same when running with xenstore-stubdom.
This is not very different from an application that was built against an old Xenstored and would not be capable to talk properly with the new Xenstored if the feature is enabled. I understand that...
Quoted 2 lines
Switching a feature off will either not work, or switch the feature off for all dom0 connections (which is a single one, of course).
... when using xenstore-stubdom xenstored it means that the feature will have to be disable for all dom0 connections.
However, it seems unlikely to me that someone will switch to a xenstore-stubdom on a whim because there are also scalability concerns (one ring to rule all connections). So I think it would be fair to say that your application may need to be tweak if you are not using the same feature as the system.
Quoted 4 lines
Quoted 2 lines
At which point, it would be easy to say "I don't want this feature" when using a socket.
I don't see the value of that. If you don't want a feature, just don't use it.
This is not that simple. Your assumption is the feature will not change the behavior exposed to the application.
I don't think we have such feature today but I don't see what prevents us to do that.
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 1 line
I can't make my mind yet if we can avoid bumping the version for this field. What would happen if we need to rollback?
I think an active usage of the new features and a rollback are mutually exclusive. See above.
Quoted 6 lines
Quoted 5 lines
+| | | +| `quota-names` | 0 delimited strings of the quota names in | +| | the same sequence as the `quota-val` values. | +| | Only for `conn-type` 0 (shared ring). | +| | Only valid for version 2 and later. |Quoted 3 lines
Quoted 1 line
As for the "global" quotas, I would move the quotas in a separate record. In this case, this would also be useful to avoid having may dynamic length field within the same record.
I like having the data together more.
Which is fine so long the code doesn't become too horrible to read/maintain. I think having dynamic length array in the middle of the record makes it trickier.
This will only become worse as we introduce new fields in newer revision. So at which point would you say the record has grown too much?
Quoted 7 lines
Quoted 1 line
To me, this is already the point and we have plenty of record ID to handle that.
Fair enough.
Other questions arising from that:
- Should we have different record types for global and per-domain quota?
Given the question below, I guess you mean per-domain quotas that are not the default ones. If yes, then they should be split.
Quoted 3 lines
- Should we split global quota into two record types (per-domain settable and global acting ones)?
I don't have a strong opinion on this.
Quoted 4 lines
- Combination of above (one record type for per-domain quota, usable for global default with "invalid domid", and one record type for the global acting ones like max. path-length)?
[...]
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
I thought about that, but liked it better to be able to keep a common struct layout for the record with the V2 fields being at the end.
Main reason is the ability to avoid duplication of code for being able to handle both versions.
The cons is you can't easily describe the record in "struct ...". As I wrote above, I think have dynamic length array in the middle of a record is wrong.
Quoted 8 lines
You've got a point here.
Quoted 1 line
I have looked at the code, I don't think there will be enough code duplication to warrant adding fixed field at the end of the record.
Okay, lets go with a new record type then.
Should that always be used, or only if the depth information has been specified (IOW: is the old watch record format invalid in V2)?
I don't have a strong opinion.
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Quoted 11 lines · Julien Grall
Hi Juergen,
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Julien Grall
Quoted 1 line
This would break the use of xenstore-stubdom for such a setup.
I am not sure why it would break the use of xenstore-stubdom. An application will already need to cope with the case Xenstored doesn't support a feature.
Someone relying to be able to switch off a feature on a socket connection might get into trouble trying to do the same when running with xenstore-stubdom.
Quoted 6 lines
This is not very different from an application that was built against an old Xenstored and would not be capable to talk properly with the new Xenstored if the feature is enabled. I understand that...
Quoted 2 lines
Switching a feature off will either not work, or switch the feature off for all dom0 connections (which is a single one, of course).
... when using xenstore-stubdom xenstored it means that the feature will have to be disable for all dom0 connections.
Wait, I don't think we can ever add features which will change the behavior of Xenstore when those new features aren't being used actively. The new features should always be on top of the existing functionality.
Quoted 1 line
However, it seems unlikely to me that someone will switch to a xenstore-stubdom on a whim because there are also scalability concerns (one ring to rule all connections). So I think it would be fair to say that your application may need to be tweak if you are not using the same feature as the system.
No, this should never be the case IMO. See above.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
At which point, it would be easy to say "I don't want this feature" when using a socket.
I don't see the value of that. If you don't want a feature, just don't use it.
This is not that simple. Your assumption is the feature will not change the behavior exposed to the application.
Correct.
Quoted 2 lines
I don't think we have such feature today but I don't see what prevents us to do that.
Compatibility prevents us doing that.
If we want different behavior, we need to use different or extended commands (e.g. like the additional "depth" parameter of SET_WATCH).
Juergen
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
Hi Juergen,
Quoted 14 lines · Juergen Gross
Quoted 13 lines · Julien Grall
Hi Juergen,
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Julien Grall
Quoted 1 line
This would break the use of xenstore-stubdom for such a setup.
I am not sure why it would break the use of xenstore-stubdom. An application will already need to cope with the case Xenstored doesn't support a feature.
Someone relying to be able to switch off a feature on a socket connection might get into trouble trying to do the same when running with xenstore-stubdom.
This is not very different from an application that was built against an old Xenstored and would not be capable to talk properly with the new Xenstored if the feature is enabled. I understand that...
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Switching a feature off will either not work, or switch the feature off for all dom0 connections (which is a single one, of course).
... when using xenstore-stubdom xenstored it means that the feature will have to be disable for all dom0 connections.
Wait, I don't think we can ever add features which will change the behavior of Xenstore when those new features aren't being used actively.
That would be fine if you know that your client can support it. Reading the rest of the e-mail, AFAIU your aim is to use SET_FEATURES to indicate which features is supported by Xenstored. This may or may not be supported by the client.
When I replied, I had a different idea in mind for SET_FEATURES. But I think it wouldn't work in a generic setup because an handshake would be necessary (the client would need to advertise the features it supports).
Anyway, now I understand your point and agree with you the we want to only have the field 'features' for ring connection.
Thanks for the clarification!
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 5/5] tools/xenstore: add migration stream extensions for new features
In reply to Juergen GrossHi Juergen,
Quoted 8 lines · Juergen Gross
Quoted 8 lines
Quoted 2 lines
And even with using an ID you'd have the same problem
again, but without having the possibility to add variant specific quotaFair enough.
Quoted 3 lines
(remember that there already has been a statement that doing a live update from C to OCAML or vice versa would probably break users due to some deviations in behavior)
Quoted 8 lines
Quoted 1 line
I can't find such statement in public documentation. Do you have a link?
No, not really. IIRC this was a remark of Andrew back when we introduced LU of Xenstore. It might even have been at the time the discussion was only on the security ML.
Note that "users" doesn't need to imply guests, it might be related to dom0 side users, like e.g. XAPI.
I understand that "users" doesn't imply guests. Hovewer, it is still not quite clear to me what sort of behavior the application could rely on here. Is it related to the transaction?
Anyway, I think it would be good to document such behaviors because they don't seem to be obvious.
Cheers,
Signature · 1 line
Julien Grall