All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Rosbrook <rosbrookn@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: george.dunlap@citrix.com, Nick Rosbrook <rosbrookn@ainfosec.com>,
	Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [RFC v2 5/7] libxl: add device function definitions to libxl_types.idl
Date: Tue,  2 Mar 2021 20:46:17 -0500	[thread overview]
Message-ID: <2cd96b7e884c6f0c2667ef7499ff7179b99ea635.1614734296.git.rosbrookn@ainfosec.com> (raw)
In-Reply-To: <cover.1614734296.git.rosbrookn@ainfosec.com>
In-Reply-To: <cover.1614734296.git.rosbrookn@ainfosec.com>

Add definitions to libxl_type.idl for the device functions required by
each device. In addition, add a Builtin definition for libxl_asyncop_how,
since each device function requires this as a parameter.

This is still prepatory work, and a later commit will make use of these
new definitions to generate the code from gentypes.py.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
---
 tools/libs/light/libxl_types.idl | 202 +++++++++++++++++++++++++++++++
 1 file changed, 202 insertions(+)

diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 5b85a7419f..550af7a1c7 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -33,6 +33,8 @@ libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE, json_parse_type="JSON_A
 libxl_ms_vm_genid = Builtin("ms_vm_genid", passby=PASS_BY_REFERENCE, check_default_fn="libxl_ms_vm_genid_is_zero",
                             copy_fn="libxl_ms_vm_genid_copy")
 
+libxl_asyncop_how = Builtin("asyncop_how", passby=PASS_BY_CONST_REFERENCE)
+
 #
 # Specific integer types
 #
@@ -666,6 +668,24 @@ libxl_device_vfb = Struct("device_vfb", [
     ("keymap",        string),
     ])
 
+libxl_device_vfb_add = DeviceAddFunction("device_vfb_add",
+    device_param=("vfb", libxl_device_vfb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vfb_remove = DeviceRemoveFunction("device_vfb_remove",
+    device_param=("vfb", libxl_device_vfb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vfb_destroy = DeviceDestroyFunction("device_vfb_destroy",
+    device_param=("vfb", libxl_device_vfb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
@@ -684,6 +704,24 @@ libxl_device_vkb = Struct("device_vkb", [
     ("multi_touch_num_contacts", uint32)
     ])
 
+libxl_device_vkb_add = DeviceAddFunction("device_vkb_add",
+    device_param=("vkb", libxl_device_vkb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vkb_remove = DeviceRemoveFunction("device_vkb_remove",
+    device_param=("vkb", libxl_device_vkb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vkb_destroy = DeviceAddFunction("device_vkb_destroy",
+    device_param=("vkb", libxl_device_vkb),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
@@ -708,6 +746,24 @@ libxl_device_disk = Struct("device_disk", [
     ("hidden_disk", string)
     ])
 
+libxl_device_disk_add = DeviceAddFunction("device_disk_add",
+    device_param=("disk", libxl_device_disk),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_disk_remove = DeviceRemoveFunction("device_disk_remove",
+    device_param=("disk", libxl_device_disk),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_disk_destroy = DeviceDestroyFunction("device_disk_destroy",
+    device_param=("disk", libxl_device_disk),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_nic = Struct("device_nic", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
@@ -776,6 +832,24 @@ libxl_device_nic = Struct("device_nic", [
     ("colo_checkpoint_port", string)
     ])
 
+libxl_device_nic_add = DeviceAddFunction("device_nic_add",
+    device_param=("nic", libxl_device_nic),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_nic_remove = DeviceRemoveFunction("device_nic_remove",
+    device_param=("nic", libxl_device_nic),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_nic_destroy = DeviceDestroyFunction("device_nic_destroy",
+    device_param=("nic", libxl_device_nic),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_pci = Struct("device_pci", [
     ("func", uint8),
     ("dev", uint8),
@@ -791,6 +865,24 @@ libxl_device_pci = Struct("device_pci", [
     ("name", string),
     ])
 
+libxl_device_pci_add = DeviceAddFunction("device_pci_add",
+    device_param=("pci", libxl_device_pci),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_pci_remove = DeviceRemoveFunction("device_pci_remove",
+    device_param=("pci", libxl_device_pci),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_pci_destroy = DeviceDestroyFunction("device_pci_destroy",
+    device_param=("pci", libxl_device_pci),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_rdm = Struct("device_rdm", [
     ("start", uint64),
     ("size", uint64),
@@ -817,6 +909,26 @@ libxl_device_usbctrl = Struct("device_usbctrl", [
     ("backend_domname", string),
    ])
 
+libxl_device_usbctrl_add = DeviceAddFunction("device_usbctrl_add",
+    device_param=("usbctrl", libxl_device_usbctrl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_usbctrl_remove = DeviceRemoveFunction("device_usbctrl_remove",
+    device_param=("usbctrl", libxl_device_usbctrl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error,
+    custom_remove="usbctrl"
+)
+
+libxl_device_usbctrl_destroy = DeviceDestroyFunction("device_usbctrl_destroy",
+    device_param=("usbctrl", libxl_device_usbctrl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error,
+    custom_remove="usbctrl"
+)
+
 libxl_device_usbdev = Struct("device_usbdev", [
     ("ctrl", libxl_devid),
     ("port", integer),
@@ -827,6 +939,18 @@ libxl_device_usbdev = Struct("device_usbdev", [
            ])),
     ])
 
+libxl_device_usbdev_add = DeviceAddFunction("device_usbdev_add",
+    device_param=("usbdev", libxl_device_usbdev),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_usbdev_remove = DeviceRemoveFunction("device_usbdev_remove",
+    device_param=("usbdev", libxl_device_usbdev),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_dtdev = Struct("device_dtdev", [
     ("path", string),
     ])
@@ -838,6 +962,24 @@ libxl_device_vtpm = Struct("device_vtpm", [
     ("uuid",             libxl_uuid),
 ])
 
+libxl_device_vtpm_add = DeviceAddFunction("device_vtpm_add",
+    device_param=("vtpm", libxl_device_vtpm),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vtpm_remove = DeviceRemoveFunction("device_vtpm_remove",
+    device_param=("vtpm", libxl_device_vtpm),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vtpm_destroy = DeviceDestroyFunction("device_vtpm_destroy",
+    device_param=("vtpm", libxl_device_vtpm),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_p9 = Struct("device_p9", [
     ("backend_domid",    libxl_domid),
     ("backend_domname",  string),
@@ -847,12 +989,36 @@ libxl_device_p9 = Struct("device_p9", [
     ("devid",            libxl_devid),
 ])
 
+libxl_device_p9_remove = DeviceRemoveFunction("device_p9_remove",
+    device_param=("p9", libxl_device_p9),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_p9_destroy = DeviceDestroyFunction("device_p9_destroy",
+    device_param=("p9", libxl_device_p9),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_pvcallsif = Struct("device_pvcallsif", [
     ("backend_domid",    libxl_domid),
     ("backend_domname",  string),
     ("devid",            libxl_devid),
 ])
 
+libxl_device_pvcallsif_remove = DeviceRemoveFunction("device_pvcallsif_remove",
+    device_param=("pvcallsif", libxl_device_pvcallsif),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_pvcallsif_destroy = DeviceDestroyFunction("device_pvcallsif_destroy",
+    device_param=("pvcallsif", libxl_device_pvcallsif),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_device_channel = Struct("device_channel", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
@@ -879,6 +1045,24 @@ libxl_device_vdispl = Struct("device_vdispl", [
     ("connectors", Array(libxl_connector_param, "num_connectors"))
     ])
 
+libxl_device_vdispl_add = DeviceAddFunction("device_vdispl_add",
+    device_param=("vdispl", libxl_device_vdispl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vdispl_remove = DeviceRemoveFunction("device_vdispl_remove",
+    device_param=("vdispl", libxl_device_vdispl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vdispl_destroy = DeviceDestroyFunction("device_vdispl_destroy",
+    device_param=("vdispl", libxl_device_vdispl),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_vsnd_pcm_format = Enumeration("vsnd_pcm_format", [
     (1,  "S8"),
     (2,  "U8"),
@@ -942,6 +1126,24 @@ libxl_device_vsnd = Struct("device_vsnd", [
     ("pcms", Array(libxl_vsnd_pcm, "num_vsnd_pcms"))
     ])
 
+libxl_device_vsnd_add = DeviceAddFunction("device_vsnd_add",
+    device_param=("vsnd", libxl_device_vsnd),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vsnd_remove = DeviceRemoveFunction("device_vsnd_remove",
+    device_param=("vsnd", libxl_device_vsnd),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
+libxl_device_vsnd_destroy = DeviceDestroyFunction("device_vsnd_destroy",
+    device_param=("vsnd", libxl_device_vsnd),
+    extra_params=[("ao_how", libxl_asyncop_how)],
+    return_type=libxl_error
+)
+
 libxl_domain_config = Struct("domain_config", [
     ("c_info", libxl_domain_create_info),
     ("b_info", libxl_domain_build_info),
-- 
2.17.1



  parent reply	other threads:[~2021-03-03  1:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  1:46 [RFC v2 0/7] add function support to IDL Nick Rosbrook
2021-03-03  1:46 ` [RFC v2 1/7] libxl: remove extra whitespace from gentypes.py Nick Rosbrook
2021-05-04 14:39   ` Anthony PERARD
2021-03-03  1:46 ` [RFC v2 2/7] libxl: add Function class to IDL Nick Rosbrook
2021-03-03  1:46 ` [RFC v2 3/7] libxl: add PASS_BY_CONST_REFERENCE to idl Nick Rosbrook
2021-03-03  1:46 ` [RFC v2 4/7] libxl: add DeviceFunction classes to IDL Nick Rosbrook
2021-03-03  1:46 ` Nick Rosbrook [this message]
2021-05-04 15:43   ` [RFC v2 5/7] libxl: add device function definitions to libxl_types.idl Anthony PERARD
2021-05-04 17:26     ` Nick Rosbrook
2021-03-03  1:46 ` [RFC v2 6/7] libxl: implement device add/remove/destroy functions generation Nick Rosbrook
2021-05-04 15:02   ` Anthony PERARD
2021-05-04 17:29     ` Nick Rosbrook
2021-03-03  1:46 ` [RFC v2 7/7] libxl: replace LIBXL_DEFINE_DEVICE* macro usage with generated code Nick Rosbrook
2021-03-03  9:48 ` [RFC v2 0/7] add function support to IDL Ian Jackson
2021-03-03 13:41   ` Nick Rosbrook
2021-04-21 21:28     ` Nick Rosbrook
2021-05-04 15:46 ` Anthony PERARD
2021-05-04 17:31   ` Nick Rosbrook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd96b7e884c6f0c2667ef7499ff7179b99ea635.1614734296.git.rosbrookn@ainfosec.com \
    --to=rosbrookn@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=rosbrookn@ainfosec.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.