WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: libxl_qmp: Introduce libxl__qmp_pc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: libxl_qmp: Introduce libxl__qmp_pci_del
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 11 Nov 2011 04:33:20 +0000
Delivery-date: Thu, 10 Nov 2011 20:35:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1320420890 0
# Node ID e22e108e1c57e10b2eec3697a5f60eff601272f1
# Parent  659c800d7edf433c188917bf6faff177dd118c07
libxl: libxl_qmp: Introduce libxl__qmp_pci_del

To remove a pci passthough device from QEMU (upstream).

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 659c800d7edf -r e22e108e1c57 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Fri Nov 04 15:55:50 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Fri Nov 04 15:34:50 2011 +0000
@@ -526,6 +526,8 @@
 /* ask to QEMU the serial port information and store it in xenstore. */
 _hidden int libxl__qmp_query_serial(libxl__qmp_handler *qmp);
 _hidden int libxl__qmp_pci_add(libxl__gc *gc, int d, libxl_device_pci *pcidev);
+_hidden int libxl__qmp_pci_del(libxl__gc *gc, int domid,
+                               libxl_device_pci *pcidev);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r 659c800d7edf -r e22e108e1c57 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c   Fri Nov 04 15:55:50 2011 +0100
+++ b/tools/libxl/libxl_qmp.c   Fri Nov 04 15:34:50 2011 +0000
@@ -713,6 +713,41 @@
     return rc;
 }
 
+static int qmp_device_del(libxl__gc *gc, int domid, char *id)
+{
+    libxl__qmp_handler *qmp = NULL;
+    flexarray_t *parameters = NULL;
+    libxl_key_value_list args = NULL;
+    int rc = 0;
+
+    qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid);
+    if (!qmp)
+        return ERROR_FAIL;
+
+    parameters = flexarray_make(2, 1);
+    flexarray_append_pair(parameters, "id", id);
+    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    if (!args)
+        return ERROR_NOMEM;
+
+    rc = qmp_synchronous_send(qmp, "device_del", &args,
+                              NULL, NULL, qmp->timeout);
+
+    flexarray_free(parameters);
+    libxl__qmp_close(qmp);
+    return rc;
+}
+
+int libxl__qmp_pci_del(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
+{
+    char *id = NULL;
+
+    id = libxl__sprintf(gc, PCI_PT_QDEV_ID,
+                        pcidev->bus, pcidev->dev, pcidev->func);
+
+    return qmp_device_del(gc, domid, id);
+}
+
 int libxl__qmp_initializations(libxl_ctx *ctx, uint32_t domid)
 {
     libxl__qmp_handler *qmp = NULL;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: libxl_qmp: Introduce libxl__qmp_pci_del, Xen patchbot-unstable <=