From: James Bielman Subject: [PATCH] init-xenstore-domain: Add optional ramdisk argument. Date: Mon, 7 Jul 2014 14:52:24 -0700 Message-ID: <1404769944-4733-1-git-send-email-jamesjb@galois.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X4Gq5-0005Nw-Gz for xen-devel@lists.xenproject.org; Mon, 07 Jul 2014 21:52:45 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: James Bielman , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org - Added an optional argument to allow passing a ramdisk to the Xenstore domain built by init-xenstore-domain. - This is needed for Xenstore/MAC to pass initial security policy. Signed-off-by: James Bielman --- tools/xenstore/init-xenstore-domain.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c index 56a3c72..0d12169 100644 --- a/tools/xenstore/init-xenstore-domain.c +++ b/tools/xenstore/init-xenstore-domain.c @@ -13,7 +13,7 @@ static uint32_t domid = -1; -static int build(xc_interface *xch, char** argv) +static int build(xc_interface *xch, int argc, char** argv) { char cmdline[512]; uint32_t ssid; @@ -44,6 +44,12 @@ static int build(xc_interface *xch, char** argv) dom = xc_dom_allocate(xch, cmdline, NULL); rv = xc_dom_kernel_file(dom, argv[1]); if (rv) goto err; + + if (argc > 4) { + rv = xc_dom_ramdisk_file(dom, argv[4]); + if (rv) goto err; + } + rv = xc_dom_boot_xen_init(dom, xch, domid); if (rv) goto err; rv = xc_dom_parse_image(dom); @@ -81,15 +87,15 @@ int main(int argc, char** argv) char buf[16]; int rv, fd; - if (argc != 4) { - printf("Use: %s \n", argv[0]); + if (argc < 4 || argc > 5) { + printf("Use: %s []\n", argv[0]); return 2; } xch = xc_interface_open(NULL, NULL, 0); if (!xch) return 1; - rv = build(xch, argv); + rv = build(xch, argc, argv); xc_interface_close(xch); -- 1.9.1