[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [QEMU][RFC V2 02/10] xen: modify QEMU status path in XenSto
From: |
Julien Grall |
Subject: |
[Qemu-devel] [QEMU][RFC V2 02/10] xen: modify QEMU status path in XenStore |
Date: |
Wed, 22 Aug 2012 13:30:15 +0100 |
QEMU will now write its status in another XenStore path because multiple
QEMU can run for a same domain. If xen_dmid machine option is not specified,
it means that an old version of Xen is used, so status is written in the old
path.
Signed-off-by: Julien Grall <address@hidden>
---
xen-all.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/xen-all.c b/xen-all.c
index 61def2e..df6927d 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -36,6 +36,7 @@
static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
static MemoryRegion *framebuffer;
+static uint32_t xen_dmid = ~0;
/* Compatibility with older version */
#if __XEN_LATEST_INTERFACE_VERSION__ < 0x0003020a
@@ -958,7 +959,14 @@ static void xenstore_record_dm_state(struct xs_handle *xs,
const char *state)
exit(1);
}
- snprintf(path, sizeof (path), "/local/domain/0/device-model/%u/state",
xen_domid);
+ if (xen_dmid == ~0) {
+ snprintf(path, sizeof(path), "/local/domain/0/device-model/%u/state",
+ xen_domid);
+ } else {
+ snprintf(path, sizeof(path), "/local/domain/0/dms/%u/%u/state",
+ xen_domid, xen_dmid);
+ }
+
if (!xs_write(xs, XBT_NULL, path, state, strlen(state))) {
fprintf(stderr, "error recording dm state\n");
exit(1);
@@ -1077,6 +1085,12 @@ int xen_hvm_init(void)
unsigned long ioreq_pfn;
unsigned long bufioreq_evtchn;
XenIOState *state;
+ QemuOptsList *list = qemu_find_opts("machine");
+
+ if (!QTAILQ_EMPTY(&list->head)) {
+ xen_dmid = qemu_opt_get_number(QTAILQ_FIRST(&list->head),
+ "xen_dmid", ~0);
+ }
state = g_malloc0(sizeof (XenIOState));
--
Julien Grall
- [Qemu-devel] [QEMU][RFC V2 01/10] xen: add new machine options to support QEMU disaggregation in Xen environment, (continued)
- [Qemu-devel] [QEMU][RFC V2 01/10] xen: add new machine options to support QEMU disaggregation in Xen environment, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 03/10] xen: add wrappers for new Xen disaggregation hypercalls, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 04/10] xen-hvm: register qemu as ioreq server and retrieve shared pages, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 08/10] xen: audio is not a part of default devices, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 06/10] xen-pci: register PCI device in Xen and handle IOREQ_TYPE_PCI_CONFIG, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 09/10] xen-memory: handle node "device_model" for physical mapping, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 02/10] xen: modify QEMU status path in XenStore,
Julien Grall <=
- [Qemu-devel] [QEMU][RFC V2 05/10] xen-memory: register memory/IO range in Xen, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 07/10] xen: specify which device is part of default devices, Julien Grall, 2012/08/22
- [Qemu-devel] [QEMU][RFC V2 10/10] xen: emulate IDE outside default device set, Julien Grall, 2012/08/22