Re: [PATCH v4 3/6] nodedev: Introduce new mdev_types and mdev nodedev capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 05/15/2017 08:10 AM, Erik Skultety wrote:
> The reason for introducing two capabilities, one for the device itself
> (cap 'mdev') and one for the parent device listing the available types
> ('mdev_types'), is that we should be able to do
> 'virsh nodedev-list --cap' not only for existing mdev devices but also
> for devices that support creation of mdev devices, since one day libvirt
> might be actually able to create the mdev devices in an automated way
> (just like we do for NPIV/vHBA).
> 
> Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
> ---
>  include/libvirt/libvirt-nodedev.h    |  2 ++
>  src/conf/node_device_conf.c          | 10 +++++++++-
>  src/conf/node_device_conf.h          |  6 +++++-
>  src/conf/virnodedeviceobj.c          |  4 +++-
>  src/libvirt-nodedev.c                |  2 ++
>  src/node_device/node_device_driver.c |  2 ++
>  src/node_device/node_device_udev.c   |  3 +++
>  tools/virsh-nodedev.c                |  6 ++++++
>  8 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-nodedev.h
> index 85003903d..1e3043787 100644
> --- a/include/libvirt/libvirt-nodedev.h
> +++ b/include/libvirt/libvirt-nodedev.h
> @@ -79,6 +79,8 @@ typedef enum {
>      VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS        = 1 << 10, /* Capable of vport */
>      VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC  = 1 << 11, /* Capable of scsi_generic */
>      VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM           = 1 << 12, /* DRM device */
> +    VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES    = 1 << 13, /* Capable of mediated devices */
> +    VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV          = 1 << 14, /* Mediated device */
>  } virConnectListAllNodeDeviceFlags;
>  
>  int                     virConnectListAllNodeDevices (virConnectPtr conn,
> diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
> index 7aab2e03c..40d71f277 100644
> --- a/src/conf/node_device_conf.c
> +++ b/src/conf/node_device_conf.c
> @@ -60,7 +60,9 @@ VIR_ENUM_IMPL(virNodeDevCap, VIR_NODE_DEV_CAP_LAST,
>                "fc_host",
>                "vports",
>                "scsi_generic",
> -              "drm")
> +              "drm",
> +              "mdev_types",
> +              "mdev")
>  

Should I mention this is doing two things at one time ;-), nah,
nevermind ;-)

>  VIR_ENUM_IMPL(virNodeDevNetCap, VIR_NODE_DEV_CAP_NET_LAST,
>                "80203",
> @@ -540,6 +542,8 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def)
>          case VIR_NODE_DEV_CAP_DRM:
>              virBufferEscapeString(&buf, "<type>%s</type>\n", virNodeDevDRMTypeToString(data->drm.type));
>              break;
> +        case VIR_NODE_DEV_CAP_MDEV:
> +        case VIR_NODE_DEV_CAP_MDEV_TYPES:
>          case VIR_NODE_DEV_CAP_FC_HOST:
>          case VIR_NODE_DEV_CAP_VPORTS:
>          case VIR_NODE_DEV_CAP_LAST:
> @@ -1612,6 +1616,8 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt,
>      case VIR_NODE_DEV_CAP_DRM:
>          ret = virNodeDevCapDRMParseXML(ctxt, def, node, &caps->data.drm);
>          break;
> +    case VIR_NODE_DEV_CAP_MDEV:
> +    case VIR_NODE_DEV_CAP_MDEV_TYPES:
>      case VIR_NODE_DEV_CAP_FC_HOST:
>      case VIR_NODE_DEV_CAP_VPORTS:
>      case VIR_NODE_DEV_CAP_SCSI_GENERIC:
> @@ -1930,6 +1936,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps)
>      case VIR_NODE_DEV_CAP_SCSI_GENERIC:
>          VIR_FREE(data->sg.path);
>          break;
> +    case VIR_NODE_DEV_CAP_MDEV:
> +    case VIR_NODE_DEV_CAP_MDEV_TYPES:
>      case VIR_NODE_DEV_CAP_DRM:
>      case VIR_NODE_DEV_CAP_FC_HOST:
>      case VIR_NODE_DEV_CAP_VPORTS:
> diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
> index a5d5cdd2a..273d49f76 100644
> --- a/src/conf/node_device_conf.h
> +++ b/src/conf/node_device_conf.h
> @@ -64,6 +64,8 @@ typedef enum {
>      VIR_NODE_DEV_CAP_VPORTS,		/* HBA which is capable of vports */
>      VIR_NODE_DEV_CAP_SCSI_GENERIC,      /* SCSI generic device */
>      VIR_NODE_DEV_CAP_DRM,               /* DRM device */
> +    VIR_NODE_DEV_CAP_MDEV_TYPES,      /* Device capable of mediated devices */
> +    VIR_NODE_DEV_CAP_MDEV,            /* Mediated device */

Since the comments are aligned vertically, you should follow that too.

When I look at these w/ vim or via gitk, it's obvious that the comments
above are a mix of spaces and tabs to align them (sigh).

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John

>  
>      VIR_NODE_DEV_CAP_LAST
>  } virNodeDevCapType;

[...]

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux