[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [XEN][RFC PATCH V2 16/17] xl: Fix PCI library
From: |
Julien Grall |
Subject: |
[Qemu-devel] [XEN][RFC PATCH V2 16/17] xl: Fix PCI library |
Date: |
Wed, 22 Aug 2012 13:32:02 +0100 |
Quickly fix for PCI library. For the moment each hotplug PCI are add to
QEMU 0. We need to find a best way to specify which qemu handle the PCI.
Signed-off-by: Julien Grall <address@hidden>
---
tools/libxl/libxl_pci.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 48986f3..fe02ccd 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -834,13 +834,12 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t
domid,
}
libxl__qemu_traditional_cmd(gc, domid, "pci-ins");
- rc = libxl__wait_for_device_model(gc, domid, NULL, NULL,
+ rc = libxl__wait_for_device_model(gc, domid, 0, NULL, NULL,
pci_ins_check, state);
path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/parameter",
domid);
vdevfn = libxl__xs_read(gc, XBT_NULL, path);
- path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/state",
- domid);
+ path = libxl__sprintf(gc, "/local/domain/0/dms/%d/state", domid);
if ( rc < 0 )
LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
"qemu refused to add device: %s", vdevfn);
@@ -858,11 +857,13 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid,
libxl_device_pci *pcidev, i
{
libxl_ctx *ctx = libxl__gc_owner(gc);
int rc, hvm = 0;
+ /* FIXME: handle multiple device model */
+ libxl_dmid dmid = 0;
switch (libxl__domain_type(gc, domid)) {
case LIBXL_DOMAIN_TYPE_HVM:
hvm = 1;
- if (libxl__wait_for_device_model(gc, domid, "running",
+ if (libxl__wait_for_device_model(gc, domid, dmid, "running",
NULL, NULL, NULL) < 0) {
return ERROR_FAIL;
}
@@ -871,7 +872,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid,
libxl_device_pci *pcidev, i
rc = qemu_pci_add_xenstore(gc, domid, pcidev);
break;
case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
- rc = libxl__qmp_pci_add(gc, domid, pcidev);
+ rc = libxl__qmp_pci_add(gc, domid, dmid, pcidev);
break;
default:
return ERROR_INVAL;
@@ -1136,7 +1137,7 @@ static int qemu_pci_remove_xenstore(libxl__gc *gc,
uint32_t domid,
* device-model for function 0 */
if ( !force && (pcidev->vdevfn & 0x7) == 0 ) {
libxl__qemu_traditional_cmd(gc, domid, "pci-rem");
- if (libxl__wait_for_device_model(gc, domid, "pci-removed",
+ if (libxl__wait_for_device_model(gc, domid, 0, "pci-removed",
NULL, NULL, NULL) < 0) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in
time");
/* This depends on guest operating system acknowledging the
@@ -1162,6 +1163,8 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
libxl_device_pci *assigned;
int hvm = 0, rc, num;
int stubdomid = 0;
+ /* FIXME: Handle multiple device model */
+ libxl_dmid dmid = 0;
assigned = libxl_device_pci_list(ctx, domid, &num);
if ( assigned == NULL )
@@ -1178,7 +1181,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
switch (libxl__domain_type(gc, domid)) {
case LIBXL_DOMAIN_TYPE_HVM:
hvm = 1;
- if (libxl__wait_for_device_model(gc, domid, "running",
+ if (libxl__wait_for_device_model(gc, domid, dmid, "running",
NULL, NULL, NULL) < 0)
goto out_fail;
@@ -1187,7 +1190,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
rc = qemu_pci_remove_xenstore(gc, domid, pcidev, force);
break;
case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
- rc = libxl__qmp_pci_del(gc, domid, pcidev);
+ rc = libxl__qmp_pci_del(gc, domid, dmid, pcidev);
break;
default:
rc = ERROR_INVAL;
--
Julien Grall
- Re: [Qemu-devel] [Xen-devel] [XEN][RFC PATCH V2 01/17] hvm: Modify interface to support multiple ioreq server, (continued)
- [Qemu-devel] [XEN][RFC PATCH V2 15/17] xl: support spawn/destroy on multiple device model, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 13/17] xl: add device model id to qmp functions, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 04/17] hvm: Change initialization/destruction of an hvm, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 14/17] xl-parsing: Parse new device_models option, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 03/17] hvm-pci: Handle PCI config space in Xen, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 17/17] xl: implement save/restore for multiple device models, Julien Grall, 2012/08/22
- [Qemu-devel] [XEN][RFC PATCH V2 16/17] xl: Fix PCI library,
Julien Grall <=
- [Qemu-devel] [XEN][RFC PATCH V2 07/17] hvm-io: send invalidate map cache to each registered servers, Julien Grall, 2012/08/22