All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libxl: check HVM direct boot parameters
@ 2015-01-19 16:13 Wei Liu
  2015-01-19 17:41 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Liu @ 2015-01-19 16:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Chunyan Liu, Ian Jackson, Wei Liu, Ian Campbell, Stefano Stabellini

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@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: use LOG and fix formatting
---
 tools/libxl/libxl_create.c |    8 ++++++++
 1 file changed, 8 insertions(+)

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 &&
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] libxl: check HVM direct boot parameters
  2015-01-19 16:13 [PATCH v2] libxl: check HVM direct boot parameters Wei Liu
@ 2015-01-19 17:41 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-01-19 17:41 UTC (permalink / raw)
  To: Wei Liu; +Cc: Stefano Stabellini, Ian Jackson, Chunyan Liu, xen-devel

On Mon, 2015-01-19 at 16:13 +0000, Wei Liu wrote:
> 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@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Chunyan Liu <cyliu@suse.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

and applied, thanks for the fast turnaround!

Ian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-19 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 16:13 [PATCH v2] libxl: check HVM direct boot parameters Wei Liu
2015-01-19 17:41 ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.