Skip to contentSkip to conversation

libxl: add PV display device driver interface

PATCH Superseded Oleksandr Grytsov 2 participants 25 messages Sep 11, 2017 – Sep 12, 2017

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover libxl: add PV display device driver interface

From: Oleksandr Grytsov <[email protected]>

Changes since V4:
* Use new LIBXL_DEFINE_UPDATE_DEVID for all device types;
* Align device setdefault function parameters with set_default

    device type callback;

* revert libxl_mac_to_device_nic to existing implementation;
* previous comments are applied.

Patches on github [1].

[1] https://github.com/al1img/xen/tree/xl-vdispl-v5

Oleksandr Grytsov (12):
libxl: add generic function to add device
libxl: add generic functions to get and free device list
libxl: add vdispl device
xl: add PV display device commands
docs: add PV display driver information
libxl: change p9 to use generec add function
libxl: change vkb to use generec add function
libxl: change vfb to use generec add function
libxl: change disk to use generic getting list functions
libxl: change nic to use generec add function
libxl: change vtpm to use generec add function
libxl: remove unneeded DEVICE_ADD macro

 docs/man/xl.cfg.pod.5.in              |  49 ++++++
 docs/man/xl.pod.1.in                  |  42 +++++
 tools/libxl/Makefile                  |   2 +-
 tools/libxl/libxl.h                   |  54 +++++--
 tools/libxl/libxl_9pfs.c              |  64 +++-----
 tools/libxl/libxl_checkpoint_device.c |  16 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_console.c           | 151 ++++--------------
 tools/libxl/libxl_create.c            |  17 +-
 tools/libxl/libxl_device.c            | 256 ++++++++++++++++++++++++++++++
 tools/libxl/libxl_disk.c              |  99 ++++--------
 tools/libxl/libxl_dm.c                |  16 +-
 tools/libxl/libxl_internal.h          | 126 ++++++---------
 tools/libxl/libxl_nic.c               | 199 +++++-------------------
 tools/libxl/libxl_pci.c               |  10 +-
 tools/libxl/libxl_types.idl           |  36 +++++
 tools/libxl/libxl_types_internal.idl  |   1 +
 tools/libxl/libxl_usb.c               |  43 ++---
 tools/libxl/libxl_utils.h             |   4 +
 tools/libxl/libxl_vdispl.c            | 284 ++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_vtpm.c              | 230 ++++++++-------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   6 +-
 tools/xl/Makefile                     |   1 +
 tools/xl/xl.h                         |   3 +
 tools/xl/xl_block.c                   |   3 +-
 tools/xl/xl_cmdtable.c                |  19 +++
 tools/xl/xl_nic.c                     |   3 +-
 tools/xl/xl_parse.c                   |  75 ++++++++-
 tools/xl/xl_parse.h                   |   2 +-
 tools/xl/xl_vdispl.c                  | 163 +++++++++++++++++++
 tools/xl/xl_vtpm.c                    |   3 +-
 31 files changed, 1281 insertions(+), 700 deletions(-)
 create mode 100644 tools/libxl/libxl_vdispl.c
 create mode 100644 tools/xl/xl_vdispl.c
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH v5 1/12 libxl: add generic function to add device

From: Oleksandr Grytsov <[email protected]>

Add libxl__device_add to simple write XenStore device conifg and libxl__device_add_async to update domain configuration and write XenStore device config asynchroniously. Almost all devices have similar libxl__device_xxxx_add function. This generic functions implement same functionality but using the device handling framework. Th device specific part such as setting xen store configurationis moved to set_xenstore_config callback of the device framework.

---
 tools/libxl/libxl_9pfs.c     |   9 +-
 tools/libxl/libxl_console.c  |  20 ++---
 tools/libxl/libxl_create.c   |   6 +-
 tools/libxl/libxl_device.c   | 197 +++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_disk.c     |  15 ++--
 tools/libxl/libxl_dm.c       |   2 +-
 tools/libxl/libxl_internal.h |  45 ++++++++--
 tools/libxl/libxl_nic.c      |  18 ++--
 tools/libxl/libxl_pci.c      |   7 +-
 tools/libxl/libxl_usb.c      |  35 ++++----
 tools/libxl/libxl_vtpm.c     |  15 ++--
 11 files changed, 301 insertions(+), 68 deletions(-)
tools/libxl/libxl_9pfs.c +3 -6
index 07e3e5f..5443f7a 100644
@@ -39,6 +39,7 @@ static int libxl__device_from_p9(libxl__gc *gc, uint32_t domid,
    return 0;
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(p9, "9pfs")
 
 int libxl__device_p9_add(libxl__gc *gc, uint32_t domid,
                          libxl_device_p9 *p9)
@@ -54,12 +55,8 @@ int libxl__device_p9_add(libxl__gc *gc, uint32_t domid,
     front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    if (p9->devid == -1) {
-        if ((p9->devid = libxl__device_nextid(gc, domid, "9pfs")) < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_p9_update_devid(gc, domid, p9);
+    if (rc) goto out;
 
     rc = libxl__device_from_p9(gc, domid, p9, &device);
     if (rc != 0) goto out;
tools/libxl/libxl_console.c +8 -12
index 446e766..6181b05 100644
@@ -621,6 +621,8 @@ out:
     return AO_INPROGRESS;
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkb")
+
 int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
                           libxl_device_vkb *vkb)
 {
@@ -635,12 +637,8 @@ int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
     front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    if (vkb->devid == -1) {
-        if ((vkb->devid = libxl__device_nextid(gc, domid, "vkb")) < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_vkb_update_devid(gc, domid, vkb);
+    if (rc) goto out;
 
     rc = libxl__device_from_vkb(gc, domid, vkb, &device);
     if (rc != 0) goto out;
@@ -719,6 +717,8 @@ out:
     return AO_INPROGRESS;
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(vfb, "vfb")
+
 int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
 {
     flexarray_t *front;
@@ -732,12 +732,8 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    if (vfb->devid == -1) {
-        if ((vfb->devid = libxl__device_nextid(gc, domid, "vfb")) < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_vfb_update_devid(gc, domid, vfb);
+    if (rc) goto out;
 
     rc = libxl__device_from_vfb(gc, domid, vfb, &device);
     if (rc != 0) goto out;
tools/libxl/libxl_create.c +5 -1
index 9123585..efd1459 100644
@@ -938,7 +938,8 @@ static void initiate_domain_create(libxl__egc *egc,
     store_libxl_entry(gc, domid, &d_config->b_info);
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_setdefault(gc, &d_config->disks[i], domid);
+        ret = libxl__device_disk_setdefault(gc, domid, &d_config->disks[i],
+                                            false);
         if (ret) {
             LOGD(ERROR, domid, "Unable to set disk defaults for disk %d", i);
             goto error_out;
@@ -1432,6 +1433,9 @@ out:
 
 #define libxl_device_dtdev_list NULL
 #define libxl_device_dtdev_compare NULL
+#define libxl__device_from_dtdev NULL
+#define libxl__device_dtdev_setdefault NULL
+#define libxl__device_dtdev_update_devid NULL
 static DEFINE_DEVICE_TYPE_STRUCT(dtdev);
 
 const struct libxl_device_type *device_type_tbl[] = {
tools/libxl/libxl_device.c +197 -0

203 lines not on this page · raw message

tools/libxl/libxl_disk.c +9 -6
index 63de75c..91c77ad 100644
@@ -152,8 +152,8 @@ void libxl_evdisable_disk_eject(libxl_ctx *ctx, libxl_evgen_disk_eject *evg) {
     GC_FREE;
 }
 
-int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk,
-                                  uint32_t domid)
+int libxl__device_disk_setdefault(libxl__gc *gc, uint32_t domid,
+                                  libxl_device_disk *disk, bool hotplug)
 {
     int rc;
 
@@ -296,7 +296,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
             }
         }
 
-        rc = libxl__device_disk_setdefault(gc, disk, domid);
+        rc = libxl__device_disk_setdefault(gc, domid, disk, aodev->update_json);
         if (rc) goto out;
 
         front = flexarray_make(gc, 16, 1);
@@ -751,7 +751,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
     disk_empty.vdev = libxl__strdup(NOGC, disk->vdev);
     disk_empty.pdev_path = libxl__strdup(NOGC, "");
     disk_empty.is_cdrom = 1;
-    libxl__device_disk_setdefault(gc, &disk_empty, domid);
+    libxl__device_disk_setdefault(gc, domid, &disk_empty, false);
 
     libxl_domain_type type = libxl__domain_type(gc, domid);
     if (type == LIBXL_DOMAIN_TYPE_INVALID) {
@@ -798,7 +798,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         goto out;
     }
 
-    rc = libxl__device_disk_setdefault(gc, disk, domid);
+    rc = libxl__device_disk_setdefault(gc, domid, disk, false);
     if (rc) goto out;
 
     if (!disk->pdev_path) {
@@ -1073,7 +1073,8 @@ void libxl__device_disk_local_initiate_attach(libxl__egc *egc,
             disk->script = libxl__strdup(gc, in_disk->script);
         disk->vdev = NULL;
 
-        rc = libxl__device_disk_setdefault(gc, disk, LIBXL_TOOLSTACK_DOMID);
+        rc = libxl__device_disk_setdefault(gc, LIBXL_TOOLSTACK_DOMID, disk,
+                                           false);
         if (rc) goto out;
 
         libxl__prepare_ao_device(ao, &dls->aodev);
@@ -1244,6 +1245,8 @@ static int libxl_device_disk_dm_needed(void *e, unsigned domid)
            elem->backend_domid == domid;
 }
 
+#define libxl__device_disk_update_devid NULL
+
 DEFINE_DEVICE_TYPE_STRUCT(disk,
     .merge       = libxl_device_disk_merge,
     .dm_needed   = libxl_device_disk_dm_needed,
tools/libxl/libxl_dm.c +1 -1
index e0e6a99..ee20930 100644
@@ -1975,7 +1975,7 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
          * called libxl_device_nic_add at this point, but qemu needs
          * the nic information to be complete.
          */
-        ret = libxl__device_nic_setdefault(gc, &dm_config->nics[i], dm_domid,
+        ret = libxl__device_nic_setdefault(gc, dm_domid, &dm_config->nics[i],
                                            false);
         if (ret)
             goto out;
tools/libxl/libxl_internal.h +40 -5

86 lines not on this page · raw message

tools/libxl/libxl_nic.c +8 -10
index 4b6e8c0..e7792ba 100644
@@ -52,8 +52,8 @@ int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
-int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
-                                 uint32_t domid, bool hotplug)
+int libxl__device_nic_setdefault(libxl__gc *gc, uint32_t domid,
+                                 libxl_device_nic *nic, bool hotplug)
 {
     int rc;
 
@@ -138,6 +138,8 @@ static void libxl__update_config_nic(libxl__gc *gc, libxl_device_nic *dst,
     libxl_mac_copy(CTX, &dst->mac, &src->mac);
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(nic, "vif")
+
 static void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
                                   libxl_device_nic *nic,
                                   libxl__ao_device *aodev)
@@ -156,18 +158,14 @@ static void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     libxl_device_nic_init(&nic_saved);
     libxl_device_nic_copy(CTX, &nic_saved, nic);
 
-    rc = libxl__device_nic_setdefault(gc, nic, domid, aodev->update_json);
+    rc = libxl__device_nic_setdefault(gc, domid, nic, aodev->update_json);
     if (rc) goto out;
 
     front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 18, 1);
 
-    if (nic->devid == -1) {
-        if ((nic->devid = libxl__device_nextid(gc, domid, "vif")) < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_nic_update_devid(gc, domid, nic);
+    if (rc) goto out;
 
     libxl__update_config_nic(gc, &nic_saved, nic);
 
@@ -646,7 +644,7 @@ int libxl__device_nic_set_devids(libxl__gc *gc, libxl_domain_config *d_config,
          * called libxl_device_nic_add when domcreate_launch_dm gets called,
          * but qemu needs the nic information to be complete.
          */
-        ret = libxl__device_nic_setdefault(gc, &d_config->nics[i], domid,
+        ret = libxl__device_nic_setdefault(gc, domid, &d_config->nics[i],
                                            false);
         if (ret) {
             LOGD(ERROR, domid, "Unable to set nic defaults for nic %d", i);
tools/libxl/libxl_pci.c +5 -2
index 65ad5e5..7a2d42f 100644
@@ -1144,7 +1144,8 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
     return -1;
 }
 
-int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
+static int libxl__device_pci_setdefault(libxl__gc *gc, uint32_t domid,
+                                        libxl_device_pci *pci, bool hotplug)
 {
     /* We'd like to force reserve rdm specific to a device by default.*/
     if (pci->rdm_policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
@@ -1200,7 +1201,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
         }
     }
 
-    rc = libxl__device_pci_setdefault(gc, pcidev);
+    rc = libxl__device_pci_setdefault(gc, domid, pcidev, false);
     if (rc) goto out;
 
     if (pcidev->seize && !pciback_dev_is_assigned(gc, pcidev)) {
@@ -1678,6 +1679,8 @@ static int libxl_device_pci_compare(libxl_device_pci *d1,
     return COMPARE_PCI(d1, d2);
 }
 
+#define libxl__device_pci_update_devid NULL
+
 DEFINE_DEVICE_TYPE_STRUCT_X(pcidev, pci);
 
 /*
tools/libxl/libxl_usb.c +18 -17
index d8948d5..7f78f4e 100644
@@ -39,7 +39,8 @@ static int usbback_is_loaded(libxl__gc *gc)
 }
 
 static int libxl__device_usbctrl_setdefault(libxl__gc *gc, uint32_t domid,
-                                            libxl_device_usbctrl *usbctrl)
+                                            libxl_device_usbctrl *usbctrl,
+                                            bool hotplug)
 {
     int rc;
     libxl_domain_type domtype = libxl__domain_type(gc, domid);
@@ -429,6 +430,8 @@ static int libxl__device_usbdev_del_hvm(libxl__gc *gc, uint32_t domid,
     return libxl__qmp_run_command_flexarray(gc, domid, "device_del", qmp_args);
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(usbctrl, "vusb")
+
 /* AO operation to add a usb controller.
  *
  * Generally, it does:
@@ -449,16 +452,12 @@ static void libxl__device_usbctrl_add(libxl__egc *egc, uint32_t domid,
     libxl__device *device;
     int rc;
 
-    rc = libxl__device_usbctrl_setdefault(gc, domid, usbctrl);
+    rc = libxl__device_usbctrl_setdefault(gc, domid, usbctrl,
+                                          aodev->update_json);
     if (rc < 0) goto out;
 
-    if (usbctrl->devid == -1) {
-        usbctrl->devid = libxl__device_nextid(gc, domid, "vusb");
-        if (usbctrl->devid < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_usbctrl_update_devid(gc, domid, usbctrl);
+    if (rc) goto out;
 
     rc = libxl__device_usbctrl_add_xenstore(gc, domid, usbctrl,
                                             aodev->update_json);
@@ -1079,16 +1078,12 @@ static int libxl__device_usbdev_setdefault(libxl__gc *gc,
 
             GCNEW(usbctrl);
             libxl_device_usbctrl_init(usbctrl);
-            rc = libxl__device_usbctrl_setdefault(gc, domid, usbctrl);
+            rc = libxl__device_usbctrl_setdefault(gc, domid, usbctrl,
+                                                  update_json);
             if (rc < 0) goto out;
 
-            if (usbctrl->devid == -1) {
-                usbctrl->devid = libxl__device_nextid(gc, domid, "vusb");
-                if (usbctrl->devid < 0) {
-                    rc = ERROR_FAIL;
-                    goto out;
-                }
-            }
+            rc = libxl__device_usbctrl_update_devid(gc, domid, usbctrl);
+            if (rc) goto out;
 
             rc = libxl__device_usbctrl_add_xenstore(gc, domid, usbctrl,
                                                     update_json);
@@ -1965,9 +1960,15 @@ void libxl_device_usbdev_list_free(libxl_device_usbdev *list, int nr)
    free(list);
 }
 
+#define libxl__device_usbctrl_update_devid NULL
+
 DEFINE_DEVICE_TYPE_STRUCT(usbctrl,
     .dm_needed = libxl_device_usbctrl_dm_needed
 );
+
+#define libxl__device_from_usbdev NULL
+#define libxl__device_usbdev_update_devid NULL
+
 DEFINE_DEVICE_TYPE_STRUCT(usbdev);
 
 /*
tools/libxl/libxl_vtpm.c +7 -8
index 9ee8cce..3eca38e 100644
@@ -17,7 +17,8 @@
 
 #include "libxl_internal.h"
 
-static int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
+static int libxl__device_vtpm_setdefault(libxl__gc *gc, uint32_t domid,
+                                         libxl_device_vtpm *vtpm, bool hotplug)
 {
     int rc;
     if (libxl_uuid_is_nil(&vtpm->uuid)) {
@@ -48,6 +49,8 @@ static void libxl__update_config_vtpm(libxl__gc *gc, libxl_device_vtpm *dst,
     libxl_uuid_copy(CTX, &dst->uuid, &src->uuid);
 }
 
+static LIBXL_DEFINE_UPDATE_DEVID(vtpm, "vtpm")
+
 static void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
                                    libxl_device_vtpm *vtpm,
                                    libxl__ao_device *aodev)
@@ -66,18 +69,14 @@ static void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
     libxl_device_vtpm_init(&vtpm_saved);
     libxl_device_vtpm_copy(CTX, &vtpm_saved, vtpm);
 
-    rc = libxl__device_vtpm_setdefault(gc, vtpm);
+    rc = libxl__device_vtpm_setdefault(gc, domid, vtpm, aodev->update_json);
     if (rc) goto out;
 
     front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    if (vtpm->devid == -1) {
-        if ((vtpm->devid = libxl__device_nextid(gc, domid, "vtpm")) < 0) {
-            rc = ERROR_FAIL;
-            goto out;
-        }
-    }
+    rc = libxl__device_vtpm_update_devid(gc, domid, vtpm);
+    if (rc) goto out;
 
     libxl__update_config_vtpm(gc, &vtpm_saved, vtpm);
 
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v5 1/12
#2 lore raw

Re: [PATCH v5 01/12] libxl: add generic function to add device

Quoted 11 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Add libxl__device_add to simple write XenStore device conifg and libxl__device_add_async to update domain configuration and write XenStore device config asynchroniously. Almost all devices have similar libxl__device_xxxx_add function. This generic functions implement same functionality but using the device handling framework. Th device specific part such as setting xen store configurationis moved to set_xenstore_config callback of the device framework.

Quoted 1 line

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

PATCH v5 2/12 libxl: add generic functions to get and free device list

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Add libxl__device_list and libxl__device_list_free functions to handle device list using the device framework.

---
 tools/libxl/libxl_device.c   | 61 ++++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_internal.h |  8 ++++++
 2 files changed, 69 insertions(+)
tools/libxl/libxl_device.c +61 -0
index 3296e83..487be28 100644
@@ -1990,6 +1990,67 @@ out:
     return rc;
 }
 
+void *libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt,
+                         uint32_t domid, const char* name, int *num)
+{
+    void *r = NULL;
+    void *list = NULL;
+    void *item = NULL;
+    char *libxl_path;
+    char **dir = NULL;
+    unsigned int ndirs = 0;
+    int rc;
+
+    *num = 0;
+
+    libxl_path = GCSPRINTF("%s/device/%s",
+                           libxl__xs_libxl_path(gc, domid), name);
+
+    dir = libxl__xs_directory(gc, XBT_NULL, libxl_path, &ndirs);
+
+    if (dir && ndirs) {
+        list = libxl__malloc(NOGC, dt->dev_elem_size * ndirs);
+        item = list;
+
+        while (*num < ndirs) {
+            dt->init(item);
+            ++(*num);
+
+            if (dt->from_xenstore) {
+                char *device_libxl_path = GCSPRINTF("%s/%s", libxl_path, *dir);
+                rc = dt->from_xenstore(gc, device_libxl_path, atoi(*dir), item);
+                if (rc) goto out;
+            }
+
+            item = (uint8_t *)item + dt->dev_elem_size;
+            ++dir;
+        }
+    }
+
+    r = list;
+    list = NULL;
+
+out:
+
+    if (list) {
+        libxl__device_list_free(dt, list, *num);
+        *num = 0;
+    }
+
+    return r;
+}
+
+void libxl__device_list_free(const struct libxl_device_type *dt,
+                             void *list, int num)
+{
+    int i;
+
+    for (i = 0; i < num; i++)
+        dt->dispose((uint8_t*)list + i * dt->dev_elem_size);
+
+    free(list);
+}
+
 /*
  * Local variables:
  * mode: C
tools/libxl/libxl_internal.h +8 -0
index c99ef3b..c94a117 100644
@@ -3505,6 +3505,7 @@ struct libxl_device_type {
     int (*dm_needed)(void *, unsigned);
     void (*update_config)(libxl__gc *, void *, void *);
     int (*update_devid)(libxl__gc *, uint32_t, void *);
+    int (*from_xenstore)(libxl__gc *, const char *, libxl_devid, void *);
     int (*set_xenstore_config)(libxl__gc *, uint32_t, void *, flexarray_t *,
                                flexarray_t *, flexarray_t *);
 };
@@ -4385,6 +4386,13 @@ void libxl__device_add_async(libxl__egc *egc, uint32_t domid,
 int libxl__device_add(libxl__gc *gc, uint32_t domid,
                       const struct libxl_device_type *dt, void *type);
 
+/* Caller is responsible for freeing the memory by calling
+ * libxl__device_list_free
+ */
+void* libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt,
+                         uint32_t domid, const char* name, int *num);
+void libxl__device_list_free(const struct libxl_device_type *dt,
+                             void *list, int num);
 #endif
 
 /*
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v5 2/12
#4 lore raw

Re: [PATCH v5 02/12] libxl: add generic functions to get and free device list

Quoted 7 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Add libxl__device_list and libxl__device_list_free functions to handle device list using the device framework.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

PATCH v5 3/12 libxl: add vdispl device

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/Makefile                 |   2 +-
 tools/libxl/libxl.h                  |  24 +++
 tools/libxl/libxl_create.c           |   1 +
 tools/libxl/libxl_internal.h         |   1 +
 tools/libxl/libxl_types.idl          |  36 +++++
 tools/libxl/libxl_types_internal.idl |   1 +
 tools/libxl/libxl_utils.h            |   4 +
 tools/libxl/libxl_vdispl.c           | 284 +++++++++++++++++++++++++++++++++++
 8 files changed, 352 insertions(+), 1 deletion(-)
 create mode 100644 tools/libxl/libxl_vdispl.c
tools/libxl/Makefile +1 -1
index 082af8f..56f90e1 100644
@@ -138,7 +138,7 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_dom_suspend.o libxl_dom_save.o libxl_usb.o \
 			libxl_vtpm.o libxl_nic.o libxl_disk.o libxl_console.o \
 			libxl_cpupool.o libxl_mem.o libxl_sched.o libxl_tmem.o \
-			libxl_9pfs.o libxl_domain.o \
+			libxl_9pfs.o libxl_domain.o libxl_vdispl.o \
                         $(LIBXL_OBJS-y)
 LIBXL_OBJS += libxl_genid.o
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
tools/libxl/libxl.h +24 -0
index 812b7ea..e386357 100644
@@ -1877,6 +1877,30 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
 int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
                                libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
 
+/* Virtual displays */
+int libxl_device_vdispl_add(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vdispl *displ,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_remove(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_vdispl *vdispl,
+                               const libxl_asyncop_how *ao_how)
+                               LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_destroy(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_vdispl *vdispl,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vdispl *libxl_device_vdispl_list(libxl_ctx *ctx,
+                                              uint32_t domid, int *num)
+                                              LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vdispl_list_free(libxl_device_vdispl* list, int num)
+                                   LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_vdispl *vdispl,
+                                libxl_vdisplinfo *vdisplinfo)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
 /* Keyboard */
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
                          const libxl_asyncop_how *ao_how)
tools/libxl/libxl_create.c +1 -0
index efd1459..f20bbf9 100644
@@ -1446,6 +1446,7 @@ const struct libxl_device_type *device_type_tbl[] = {
     &libxl__usbdev_devtype,
     &libxl__pcidev_devtype,
     &libxl__dtdev_devtype,
+    &libxl__vdispl_devtype,
     NULL
 };
 
tools/libxl/libxl_internal.h +1 -0
index c94a117..c6f5868 100644
@@ -3563,6 +3563,7 @@ extern const struct libxl_device_type libxl__vtpm_devtype;
 extern const struct libxl_device_type libxl__usbctrl_devtype;
 extern const struct libxl_device_type libxl__usbdev_devtype;
 extern const struct libxl_device_type libxl__pcidev_devtype;
+extern const struct libxl_device_type libxl__vdispl_devtype;
 
 extern const struct libxl_device_type *device_type_tbl[];
 
tools/libxl/libxl_types.idl +36 -0
index 173d70a..756e120 100644
@@ -779,6 +779,20 @@ libxl_device_channel = Struct("device_channel", [
            ])),
 ])
 
+libxl_connector_param = Struct("connector_param", [
+    ("id", string),
+    ("width", uint32),
+    ("height", uint32)
+    ])
+
+libxl_device_vdispl = Struct("device_vdispl", [
+    ("backend_domid", libxl_domid),
+    ("backend_domname", string),
+    ("devid", libxl_devid),
+    ("be_alloc", bool),
+    ("connectors", Array(libxl_connector_param, "num_connectors"))
+    ])
+
 libxl_domain_config = Struct("domain_config", [
     ("c_info", libxl_domain_create_info),
     ("b_info", libxl_domain_build_info),
@@ -792,6 +806,7 @@ libxl_domain_config = Struct("domain_config", [
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
     ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
     ("p9s", Array(libxl_device_p9, "num_p9s")),
+    ("vdispls", Array(libxl_device_vdispl, "num_vdispls")),
     # a channel manifests as a console with a name,
     # see docs/misc/channels.txt
     ("channels", Array(libxl_device_channel, "num_channels")),
@@ -888,6 +903,27 @@ libxl_physinfo = Struct("physinfo", [
     ("cap_hvm_directio", bool),
     ], dir=DIR_OUT)
 
+libxl_connectorinfo = Struct("connectorinfo", [
+    ("id", string),
+    ("width", uint32),
+    ("height", uint32),
+    ("req_evtch", integer),
+    ("req_rref", integer),
+    ("evt_evtch", integer),
+    ("evt_rref", integer),
+    ], dir=DIR_OUT)
+
+libxl_vdisplinfo = Struct("vdisplinfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("be_alloc", bool),
+    ("connectors", Array(libxl_connectorinfo, "num_connectors"))
+    ], dir=DIR_OUT)
+
 # NUMA node characteristics: size and free are how much memory it has, and how
 # much of it is free, respectively. dists is an array of distances from this
 # node to each other node.
tools/libxl/libxl_types_internal.idl +1 -0
index 7dc4d0f..673a6d5 100644
@@ -26,6 +26,7 @@ libxl__device_kind = Enumeration("device_kind", [
     (9, "VUSB"),
     (10, "QUSB"),
     (11, "9PFS"),
+    (12, "VDISPL"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
tools/libxl/libxl_utils.h +4 -0
index 25773d8..9e743dc 100644
@@ -78,6 +78,10 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
                                int devid, libxl_device_vtpm *vtpm);
 int libxl_devid_to_device_usbctrl(libxl_ctx *ctx, uint32_t domid,
                                   int devid, libxl_device_usbctrl *usbctrl);
+
+int libxl_devid_to_device_vdispl(libxl_ctx *ctx, uint32_t domid,
+                                 int devid, libxl_device_vdispl *vdispl);
+
 int libxl_ctrlport_to_device_usbdev(libxl_ctx *ctx, uint32_t domid,
                                     int ctrl, int port,
                                     libxl_device_usbdev *usbdev);
tools/libxl/libxl_vdispl.c new file +284 -0

284 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#7 lore raw

PATCH v5 4/12 xl: add PV display device commands

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Add commands: vdispl-attach, vdispl-list, vdispl-detach and domain config vdispl parser

---
 tools/xl/Makefile      |   1 +
 tools/xl/xl.h          |   3 +
 tools/xl/xl_cmdtable.c |  19 ++++++
 tools/xl/xl_parse.c    |  75 ++++++++++++++++++++++-
 tools/xl/xl_parse.h    |   2 +-
 tools/xl/xl_vdispl.c   | 163 +++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 261 insertions(+), 2 deletions(-)
 create mode 100644 tools/xl/xl_vdispl.c
tools/xl/Makefile +1 -0
index c868899..41a09ed 100644
@@ -21,6 +21,7 @@ XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o
 XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cdrom.o xl_mem.o
 XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o
 XL_OBJS += xl_vmcontrol.o xl_saverestore.o xl_migrate.o
+XL_OBJS += xl_vdispl.o
 
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl.h +3 -0
index 5d3d2a4..98d62e9 100644
@@ -167,6 +167,9 @@ int main_blockdetach(int argc, char **argv);
 int main_vtpmattach(int argc, char **argv);
 int main_vtpmlist(int argc, char **argv);
 int main_vtpmdetach(int argc, char **argv);
+int main_vdisplattach(int argc, char **argv);
+int main_vdispllist(int argc, char **argv);
+int main_vdispldetach(int argc, char **argv);
 int main_usbctrl_attach(int argc, char **argv);
 int main_usbctrl_detach(int argc, char **argv);
 int main_usbdev_attach(int argc, char **argv);
tools/xl/xl_cmdtable.c +19 -0
index ba0159d..d0330cd 100644
@@ -377,6 +377,25 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual TPM device",
       "<Domain> <DevId|uuid>",
     },
+    { "vdispl-attach",
+      &main_vdisplattach, 1, 1,
+      "Create a new virtual display device",
+      "<Domain> [backend=<BackDomain>] [be-alloc=<BackAlloc>] [connectors='<Connectors>']",
+      "    BackAlloc  - set to 1 to if backend allocates display buffers\n"
+      "    Connectors - list of connector's description in ID:WxH format,\n"
+      "                 where: ID - unique connector ID, W - connector width,\n"
+      "                 H - connector height: connectors='id0:800x600;id1:1024x768'\n"
+    },
+    { "vdispl-list",
+      &main_vdispllist, 0, 0,
+      "List virtual display devices for a domain",
+      "<Domain(s)>",
+    },
+    { "vdispl-detach",
+      &main_vdispldetach, 0, 1,
+      "Destroy a domain's virtual display device",
+      "<Domain> <DevId>",
+    },
     { "uptime",
       &main_uptime, 0, 0,
       "Print uptime for all/some domains",
tools/xl/xl_parse.c +74 -1

93 lines not on this page · raw message

tools/xl/xl_parse.h +1 -1
index db8bc3f..cc459fb 100644
@@ -33,7 +33,7 @@ int parse_usbctrl_config(libxl_device_usbctrl *usbctrl, char *token);
 int parse_usbdev_config(libxl_device_usbdev *usbdev, char *token);
 int parse_cpurange(const char *cpu, libxl_bitmap *cpumap);
 int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token);
-
+int parse_vdispl_config(libxl_device_vdispl *vdispl, char *token);
 
 int match_option_size(const char *prefix, size_t len,
                       char *arg, char **argopt);
tools/xl/xl_vdispl.c new file +163 -0

163 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#8 lore raw

PATCH v5 5/12 docs: add PV display driver information

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 docs/man/xl.cfg.pod.5.in | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
 docs/man/xl.pod.1.in     | 42 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
docs/man/xl.cfg.pod.5.in +49 -0
index 79cb2ea..247ae99 100644
@@ -1116,6 +1116,55 @@ FIFO-based event channel ABI support up to 131,071 event channels.
 Other guests are limited to 4095 (64-bit x86 and ARM) or 1023 (32-bit
 x86).
 
+=item B<vdispl=[ "VDISPL_SPEC_STRING", "VDISPL_SPEC_STRING", ...]>
+
+Specifies the virtual display devices to be provided to the guest.
+
+Each B<VDISPL_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<backend=DOMAIN>
+
+Specifies the backend domain name or id. If not specified Domain-0 is used.
+
+=item C<be-alloc=BOOLEAN>
+
+Indicates if backend can be a buffer provider/allocator for this domain. See
+display protocol for details.
+
+=item C<connectors=CONNECTORS>
+
+Specifies virtual connectors for the device in following format
+<id>:<W>x<H>;<id>:<W>x<H>... where:
+
+=over 4
+
+=item C<id>
+
+String connector ID. Space, comma symbols are not allowed.
+
+=item C<W>
+
+Connector width in pixels.
+
+=item C<H>
+
+Connector height in pixels.
+
+=back
+
+B<EXAMPLE>
+
+=over 4
+
+connectors=id0:1920x1080;id1:800x600;id2:640x480
+
+=back
+
+=back
+
 =back
 
 =head2 Paravirtualised (PV) Guest Specific Options
docs/man/xl.pod.1.in +42 -0

48 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#9 lore raw

PATCH v5 6/12 libxl: change p9 to use generec add function

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl_9pfs.c     | 59 ++++++++++++++++----------------------------
 tools/libxl/libxl_create.c   |  2 +-
 tools/libxl/libxl_internal.h |  7 +-----
 3 files changed, 23 insertions(+), 45 deletions(-)
tools/libxl/libxl_9pfs.c +21 -38
index 5443f7a..61d284c 100644
@@ -17,12 +17,10 @@
 
 #include "libxl_internal.h"
 
-int libxl__device_p9_setdefault(libxl__gc *gc, libxl_device_p9 *p9)
+static int libxl__device_p9_setdefault(libxl__gc *gc, uint32_t domid,
+                                       libxl_device_p9 *p9, bool hotplug)
 {
-    int rc;
-
-    rc = libxl__resolve_domid(gc, p9->backend_domname, &p9->backend_domid);
-    return rc;
+    return libxl__resolve_domid(gc, p9->backend_domname, &p9->backend_domid);
 }
 
 static int libxl__device_from_p9(libxl__gc *gc, uint32_t domid,
@@ -41,44 +39,29 @@ static int libxl__device_from_p9(libxl__gc *gc, uint32_t domid,
 
 static LIBXL_DEFINE_UPDATE_DEVID(p9, "9pfs")
 
-int libxl__device_p9_add(libxl__gc *gc, uint32_t domid,
-                         libxl_device_p9 *p9)
+static int libxl__set_xenstore_p9(libxl__gc *gc, uint32_t domid,
+                                  libxl_device_p9 *p9,
+                                  flexarray_t *back, flexarray_t *front,
+                                  flexarray_t *ro_front)
 {
-    flexarray_t *front;
-    flexarray_t *back;
-    libxl__device device;
-    int rc;
-
-    rc = libxl__device_p9_setdefault(gc, p9);
-    if (rc) goto out;
-
-    front = flexarray_make(gc, 16, 1);
-    back = flexarray_make(gc, 16, 1);
-
-    rc = libxl__device_p9_update_devid(gc, domid, p9);
-    if (rc) goto out;
-
-    rc = libxl__device_from_p9(gc, domid, p9, &device);
-    if (rc != 0) goto out;
-
-    flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
-    flexarray_append_pair(back, "online", "1");
-    flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
-    flexarray_append_pair(front, "backend-id",
-                          libxl__sprintf(gc, "%d", p9->backend_domid));
-    flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
-    flexarray_append_pair(front, "tag", p9->tag);
     flexarray_append_pair(back, "path", p9->path);
     flexarray_append_pair(back, "security_model", p9->security_model);
 
-    libxl__device_generic_add(gc, XBT_NULL, &device,
-                              libxl__xs_kvs_of_flexarray(gc, back),
-                              libxl__xs_kvs_of_flexarray(gc, front),
-                              NULL);
-    rc = 0;
-out:
-    return rc;
+    flexarray_append_pair(front, "tag", p9->tag);
+
+    return 0;
 }
 
+#define libxl__add_p9s NULL
+#define libxl_device_p9_list NULL
+#define libxl_device_p9_compare NULL
+
 LIBXL_DEFINE_DEVICE_REMOVE(p9)
 
+DEFINE_DEVICE_TYPE_STRUCT(p9,
+    .skip_attach = 1,
+    .set_xenstore_config = (int (*)(libxl__gc *, uint32_t, void *,
+                                    flexarray_t *back, flexarray_t *front,
+                                    flexarray_t *ro_front))
+                           libxl__set_xenstore_p9
+);
tools/libxl/libxl_create.c +1 -1
index f20bbf9..26aa2a4 100644
@@ -1328,7 +1328,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     }
 
     for (i = 0; i < d_config->num_p9s; i++)
-        libxl__device_p9_add(gc, domid, &d_config->p9s[i]);
+        libxl__device_add(gc, domid, &libxl__p9_devtype, &d_config->p9s[i]);
 
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
tools/libxl/libxl_internal.h +1 -6
index c6f5868..87f6d32 100644
@@ -1251,8 +1251,6 @@ _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
                                    libxl_domain_build_info *b_info);
-_hidden int libxl__device_p9_setdefault(libxl__gc *gc,
-                                        libxl_device_p9 *p9);
 
 _hidden const char *libxl__device_nic_devname(libxl__gc *gc,
                                               uint32_t domid,
@@ -2667,10 +2665,6 @@ _hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
 _hidden int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid,
                                   libxl_device_vfb *vfb);
 
-/* Internal function to connect a 9pfs device */
-_hidden int libxl__device_p9_add(libxl__gc *gc, uint32_t domid,
-                                 libxl_device_p9 *p9);
-
 /* Waits for the passed device to reach state XenbusStateInitWait.
  * This is not really useful by itself, but is important when executing
  * hotplug scripts, since we need to be sure the device is in the correct
@@ -3564,6 +3558,7 @@ extern const struct libxl_device_type libxl__usbctrl_devtype;
 extern const struct libxl_device_type libxl__usbdev_devtype;
 extern const struct libxl_device_type libxl__pcidev_devtype;
 extern const struct libxl_device_type libxl__vdispl_devtype;
+extern const struct libxl_device_type libxl__p9_devtype;
 
 extern const struct libxl_device_type *device_type_tbl[];
 
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#11 lore raw

PATCH v5 7/12 libxl: change vkb to use generec add function

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl_console.c  | 74 +++++++-------------------------------------
 tools/libxl/libxl_create.c   |  5 +--
 tools/libxl/libxl_dm.c       |  6 ++--
 tools/libxl/libxl_internal.h |  6 +---
 4 files changed, 19 insertions(+), 72 deletions(-)
tools/libxl/libxl_console.c +12 -62
index 6181b05..e4a0daf 100644
@@ -583,11 +583,10 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
-int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
+static int libxl__device_vkb_setdefault(libxl__gc *gc, uint32_t domid,
+                                        libxl_device_vkb *vkb, bool hotplug)
 {
-    int rc;
-    rc = libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
-    return rc;
+    return libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
 }
 
 static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
@@ -604,66 +603,8 @@ static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
     return 0;
 }
 
-int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
-                         const libxl_asyncop_how *ao_how)
-{
-    AO_CREATE(ctx, domid, ao_how);
-    int rc;
-
-    rc = libxl__device_vkb_add(gc, domid, vkb);
-    if (rc) {
-        LOGD(ERROR, domid, "Unable to add vkb device");
-        goto out;
-    }
-
-out:
-    libxl__ao_complete(egc, ao, rc);
-    return AO_INPROGRESS;
-}
-
 static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkb")
 
-int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
-                          libxl_device_vkb *vkb)
-{
-    flexarray_t *front;
-    flexarray_t *back;
-    libxl__device device;
-    int rc;
-
-    rc = libxl__device_vkb_setdefault(gc, vkb);
-    if (rc) goto out;
-
-    front = flexarray_make(gc, 16, 1);
-    back = flexarray_make(gc, 16, 1);
-
-    rc = libxl__device_vkb_update_devid(gc, domid, vkb);
-    if (rc) goto out;
-
-    rc = libxl__device_from_vkb(gc, domid, vkb, &device);
-    if (rc != 0) goto out;
-
-    flexarray_append(back, "frontend-id");
-    flexarray_append(back, GCSPRINTF("%d", domid));
-    flexarray_append(back, "online");
-    flexarray_append(back, "1");
-    flexarray_append(back, "state");
-    flexarray_append(back, GCSPRINTF("%d", XenbusStateInitialising));
-
-    flexarray_append(front, "backend-id");
-    flexarray_append(front, GCSPRINTF("%d", vkb->backend_domid));
-    flexarray_append(front, "state");
-    flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
-
-    libxl__device_generic_add(gc, XBT_NULL, &device,
-                              libxl__xs_kvs_of_flexarray(gc, back),
-                              libxl__xs_kvs_of_flexarray(gc, front),
-                              NULL);
-    rc = 0;
-out:
-    return rc;
-}
-
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
     int rc;
@@ -785,8 +726,17 @@ out:
  * 2. dynamically add/remove qemu chardevs via qmp messages. */
 
 /* vkb */
+
+#define libxl__add_vkbs NULL
+#define libxl_device_vkb_list NULL
+#define libxl_device_vkb_compare NULL
+
 LIBXL_DEFINE_DEVICE_REMOVE(vkb)
 
+DEFINE_DEVICE_TYPE_STRUCT(vkb,
+    .skip_attach = 1
+);
+
 /* vfb */
 LIBXL_DEFINE_DEVICE_REMOVE(vfb)
 
tools/libxl/libxl_create.c +3 -2
index 26aa2a4..8c0c12d 100644
@@ -1349,7 +1349,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         }
 
         libxl_device_vkb_init(&vkb);
-        libxl__device_vkb_add(gc, domid, &vkb);
+        libxl__device_add(gc, domid, &libxl__vkb_devtype, &vkb);
         libxl_device_vkb_dispose(&vkb);
 
         dcs->sdss.dm.guest_domid = domid;
@@ -1375,7 +1375,8 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_vfb_add(gc, domid, &d_config->vfbs[i]);
-            libxl__device_vkb_add(gc, domid, &d_config->vkbs[i]);
+            libxl__device_add(gc, domid, &libxl__vkb_devtype,
+                              &d_config->vkbs[i]);
         }
 
         init_console_info(gc, &console, 0);
tools/libxl/libxl_dm.c +3 -3
index ee20930..0712a34 100644
@@ -1986,9 +1986,9 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             goto out;
     }
     if (dm_config->num_vkbs) {
-        ret = libxl__device_vkb_add(gc, dm_domid, &dm_config->vkbs[0]);
-        if (ret)
-            goto out;
+        ret = libxl__device_add(gc, dm_domid, &libxl__vkb_devtype,
+                                &dm_config->vkbs[0]);
+        if (ret) goto out;
     }
 
     if (guest_config->b_info.u.hvm.serial)
tools/libxl/libxl_internal.h +1 -5
index 87f6d32..c2ef67f 100644
@@ -1248,7 +1248,6 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc, uint32_t domid,
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, uint32_t domid,
                                          libxl_device_nic *nic, bool hotplug);
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
-_hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
                                    libxl_domain_build_info *b_info);
 
@@ -2657,10 +2656,6 @@ struct libxl__multidev {
  * it's a valid state.
  */
 
-/* Internal function to connect a vkb device */
-_hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
-                                  libxl_device_vkb *vkb);
-
 /* Internal function to connect a vfb device */
 _hidden int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid,
                                   libxl_device_vfb *vfb);
@@ -3551,6 +3546,7 @@ static inline int *libxl__device_type_get_num(
     return (int *)((void *)d_config + dt->num_offset);
 }
 
+extern const struct libxl_device_type libxl__vkb_devtype;
 extern const struct libxl_device_type libxl__disk_devtype;
 extern const struct libxl_device_type libxl__nic_devtype;
 extern const struct libxl_device_type libxl__vtpm_devtype;
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#13 lore raw

PATCH v5 8/12 libxl: change vfb to use generec add function

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl_console.c  | 69 ++++++++++++--------------------------------
 tools/libxl/libxl_create.c   |  3 +-
 tools/libxl/libxl_dm.c       |  6 ++--
 tools/libxl/libxl_internal.h |  6 +---
 4 files changed, 25 insertions(+), 59 deletions(-)
tools/libxl/libxl_console.c +19 -50
index e4a0daf..6dcad8a 100644
@@ -605,7 +605,8 @@ static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
 
 static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkb")
 
-int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
+static int libxl__device_vfb_setdefault(libxl__gc *gc, uint32_t domid,
+                                        libxl_device_vfb *vfb, bool hotplug)
 {
     int rc;
 
@@ -641,47 +642,13 @@ static int libxl__device_from_vfb(libxl__gc *gc, uint32_t domid,
     return 0;
 }
 
-int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
-                         const libxl_asyncop_how *ao_how)
-{
-    AO_CREATE(ctx, domid, ao_how);
-    int rc;
-
-    rc = libxl__device_vfb_add(gc, domid, vfb);
-    if (rc) {
-        LOGD(ERROR, domid, "Unable to add vfb device");
-        goto out;
-    }
-
-out:
-    libxl__ao_complete(egc, ao, rc);
-    return AO_INPROGRESS;
-}
-
 static LIBXL_DEFINE_UPDATE_DEVID(vfb, "vfb")
 
-int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
+static int libxl__set_xenstore_vfb(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vfb *vfb,
+                                  flexarray_t *back, flexarray_t *front,
+                                  flexarray_t *ro_front)
 {
-    flexarray_t *front;
-    flexarray_t *back;
-    libxl__device device;
-    int rc;
-
-    rc = libxl__device_vfb_setdefault(gc, vfb);
-    if (rc) goto out;
-
-    front = flexarray_make(gc, 16, 1);
-    back = flexarray_make(gc, 16, 1);
-
-    rc = libxl__device_vfb_update_devid(gc, domid, vfb);
-    if (rc) goto out;
-
-    rc = libxl__device_from_vfb(gc, domid, vfb, &device);
-    if (rc != 0) goto out;
-
-    flexarray_append_pair(back, "frontend-id", GCSPRINTF("%d", domid));
-    flexarray_append_pair(back, "online", "1");
-    flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append_pair(back, "vnc",
                           libxl_defbool_val(vfb->vnc.enable) ? "1" : "0");
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
@@ -701,17 +668,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
         flexarray_append_pair(back, "display", vfb->sdl.display);
     }
 
-    flexarray_append_pair(front, "backend-id",
-                          GCSPRINTF("%d", vfb->backend_domid));
-    flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
-
-    libxl__device_generic_add(gc, XBT_NULL, &device,
-                              libxl__xs_kvs_of_flexarray(gc, back),
-                              libxl__xs_kvs_of_flexarray(gc, front),
-                              NULL);
-    rc = 0;
-out:
-    return rc;
+    return 0;
 }
 
 /* The following functions are defined:
@@ -737,9 +694,21 @@ DEFINE_DEVICE_TYPE_STRUCT(vkb,
     .skip_attach = 1
 );
 
+#define libxl__add_vfbs NULL
+#define libxl_device_vfb_list NULL
+#define libxl_device_vfb_compare NULL
+
 /* vfb */
 LIBXL_DEFINE_DEVICE_REMOVE(vfb)
 
+DEFINE_DEVICE_TYPE_STRUCT(vfb,
+    .skip_attach = 1,
+    .set_xenstore_config = (int (*)(libxl__gc *, uint32_t, void *,
+                                    flexarray_t *back, flexarray_t *front,
+                                    flexarray_t *ro_front))
+                           libxl__set_xenstore_vfb
+);
+
 libxl_xen_console_reader *
     libxl_xen_console_read_start(libxl_ctx *ctx, int clear)
 {
tools/libxl/libxl_create.c +2 -1
index 8c0c12d..70048fe 100644
@@ -1374,7 +1374,8 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         libxl__device device;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
-            libxl__device_vfb_add(gc, domid, &d_config->vfbs[i]);
+            libxl__device_add(gc, domid, &libxl__vfb_devtype,
+                              &d_config->vfbs[i]);
             libxl__device_add(gc, domid, &libxl__vkb_devtype,
                               &d_config->vkbs[i]);
         }
tools/libxl/libxl_dm.c +3 -3
index 0712a34..275fabc 100644
@@ -1981,9 +1981,9 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             goto out;
     }
     if (dm_config->num_vfbs) {
-        ret = libxl__device_vfb_add(gc, dm_domid, &dm_config->vfbs[0]);
-        if (ret)
-            goto out;
+        ret = libxl__device_add(gc, dm_domid, &libxl__vfb_devtype,
+                                &dm_config->vfbs[0]);
+        if (ret) goto out;
     }
     if (dm_config->num_vkbs) {
         ret = libxl__device_add(gc, dm_domid, &libxl__vkb_devtype,
tools/libxl/libxl_internal.h +1 -5
index c2ef67f..6b21812 100644
@@ -1247,7 +1247,6 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc, uint32_t domid,
                                           bool hotplug);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, uint32_t domid,
                                          libxl_device_nic *nic, bool hotplug);
-_hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
                                    libxl_domain_build_info *b_info);
 
@@ -2656,10 +2655,6 @@ struct libxl__multidev {
  * it's a valid state.
  */
 
-/* Internal function to connect a vfb device */
-_hidden int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid,
-                                  libxl_device_vfb *vfb);
-
 /* Waits for the passed device to reach state XenbusStateInitWait.
  * This is not really useful by itself, but is important when executing
  * hotplug scripts, since we need to be sure the device is in the correct
@@ -3546,6 +3541,7 @@ static inline int *libxl__device_type_get_num(
     return (int *)((void *)d_config + dt->num_offset);
 }
 
+extern const struct libxl_device_type libxl__vfb_devtype;
 extern const struct libxl_device_type libxl__vkb_devtype;
 extern const struct libxl_device_type libxl__disk_devtype;
 extern const struct libxl_device_type libxl__nic_devtype;
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#14 lore raw

PATCH v5 9/12 libxl: change disk to use generic getting list functions

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |  9 +++-
 tools/libxl/libxl_checkpoint_device.c |  7 ++-
 tools/libxl/libxl_create.c            |  4 +-
 tools/libxl/libxl_disk.c              | 83 +++++++++--------------------------
 tools/libxl/libxl_internal.h          |  7 ---
 tools/ocaml/libs/xl/xenlight_stubs.c  |  3 +-
 tools/xl/xl_block.c                   |  3 +-
 7 files changed, 34 insertions(+), 82 deletions(-)
tools/libxl/libxl.h +7 -2
index e386357..d5a3ab7 100644
@@ -1749,9 +1749,14 @@ int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
                               const libxl_asyncop_how *ao_how)
                               LIBXL_EXTERNAL_CALLERS_ONLY;
 
-libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_disk_list_free(libxl_device_disk* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_disk *disk, libxl_diskinfo *diskinfo);
+                              libxl_device_disk *disk, libxl_diskinfo *diskinfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
 
 /*
  * Insert a CD-ROM device. A device corresponding to disk must already
tools/libxl/libxl_checkpoint_device.c +3 -4
index 01e74b5..f6a4437 100644
@@ -66,7 +66,8 @@ void libxl__checkpoint_devices_setup(libxl__egc *egc,
         cds->nics = libxl_device_nic_list(CTX, cds->domid, &cds->num_nics);
 
     if (cds->device_kind_flags & (1 << LIBXL__DEVICE_KIND_VBD))
-        cds->disks = libxl_device_disk_list(CTX, cds->domid, &cds->num_disks);
+        cds->disks = libxl__device_list(gc, &libxl__disk_devtype, cds->domid,
+                                        "disk", &cds->num_disks);
 
     if (cds->num_nics == 0 && cds->num_disks == 0)
         goto out;
@@ -221,9 +222,7 @@ static void devices_teardown_cb(libxl__egc *egc,
     cds->num_nics = 0;
 
     /* clean disk */
-    for (i = 0; i < cds->num_disks; i++)
-        libxl_device_disk_dispose(&cds->disks[i]);
-    free(cds->disks);
+    libxl__device_list_free(&libxl__disk_devtype, cds->disks, cds->num_disks);
     cds->disks = NULL;
     cds->num_disks = 0;
 
tools/libxl/libxl_create.c +2 -2
index 70048fe..0ef54d2 100644
@@ -938,8 +938,8 @@ static void initiate_domain_create(libxl__egc *egc,
     store_libxl_entry(gc, domid, &d_config->b_info);
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_setdefault(gc, domid, &d_config->disks[i],
-                                            false);
+        ret = libxl__disk_devtype.set_default(gc, domid, &d_config->disks[i],
+                                              false);
         if (ret) {
             LOGD(ERROR, domid, "Unable to set disk defaults for disk %d", i);
             goto error_out;
tools/libxl/libxl_disk.c +20 -63

143 lines not on this page · raw message

tools/libxl/libxl_internal.h +0 -7
index 6b21812..de1706c 100644
@@ -1242,9 +1242,6 @@ _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                         libxl_domain_create_info *c_info);
 _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info);
-_hidden int libxl__device_disk_setdefault(libxl__gc *gc, uint32_t domid,
-                                          libxl_device_disk *disk,
-                                          bool hotplug);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, uint32_t domid,
                                          libxl_device_nic *nic, bool hotplug);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
@@ -1754,10 +1751,6 @@ _hidden char *libxl__blktap_devpath(libxl__gc *gc,
  */
 _hidden int libxl__device_destroy_tapdisk(libxl__gc *gc, const char *params);
 
-_hidden int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
-                                   const libxl_device_disk *disk,
-                                   libxl__device *device);
-
 /* Calls poll() again - useful to check whether a signaled condition
  * is still true.  Cannot fail.  Returns currently-true revents. */
 _hidden short libxl__fd_poll_recheck(libxl__egc *egc, int fd, short events);
tools/ocaml/libs/xl/xenlight_stubs.c +1 -2
index 98b52b9..55f09d7 100644
@@ -763,9 +763,8 @@ value stub_xl_device_disk_list(value ctx, value domid)
 		Field(list, 1) = temp;
 		temp = list;
 		Store_field(list, 0, Val_device_disk(&c_list[i]));
-		libxl_device_disk_dispose(&c_list[i]);
 	}
-	free(c_list);
+	libxl_device_disk_list_free(c_list, nb);
 
 	CAMLreturn(list);
 }
tools/xl/xl_block.c +1 -2
index da337ef..acaf9b9 100644
@@ -88,9 +88,8 @@ int main_blocklist(int argc, char **argv)
                        diskinfo.state, diskinfo.evtch, diskinfo.rref, diskinfo.backend);
                 libxl_diskinfo_dispose(&diskinfo);
             }
-            libxl_device_disk_dispose(&disks[i]);
         }
-        free(disks);
+        libxl_device_disk_list_free(disks, nb);
     }
     return 0;
 }
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v5 9/12
#15 lore raw

Re: [PATCH v5 09/12] libxl: change disk to use generic getting list functions

Quoted 3 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

With one nit:

Quoted 15 lines
---
 tools/libxl/libxl.h                   |  9 +++-
 tools/libxl/libxl_checkpoint_device.c |  7 ++-
 tools/libxl/libxl_create.c            |  4 +-
 tools/libxl/libxl_disk.c              | 83 +++++++++--------------------------
 tools/libxl/libxl_internal.h          |  7 ---
 tools/ocaml/libs/xl/xenlight_stubs.c  |  3 +-
 tools/xl/xl_block.c                   |  3 +-
 7 files changed, 34 insertions(+), 82 deletions(-)
tools/libxl/libxl.h +0 -0
index e386357..d5a3ab7 100644

tools/libxl/libxl.h int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid, · line 1756

Quoted 9 lines
tools/libxl/libxl.h +5 -1
@@ -1749,9 +1749,14 @@ int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
                               const libxl_asyncop_how *ao_how)
                               LIBXL_EXTERNAL_CALLERS_ONLY;
 
-libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_disk_list_free(libxl_device_disk* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;

'*' is in the wrong place.

tools/libxl/libxl.h int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid, · line 1757

Quoted 1 line
tools/libxl/libxl.h +1 -0
+void libxl_device_disk_list_free(libxl_device_disk* list, int num)

Ditto.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#16 lore raw

PATCH v5 10/12 libxl: change nic to use generec add function

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |   9 +-
 tools/libxl/libxl_checkpoint_device.c |   9 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_dm.c                |   4 +-
 tools/libxl/libxl_internal.h          |   2 -
 tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
 tools/xl/xl_nic.c                     |   3 +-
 8 files changed, 52 insertions(+), 173 deletions(-)
tools/libxl/libxl.h +7 -2
index d5a3ab7..abe129e 100644
@@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                              LIBXL_EXTERNAL_CALLERS_ONLY;
 
-libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
+                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
 
 /*
  * Virtual Channels
tools/libxl/libxl_checkpoint_device.c +3 -6
index f6a4437..d1cc155 100644
@@ -63,7 +63,8 @@ void libxl__checkpoint_devices_setup(libxl__egc *egc,
     cds->num_disks = 0;
 
     if (cds->device_kind_flags & (1 << LIBXL__DEVICE_KIND_VIF))
-        cds->nics = libxl_device_nic_list(CTX, cds->domid, &cds->num_nics);
+        cds->nics = libxl__device_list(gc, &libxl__nic_devtype, cds->domid,
+                                       "vif", &cds->num_nics);
 
     if (cds->device_kind_flags & (1 << LIBXL__DEVICE_KIND_VBD))
         cds->disks = libxl__device_list(gc, &libxl__disk_devtype, cds->domid,
@@ -206,8 +207,6 @@ static void devices_teardown_cb(libxl__egc *egc,
                                 libxl__multidev *multidev,
                                 int rc)
 {
-    int i;
-
     STATE_AO_GC(multidev->ao);
 
     /* Convenience aliases */
@@ -215,9 +214,7 @@ static void devices_teardown_cb(libxl__egc *egc,
                             CONTAINER_OF(multidev, *cds, multidev);
 
     /* clean nic */
-    for (i = 0; i < cds->num_nics; i++)
-        libxl_device_nic_dispose(&cds->nics[i]);
-    free(cds->nics);
+    libxl__device_list_free(&libxl__nic_devtype, cds->nics, cds->num_nics);
     cds->nics = NULL;
     cds->num_nics = 0;
 
tools/libxl/libxl_colo_save.c +3 -1
index f687d5a..8a9d37a 100644
@@ -87,6 +87,7 @@ void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css)
     libxl__srm_save_autogen_callbacks *const callbacks =
         &dss->sws.shs.callbacks.save.a;
     libxl_device_nic *nics;
+    int nb;
 
     STATE_AO_GC(dss->ao);
 
@@ -122,9 +123,10 @@ void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css)
         cds->device_kind_flags = (1 << LIBXL__DEVICE_KIND_VBD);
 
         /* Use this args we can connect to qemu colo-compare */
-        nics = libxl_device_nic_list(CTX, cds->domid, &cds->num_nics);
+        nics = libxl_device_nic_list(CTX, cds->domid, &nb);
         css->cps.checkpoint_host = nics->colo_checkpoint_host;
         css->cps.checkpoint_port = nics->colo_checkpoint_port;
+        libxl_device_nic_list_free(nics, nb);
     } else {
         cds->device_kind_flags = (1 << LIBXL__DEVICE_KIND_VIF) |
                                  (1 << LIBXL__DEVICE_KIND_VBD);
tools/libxl/libxl_dm.c +2 -2
index 275fabc..98f89a9 100644
@@ -1975,8 +1975,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
          * called libxl_device_nic_add at this point, but qemu needs
          * the nic information to be complete.
          */
-        ret = libxl__device_nic_setdefault(gc, dm_domid, &dm_config->nics[i],
-                                           false);
+        ret = libxl__nic_devtype.set_default(gc, dm_domid, &dm_config->nics[i],
+                                             false);
         if (ret)
             goto out;
     }
tools/libxl/libxl_internal.h +0 -2
index de1706c..976827a 100644
@@ -1242,8 +1242,6 @@ _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                         libxl_domain_create_info *c_info);
 _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info);
-_hidden int libxl__device_nic_setdefault(libxl__gc *gc, uint32_t domid,
-                                         libxl_device_nic *nic, bool hotplug);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
                                    libxl_domain_build_info *b_info);
 
tools/libxl/libxl_nic.c +35 -156

257 lines not on this page · raw message

tools/ocaml/libs/xl/xenlight_stubs.c +1 -2
index 55f09d7..badf9c9 100644
@@ -734,9 +734,8 @@ value stub_xl_device_nic_list(value ctx, value domid)
 		Field(list, 1) = temp;
 		temp = list;
 		Store_field(list, 0, Val_device_nic(&c_list[i]));
-		libxl_device_nic_dispose(&c_list[i]);
 	}
-	free(c_list);
+	libxl_device_nic_list_free(c_list, nb)
 
 	CAMLreturn(list);
 }
tools/xl/xl_nic.c +1 -2
index a78d944..2315dcd 100644
@@ -124,9 +124,8 @@ int main_networklist(int argc, char **argv)
                        nicinfo.rref_tx, nicinfo.rref_rx, nicinfo.backend);
                 libxl_nicinfo_dispose(&nicinfo);
             }
-            libxl_device_nic_dispose(&nics[i]);
         }
-        free(nics);
+        libxl_device_nic_list_free(nics, nb);
     }
     return 0;
 }
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#18 lore raw

Re: [PATCH v5 10/12] libxl: change nic to use generec add function

In reply to Oleksandr Grytsov
Quoted 22 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |   9 +-
 tools/libxl/libxl_checkpoint_device.c |   9 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_dm.c                |   4 +-
 tools/libxl/libxl_internal.h          |   2 -
 tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
 tools/xl/xl_nic.c                     |   3 +-
 8 files changed, 52 insertions(+), 173 deletions(-)
tools/libxl/libxl.h +0 -0
index d5a3ab7..abe129e 100644
@@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                              LIBXL_EXTERNAL_CALLERS_ONLY;
 

tools/libxl/libxl.h int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid, · line 1860

Quoted 10 lines
tools/libxl/libxl.h +7 -2
-libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
+                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;

The annotation has caused the following failures:

libxl_colo_save.c: In function ‘libxl__colo_save_setup’:
libxl_colo_save.c:126:14: error: call to ‘libxl_device_nic_list’ declared with attribute warning: may not be called from within libxl [-Werror]

nics = libxl_device_nic_list(CTX, cds->domid, &nb);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libxl_colo_save.c:129:9: error: call to ‘libxl_device_nic_list_free’ declared with attribute warning: may not be called from within libxl [-Werror]
libxl_device_nic_list_free(nics, nb);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However, I think that's a bug in colo.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#19 lore raw

Re: [PATCH v5 10/12] libxl: change nic to use generec add function

Quoted 38 lines · Wei Liu
Quoted 22 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |   9 +-
 tools/libxl/libxl_checkpoint_device.c |   9 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_dm.c                |   4 +-
 tools/libxl/libxl_internal.h          |   2 -
 tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
 tools/xl/xl_nic.c                     |   3 +-
 8 files changed, 52 insertions(+), 173 deletions(-)
tools/libxl/libxl.h +0 -0
index d5a3ab7..abe129e 100644
@@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                              LIBXL_EXTERNAL_CALLERS_ONLY;
 

tools/libxl/libxl.h int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid, · line 1860

Quoted 10 lines
tools/libxl/libxl.h +7 -2
-libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
+                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;

The annotation has caused the following failures:

libxl_colo_save.c: In function ‘libxl__colo_save_setup’:
libxl_colo_save.c:126:14: error: call to ‘libxl_device_nic_list’ declared with attribute warning: may not be called from within libxl [-Werror]

Quoted 7 lines
nics = libxl_device_nic_list(CTX, cds->domid, &nb);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libxl_colo_save.c:129:9: error: call to ‘libxl_device_nic_list_free’ declared with attribute warning: may not be called from within libxl [-Werror]
libxl_device_nic_list_free(nics, nb);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However, I think that's a bug in colo.

Thinking about this a bit more: the list_free functions (here and in other patches) shouldn't be annotated as external callers only.

And you can replace the nic_list function here to call the framework directly.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#20 lore raw

Re: [PATCH v5 10/12] libxl: change nic to use generec add function

Quoted 45 lines · Wei Liu
Quoted 44 lines · Wei Liu
Quoted 22 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |   9 +-
 tools/libxl/libxl_checkpoint_device.c |   9 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_dm.c                |   4 +-
 tools/libxl/libxl_internal.h          |   2 -
 tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
 tools/xl/xl_nic.c                     |   3 +-
 8 files changed, 52 insertions(+), 173 deletions(-)
tools/libxl/libxl.h +0 -0
index d5a3ab7..abe129e 100644
@@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                              LIBXL_EXTERNAL_CALLERS_ONLY;
 

tools/libxl/libxl.h int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid, · line 1860

Quoted 10 lines
tools/libxl/libxl.h +7 -2
-libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
+                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;

The annotation has caused the following failures:

libxl_colo_save.c: In function ‘libxl__colo_save_setup’:
libxl_colo_save.c:126:14: error: call to ‘libxl_device_nic_list’ declared with attribute warning: may not be called from within libxl [-Werror]

nics = libxl_device_nic_list(CTX, cds->domid, &nb);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libxl_colo_save.c:129:9: error: call to ‘libxl_device_nic_list_free’ declared with attribute warning: may not be called from within libxl [-Werror]
libxl_device_nic_list_free(nics, nb);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
Quoted 1 line

However, I think that's a bug in colo.

Thinking about this a bit more: the list_free functions (here and in other patches) shouldn't be annotated as external callers only.

And you can replace the nic_list function here to call the framework directly.

The idea was that libxl_device_xxx_list and free are for external callers only because they don't aware about device framework. Internal callers shall use device framework instead. I wonder why I don't have error here on my build environment. I will put device framework get/free list here.

I will create new patch set.

Signature · 7 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#21 lore raw

Re: [PATCH v5 10/12] libxl: change nic to use generec add function

Quoted 54 lines · Oleksandr Grytsov
Quoted 45 lines · Wei Liu
Quoted 44 lines · Wei Liu
Quoted 22 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h                   |   9 +-
 tools/libxl/libxl_checkpoint_device.c |   9 +-
 tools/libxl/libxl_colo_save.c         |   4 +-
 tools/libxl/libxl_dm.c                |   4 +-
 tools/libxl/libxl_internal.h          |   2 -
 tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
 tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
 tools/xl/xl_nic.c                     |   3 +-
 8 files changed, 52 insertions(+), 173 deletions(-)
tools/libxl/libxl.h +0 -0
index d5a3ab7..abe129e 100644
@@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                              LIBXL_EXTERNAL_CALLERS_ONLY;
 

tools/libxl/libxl.h int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid, · line 1860

Quoted 10 lines
tools/libxl/libxl.h +7 -2
-libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
-                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
+                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;

The annotation has caused the following failures:

libxl_colo_save.c: In function ‘libxl__colo_save_setup’:
libxl_colo_save.c:126:14: error: call to ‘libxl_device_nic_list’ declared with attribute warning: may not be called from within libxl [-Werror]

nics = libxl_device_nic_list(CTX, cds->domid, &nb);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libxl_colo_save.c:129:9: error: call to ‘libxl_device_nic_list_free’ declared with attribute warning: may not be called from within libxl [-Werror]
libxl_device_nic_list_free(nics, nb);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
Quoted 1 line

However, I think that's a bug in colo.

Thinking about this a bit more: the list_free functions (here and in other patches) shouldn't be annotated as external callers only.

And you can replace the nic_list function here to call the framework directly.

Quoted 7 lines

The idea was that libxl_device_xxx_list and free are for external callers only because they don't aware about device framework. Internal callers shall use device framework instead. I wonder why I don't have error here on my build environment. I will put device framework get/free list here.

I will create new patch set.

Also in this particular place I've tried to fix memory leak by adding libxl_device_nic_list_free.
But this is not right fix and out of this patch scope.
So I will revert this changes. Probably libxl__strdup should be here. I will move the fix to the separate patch in this patch series.

Signature · 7 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#22 lore raw

PATCH v5 11/12 libxl: change vtpm to use generec add function

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h      |  12 +--
 tools/libxl/libxl_vtpm.c | 221 +++++++++++++----------------------------------
 tools/xl/xl_vtpm.c       |   3 +-
 3 files changed, 69 insertions(+), 167 deletions(-)
tools/libxl/libxl.h +7 -5
index abe129e..65c4aaa 100644
@@ -1606,9 +1606,6 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
                                 int *nb_vcpu, int *nr_cpus_out);
 void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
 
-void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
-void libxl_vtpminfo_list_free(libxl_vtpminfo *, int nr_vtpms);
-
 /*
  * Devices
  * =======
@@ -1883,9 +1880,14 @@ int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
                               const libxl_asyncop_how *ao_how)
                               LIBXL_EXTERNAL_CALLERS_ONLY;
 
-libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num);
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vtpm_list_free(libxl_device_vtpm*, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
-                               libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
+                              libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
 
 /* Virtual displays */
 int libxl_device_vdispl_add(libxl_ctx *ctx, uint32_t domid,
tools/libxl/libxl_vtpm.c +61 -160

288 lines not on this page · raw message

tools/xl/xl_vtpm.c +1 -2
index 6f56be0..0ba5041 100644
@@ -105,9 +105,8 @@ int main_vtpmlist(int argc, char **argv)
 
               libxl_vtpminfo_dispose(&vtpminfo);
            }
-           libxl_device_vtpm_dispose(&vtpms[i]);
         }
-        free(vtpms);
+        libxl_device_vtpm_list_free(vtpms, nb);
     }
     return 0;
 }
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#23 lore raw

PATCH v5 12/12 libxl: remove unneeded DEVICE_ADD macro

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl_device.c   |  6 ++---
 tools/libxl/libxl_disk.c     |  5 +++--
 tools/libxl/libxl_internal.h | 52 +++-----------------------------------------
 tools/libxl/libxl_pci.c      |  3 ++-
 tools/libxl/libxl_usb.c      |  8 +++----
 5 files changed, 14 insertions(+), 60 deletions(-)
tools/libxl/libxl_device.c +2 -4
index 487be28..67b7afb 100644
@@ -1793,10 +1793,8 @@ out:
     return AO_CREATE_FAIL(rc);
 }
 
-static void device_add_domain_config(libxl__gc *gc,
-                                     libxl_domain_config *d_config,
-                                     const struct libxl_device_type *dt,
-                                     void *type)
+void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config,
+                              const struct libxl_device_type *dt, void *type)
 {
     int *num_dev;
     unsigned int i;
tools/libxl/libxl_disk.c +3 -2
index 0f72874..e36c7bf 100644
@@ -277,7 +277,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         rc = libxl__get_domain_configuration(gc, domid, &d_config);
         if (rc) goto out;
 
-        DEVICE_ADD(disk, disks, domid, &disk_saved, COMPARE_DISK, &d_config);
+        device_add_domain_config(gc, &d_config, &libxl__disk_devtype,
+                                 &disk_saved);
 
         rc = libxl__dm_check_start(gc, &d_config, domid);
         if (rc) goto out;
@@ -832,7 +833,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
     rc = libxl__get_domain_configuration(gc, domid, &d_config);
     if (rc) goto out;
 
-    DEVICE_ADD(disk, disks, domid, &disk_saved, COMPARE_DISK, &d_config);
+    device_add_domain_config(gc, &d_config, &libxl__disk_devtype, &disk_saved);
 
     rc = libxl__dm_check_start(gc, &d_config, domid);
     if (rc) goto out;
tools/libxl/libxl_internal.h +3 -49

64 lines not on this page · raw message

tools/libxl/libxl_pci.c +2 -1
index 7a2d42f..f929e5a 100644
@@ -160,7 +160,8 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
     rc = libxl__get_domain_configuration(gc, domid, &d_config);
     if (rc) goto out;
 
-    DEVICE_ADD(pci, pcidevs, domid, &pcidev_saved, COMPARE_PCI, &d_config);
+    device_add_domain_config(gc, &d_config, &libxl__pcidev_devtype,
+                             &pcidev_saved);
 
     rc = libxl__dm_check_start(gc, &d_config, domid);
     if (rc) goto out;
tools/libxl/libxl_usb.c +4 -4
index 7f78f4e..1d5a243 100644
@@ -246,8 +246,8 @@ static int libxl__device_usbctrl_add_xenstore(libxl__gc *gc, uint32_t domid,
         rc = libxl__get_domain_configuration(gc, domid, &d_config);
         if (rc) goto out;
 
-        DEVICE_ADD(usbctrl, usbctrls, domid, &usbctrl_saved,
-                   COMPARE_USBCTRL, &d_config);
+        device_add_domain_config(gc, &d_config, &libxl__usbctrl_devtype,
+                                 &usbctrl_saved);
 
         rc = libxl__dm_check_start(gc, &d_config, domid);
         if (rc) goto out;
@@ -1194,8 +1194,8 @@ static int libxl__device_usbdev_add_xenstore(libxl__gc *gc, uint32_t domid,
         rc = libxl__get_domain_configuration(gc, domid, &d_config);
         if (rc) goto out;
 
-        DEVICE_ADD(usbdev, usbdevs, domid, &usbdev_saved,
-                   COMPARE_USB, &d_config);
+        device_add_domain_config(gc, &d_config, &libxl__usbdev_devtype,
+                                         &usbdev_saved);
 
         rc = libxl__dm_check_start(gc, &d_config, domid);
         if (rc) goto out;
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#24 lore raw
In reply to Oleksandr Grytsov
Quoted 5 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Changes since V4:
* Use new LIBXL_DEFINE_UPDATE_DEVID for all device types;
* Align device setdefault function parameters with set_default

Quoted 8 lines
    device type callback;

* revert libxl_mac_to_device_nic to existing implementation;
* previous comments are applied.

Patches on github [1].

[1] https://github.com/al1img/xen/tree/xl-vdispl-v5

All the patches are acked. There is no need to resend for the nit I pointed out.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel