libxl: fix assertion failure in stub domain creation
PATCH v2 1/1 libxl: fix assertion failure in stub domain creation
An assertion in libxl__domain_make():
'soft_reset || *domid == INVALID_DOMID'
does not hold true for stub domain creation, where soft_reset is false but the passed in domid == 0. This is easily fixed by changing the initializer in libxl__spawn_stub_dm().
NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to
reflect reality.
---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Roger Pau Monné <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
An example of the assertion failure can be seen at:
--- tools/libxl/libxl_dm.c | 2 +- xen/include/public/domctl.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +1 -1
@@ -2127,7 +2127,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss) goto out; } - sdss->pvqemu.guest_domid =0 ; + sdss->pvqemu.guest_domid =INVALID_DOMID ;libxl_domain_create_info_init (&dm_config->c_info); dm_config->c_info.type =LIBXL_DOMAIN_TYPE_PV ;
xen/include/public/domctl.h +2 -1
@@ -42,7 +42,8 @@/* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. -* If it is specified as zero, an id is auto-allocated and returned. +* If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED), +* an id is auto-allocated and returned. */ /* XEN_DOMCTL_createdomain */ struct xen_domctl_createdomain {
Signature · 7 lines
2.20.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · Paul Durrant
An assertion in
libxl__domain_make():'
soft_reset|| *domid ==INVALID_DOMID'does not hold true for stub domain creation, where
soft_resetis false but the passed in domid == 0. This is easily fixed by changing the initializer inlibxl__spawn_stub_dm().
Quoted 5 lines
NOTE: The comment for
XEN_DOMCTL_createdomainindomctl.his changed to
reflect reality.Fixes 75259239d85d ("libxl_create: make 'soft reset' explicit")Signed-off-by Paul Durrant <[email protected]>
I will wait until end of today in case others want to comment on the domctl.h change.
I will also carry over Anthony's ack from v1 while committing.
Wei.
Quoted 50 lines
---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Roger Pau Monné <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>An example of the assertion failure can be seen at:
--- tools/libxl/libxl_dm.c | 2 +- xen/include/public/domctl.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)tools/libxl/libxl_dm.c +1
-1@@ -2127,7 +2127,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss) goto out; } - sdss->pvqemu.guest_domid =0 ; + sdss->pvqemu.guest_domid =INVALID_DOMID ;libxl_domain_create_info_init (&dm_config->c_info); dm_config->c_info.type =LIBXL_DOMAIN_TYPE_PV ;xen/include/public/domctl.h +2
-1@@ -42,7 +42,8 @@/* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. -* If it is specified as zero, an id is auto-allocated and returned. +* If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED), +* an id is auto-allocated and returned. */ /* XEN_DOMCTL_createdomain */ struct xen_domctl_createdomain {Signature · 1 line
2.20.1
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
xen/include/public/domctl.h line 49
Quoted 12 lines · Paul Durrant
xen/include/public/domctl.h +2
-1@@ -42,7 +42,8 @@/* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. -* If it is specified as zero, an id is auto-allocated and returned. +* If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED), +* an id is auto-allocated and returned. */ /* XEN_DOMCTL_createdomain */ struct xen_domctl_createdomain {
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 2 lines · Paul Durrant
NOTE: The comment for
XEN_DOMCTL_createdomainindomctl.his changed to
reflect reality.
Surely, this change deserve to be in its own patch, isn't it?
Signature · 6 lines
Anthony PERARD _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Anthony PERARD
Quoted 2 lines · Paul Durrant
NOTE: The comment for
XEN_DOMCTL_createdomainindomctl.his changed to
reflect reality.Surely, this change deserve to be in its own patch, isn't it?
Ideally I would want that too. But this patch is trivial so I'm not too fussed either way.
Wei.
Quoted 3 lines
Signature · 2 lines
-- Anthony PERARD
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel