]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
libxc: panic when trying to create a PVH guest without kernel support
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 6 Oct 2017 13:51:59 +0000 (14:51 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 9 Oct 2017 14:43:35 +0000 (15:43 +0100)
Previously when trying to boot a PV capable but not PVH capable kernel
inside of a PVH container xc_dom_guest_type would succeed and return a
PV guest type, which would lead to failures later on in the build
process.

Instead provide a clear error message when trying to create a PVH
guest using a kernel that doesn't support PVH.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_dom_elfloader.c

index 62d421a5e36b42c6f1103a44e892c9b0a8d2dd11..568d7f370c846ca980451e3f64f225b6226bf569 100644 (file)
@@ -59,6 +59,13 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     if ( dom->container_type == XC_DOM_HVM_CONTAINER &&
          dom->parms.phys_entry != UNSET_ADDR32 )
         return "hvm-3.0-x86_32";
+    if ( dom->container_type == XC_DOM_HVM_CONTAINER )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "%s: image not capable of booting inside a HVM container",
+                     __FUNCTION__);
+        return "xen-3.0-unknown";
+    }
 
     switch ( machine )
     {