[xen master] libxc: panic when trying to create a PVH guest without kernel support

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] libxc: panic when trying to create a PVH guest without kernel support

patchbot
commit 96edb111dde9ad7698a6fc2eaf2e49db507b0ed4
Author:     Roger Pau Monne <[hidden email]>
AuthorDate: Fri Oct 6 14:51:59 2017 +0100
Commit:     Ian Jackson <[hidden email]>
CommitDate: Mon Oct 9 15:43:35 2017 +0100

    libxc: panic when trying to create a PVH guest without kernel support
   
    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é <[hidden email]>
    Acked-by: Ian Jackson <[hidden email]>
---
 tools/libxc/xc_dom_elfloader.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 62d421a..568d7f3 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -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 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog