]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
tests/resource: Fix HVM guest in !SHADOW builds
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 29 Feb 2024 20:46:13 +0000 (20:46 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Mar 2024 20:14:19 +0000 (20:14 +0000)
commit0263dc9069ddb66335c72a159e09050b1600e56a
tree1934317ac029a85980d8e766a14ed43c055a751b
parente2d8a652251660c3252d92b442e1a9c5d6e6a1e9
tests/resource: Fix HVM guest in !SHADOW builds

Right now, test-resource always creates HVM Shadow guests.  But if Xen has
SHADOW compiled out, running the test yields:

  $./test-resource
  XENMEM_acquire_resource tests
  Test x86 PV
    Created d1
    Test grant table
  Test x86 PVH
    Skip: 95 - Operation not supported

and doesn't really test HVM guests, but doesn't fail either.

There's nothing paging-mode-specific about this test, so default to HAP if
possible and provide a more specific message if neither HAP or Shadow are
available.

As we've got physinfo to hand, also provide more specific message about the
absence of PV or HVM support.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
tools/tests/resource/test-resource.c