Skip to contentSkip to conversation

xl/libxl: fixes for the grant-table changes

PATCH In review Roger Pau Monne 2 participants 4 messages Oct 9, 2017

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 libxl: set the default grant/maptrack frames at structure init

In reply to Roger Pau Monne

libxl_domain_build_info had both the maptrack and grant frames set to 0 by default, forcing the client of libxl to set a sane default.

This is not backwards compatible, so instead initialize both max_grant_frames and max_maptrack_frames to a sane default (ie: like previous behavior).

This fixes the libvirt tests in osstest.

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Juergen Gross <[email protected]>

---
 tools/libxl/libxl.h         | 3 +++
 tools/libxl/libxl_types.idl | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
tools/libxl/libxl.h +3 -0
index e5ef920743..f82b91e0c1 100644
@@ -322,6 +322,9 @@
  */
 #define LIBXL_HAVE_BUILDINFO_GRANT_LIMITS 1
 
+#define LIBXL_MAX_GRANT_FRAMES_DEFAULT 32
+#define LIBXL_MAX_MAPTRACK_FRAMES_DEFAULT 1024
+
 /*
  * LIBXL_HAVE_BUILDINFO_* indicates that libxl_domain_build_info has
  * the field represented by the '*'. The original position of those
tools/libxl/libxl_types.idl +2 -2
index ade359e387..2d0bb8a222 100644
@@ -480,8 +480,8 @@ libxl_domain_build_info = Struct("domain_build_info",[
 
     ("vnuma_nodes", Array(libxl_vnode_info, "num_vnuma_nodes")),
 
-    ("max_grant_frames",    uint32),
-    ("max_maptrack_frames", uint32),
+    ("max_grant_frames",    uint32, {'init_val': 'LIBXL_MAX_GRANT_FRAMES_DEFAULT'}),
+    ("max_maptrack_frames", uint32, {'init_val': 'LIBXL_MAX_MAPTRACK_FRAMES_DEFAULT'}),
     
     ("device_model_version", libxl_device_model_version),
     ("device_model_stubdomain", libxl_defbool),
Signature · 7 lines
2.13.5 (Apple Git-94)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw

PATCH 2/2 xl: set default maptrack frames to 1024

In reply to Roger Pau Monne

This is in line with the previous behavior, setting the number of maptrack frames to 0 will prevent driver domains from working correctly.

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Juergen Gross <[email protected]>

---
 docs/man/xl.conf.pod.5 | 2 +-
 tools/xl/xl.c          | 2 +-
 tools/xl/xl_parse.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
docs/man/xl.conf.pod.5 +1 -1
index fe2cf27ea4..da91b8626c 100644
@@ -87,7 +87,7 @@ Default: C<32> on hosts up to 16TB of memory, C<64> on hosts larger than 16TB
 
 Sets the default value for the C<max_maptrack_frames> domain config value.
 
-Default: C<0>
+Default: C<1024>
 
 =item B<vif.default.script="PATH">
 
tools/xl/xl.c +1 -1
index c1bbb4b939..179908b4f6 100644
@@ -46,7 +46,7 @@ enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 int claim_mode = 1;
 bool progress_use_cr = 0;
 int max_grant_frames = -1;
-int max_maptrack_frames = 0;
+int max_maptrack_frames = -1;
 
 xentoollog_level minmsglevel = minmsglevel_default;
 
tools/xl/xl_parse.c +1 -1
index d0106f4830..084e49adee 100644
@@ -1041,7 +1041,7 @@ void parse_config_data(const char *config_source,
         b_info->max_grant_frames = max_grant_frames;
     if (!xlu_cfg_get_long (config, "max_maptrack_frames", &l, 0))
         b_info->max_maptrack_frames = l;
-    else
+    else if (max_maptrack_frames != -1)
         b_info->max_maptrack_frames = max_maptrack_frames;
 
     libxl_defbool_set(&b_info->claim_mode, claim_mode);
Signature · 7 lines
2.13.5 (Apple Git-94)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#0 lore raw

cover xl/libxl: fixes for the grant-table changes

The recent grant-table commits have changed the behavior of xl/libxl, and are currently causing regressions in the osstest tests.

The following two commits attempt to restore previous behavior by setting a sane default number of grant/maptrack frames.

Note that only the first patch should be needed in order to fix the libvirt tests, and thus unblock the push gate. The second patch should fix driver domains (although there's no tests for them ATM in osstest).

Thanks, Roger.

Roger Pau Monne (2):
libxl: set the default grant/maptrack frames at structure init
xl: set default maptrack frames to 1024

 docs/man/xl.conf.pod.5      | 2 +-
 tools/libxl/libxl.h         | 3 +++
 tools/libxl/libxl_types.idl | 4 ++--
 tools/xl/xl.c               | 2 +-
 tools/xl/xl_parse.c         | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)
Signature · 7 lines
2.13.5 (Apple Git-94)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] libxl: set the default grant/maptrack frames at structure init

In reply to Roger Pau Monne

Roger Pau Monne writes ("[PATCH 1/2] libxl: set the default grant/maptrack frames at structure init"):

Quoted 6 lines

libxl_domain_build_info had both the maptrack and grant frames set to 0 by default, forcing the client of libxl to set a sane default.

This is not backwards compatible, so instead initialize both max_grant_frames and max_maptrack_frames to a sane default (ie: like previous behavior).

Both

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel