[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: check HVM direct boot parameters



commit 0e560dfc48e7df189742525dd12a1ef691188a3b
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Mon Jan 19 16:13:59 2015 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Jan 19 17:21:27 2015 +0000

    libxl: check HVM direct boot parameters
    
    We should honour -initrd and -append iff -kernel is specified, because
    that's how QEMU works.
    
    Check direct boot parameters in libxl__domain_build_info_setdefault.
    Return failure if kernel is missing while ramdisk (-initrd) and / or
    cmdline (-append) is present.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Cc: Chunyan Liu <cyliu@xxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_create.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 6f87d1c..98687bd 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -170,6 +170,14 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             break;
         default:abort();
         }
+
+        /* Check HVM direct boot parameters, we should honour ->ramdisk and
+         * ->cmdline iff ->kernel is set.
+         */
+        if (!b_info->kernel && (b_info->ramdisk || b_info->cmdline)) {
+            LOG(ERROR, "direct boot parameters specified but kernel missing");
+            return ERROR_INVAL;
+        }
     }
 
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.