diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-01-26 17:25:11 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-01-26 17:25:11 +0000 |
commit | 39c36a0573d9307d68c0c3336b48e6351ffabc06 (patch) | |
tree | e17594e5f0fbd715a59e04de90066bcddfe361a4 /hw/xenpv | |
parent | ba3fb2f023254ab853df278e1719fc55938e1c16 (diff) | |
parent | 64a7ad6fe3d8500119d83e0af830e0e45e83499a (diff) |
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160126-2' into staging
Xen 2016/01/26 with Signed-off-by lines.
# gpg: Signature made Tue 26 Jan 2016 17:20:12 GMT using RSA key ID 70E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
* remotes/sstabellini/tags/xen-20160126-2:
xen: make it possible to build without the Xen PV domain builder
xen: domainbuild: reopen libxenctrl interface after forking for domain watcher.
xen: Use stable library interfaces when they are available.
xen: Switch uses of xc_map_foreign_{pages,bulk} to use libxenforeignmemory API.
xen: Switch uses of xc_map_foreign_range into xc_map_foreign_pages
xen: Switch to libxengnttab interface for compat shims.
xen: Switch to libxenevtchn interface for compat shims.
xen_console: correctly cleanup primary console on teardown.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/xenpv')
-rw-r--r-- | hw/xenpv/Makefile.objs | 4 | ||||
-rw-r--r-- | hw/xenpv/xen_domainbuild.c | 9 | ||||
-rw-r--r-- | hw/xenpv/xen_machine_pv.c | 15 |
3 files changed, 20 insertions, 8 deletions
diff --git a/hw/xenpv/Makefile.objs b/hw/xenpv/Makefile.objs index 49f6e9e3c5..bbf5873fd1 100644 --- a/hw/xenpv/Makefile.objs +++ b/hw/xenpv/Makefile.objs @@ -1,2 +1,4 @@ # Xen PV machine support -obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o +obj-$(CONFIG_XEN) += xen_machine_pv.o +# Xen PV machine builder support +obj-$(CONFIG_XEN_PV_DOMAIN_BUILD) += xen_domainbuild.o diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index ac0e5ac9f0..f9be029b0e 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -174,12 +174,15 @@ static int xen_domain_watcher(void) for (i = 3; i < n; i++) { if (i == fd[0]) continue; - if (i == xc_fd(xen_xc)) { - continue; - } close(i); } + /* + * Reopen xc interface, since the original is unsafe after fork + * and was closed above. + */ + xen_xc = xc_interface_open(0, 0, 0); + /* ignore term signals */ signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 23d6ef07ea..3250b94900 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -30,9 +30,6 @@ static void xen_init_pv(MachineState *machine) { - const char *kernel_filename = machine->kernel_filename; - const char *kernel_cmdline = machine->kernel_cmdline; - const char *initrd_filename = machine->initrd_filename; DriveInfo *dinfo; int i; @@ -46,17 +43,27 @@ static void xen_init_pv(MachineState *machine) case XEN_ATTACH: /* nothing to do, xend handles everything */ break; - case XEN_CREATE: +#ifdef CONFIG_XEN_PV_DOMAIN_BUILD + case XEN_CREATE: { + const char *kernel_filename = machine->kernel_filename; + const char *kernel_cmdline = machine->kernel_cmdline; + const char *initrd_filename = machine->initrd_filename; if (xen_domain_build_pv(kernel_filename, initrd_filename, kernel_cmdline) < 0) { fprintf(stderr, "xen pv domain creation failed\n"); exit(1); } break; + } +#endif case XEN_EMULATE: fprintf(stderr, "xen emulation not implemented (yet)\n"); exit(1); break; + default: + fprintf(stderr, "unhandled xen_mode %d\n", xen_mode); + exit(1); + break; } xen_be_register("console", &xen_console_ops); |