Set the grant table version for the created domains to use version 1,
as such tests domains don't require the usage of the grant table at
all. A TODO note is added to switch those dummy domains to not have a
grant table at all when possible. Without setting the grant version
the domains for the tests cannot be created.

Fixes: 7379f9e10a ('gnttab: allow setting max version per-domain')
Reported-by: Andrew Cooper <andrew.coop...@citrix.com>
Reported-by: Jan Beulich <jbeul...@suse.com>
Signed-off-by: Roger Pau Monné <roger....@citrix.com>
---
Cc: Ian Jackson <i...@xenproject.org>

This patch only modifies a test, so it should be safe to commit as
it's not going to cause any changes to the hypervisor or the tools.
Worse that could happen is it makes the test even more broken, but
it's already unusable.
---
 tools/tests/tsx/test-tsx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/tests/tsx/test-tsx.c b/tools/tests/tsx/test-tsx.c
index fab99c135e..f1dcff4c30 100644
--- a/tools/tests/tsx/test-tsx.c
+++ b/tools/tests/tsx/test-tsx.c
@@ -444,6 +444,8 @@ static void test_guests(void)
         struct xen_domctl_createdomain c = {
             .max_vcpus = 1,
             .max_grant_frames = 1,
+            /* TODO: switch to 0 once support for no grant table is added. */
+            .grant_opts = XEN_DOMCTL_GRANT_version(1),
         };
 
         printf("Testing PV guest\n");
@@ -456,6 +458,8 @@ static void test_guests(void)
             .flags = XEN_DOMCTL_CDF_hvm,
             .max_vcpus = 1,
             .max_grant_frames = 1,
+            /* TODO: switch to 0 once support for no grant table is added. */
+            .grant_opts = XEN_DOMCTL_GRANT_version(1),
             .arch = {
                 .emulation_flags = XEN_X86_EMU_LAPIC,
             },
-- 
2.33.0


Reply via email to