[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [QEMU][RFC V2 09/10] xen-memory: handle node "device_model"
From: |
Julien Grall |
Subject: |
[Qemu-devel] [QEMU][RFC V2 09/10] xen-memory: handle node "device_model" for physical mapping |
Date: |
Wed, 22 Aug 2012 13:30:22 +0100 |
Retrieve only physical mapping where device model corresponds to dmid.
When a new physical mapping is added, specify the device model id of the
current QEMU.
Signed-off-by: Julien Grall <address@hidden>
---
xen-all.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/xen-all.c b/xen-all.c
index afa9bcc..f424cce 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -440,6 +440,14 @@ go_physmap:
XEN_DOMCTL_MEM_CACHEATTR_WB);
snprintf(path, sizeof(path),
+ "/local/domain/0/device-model/%d/physmap/%"PRIx64"/device_model",
+ xen_domid, (uint64_t)phys_offset);
+ snprintf(value, sizeof(value), "%u", xen_dmid);
+ if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
+ return -1;
+ }
+
+ snprintf(path, sizeof(path),
"/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr",
xen_domid, (uint64_t)phys_offset);
snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)start_addr);
@@ -1266,6 +1274,7 @@ static void xen_read_physmap(XenIOState *state)
unsigned int len, num, i;
char path[80], *value = NULL;
char **entries = NULL;
+ uint32_t dmid = ~0;
snprintf(path, sizeof(path),
"/local/domain/0/device-model/%d/physmap", xen_domid);
@@ -1274,6 +1283,17 @@ static void xen_read_physmap(XenIOState *state)
return;
for (i = 0; i < num; i++) {
+ snprintf(path, sizeof(path),
+ "/local/domain/0/device-model/%d/physmap/%s/device_model",
+ xen_domid, entries[i]);
+ value = xs_read(state->xenstore, 0, path, &len);
+ if (value) {
+ dmid = strtoul(value, NULL, 10);
+ free(value);
+ if (dmid != xen_dmid) {
+ continue;
+ }
+ }
physmap = g_malloc(sizeof (XenPhysmap));
physmap->phys_offset = strtoull(entries[i], NULL, 16);
snprintf(path, sizeof(path),
--
Julien Grall
- [Qemu-devel] [QEMU][RFC V2 00/10] QEMU disaggregation in Xen environment., Julien Grall, 2012/08/22
- [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 <=
- [Qemu-devel] [QEMU][RFC V2 02/10] xen: modify QEMU status path in XenStore, Julien Grall, 2012/08/22
- [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