Re: [PATCH 3/3] virsh: Provide completer for PCI backend drivers

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

 



On 4/2/22 12:31, Amneesh Singh wrote:
> Related: https://gitlab.com/libvirt/libvirt/-/issues/9
> Signed-off-by: Amneesh Singh <natto@xxxxxxxxxxxxx>
> ---
>  tools/virsh-completer-nodedev.c | 11 +++++++++++
>  tools/virsh-completer-nodedev.h |  4 ++++
>  tools/virsh-nodedev.c           |  2 ++
>  3 files changed, 17 insertions(+)
> 
> diff --git a/tools/virsh-completer-nodedev.c b/tools/virsh-completer-nodedev.c
> index bf6e809..58f0a9d 100644
> --- a/tools/virsh-completer-nodedev.c
> +++ b/tools/virsh-completer-nodedev.c
> @@ -23,6 +23,7 @@
>  #include "virsh-completer-nodedev.h"
>  #include "virsh-util.h"
>  #include "conf/node_device_conf.h"
> +#include "conf/domain_conf.h"
>  #include "viralloc.h"
>  #include "virsh-nodedev.h"
>  #include "virsh.h"
> @@ -102,3 +103,13 @@ virshNodeDeviceCapabilityNameCompleter(vshControl *ctl,
>  
>      return virshCommaStringListComplete(cap_str, (const char **)tmp);
>  }
> +
> +char **virshNodeDevicePCIBackendCompleter(vshControl *ctl G_GNUC_UNUSED,
> +                                          const vshCmd *cmd G_GNUC_UNUSED,
> +                                          unsigned int flags)

Formatting.

> +{
> +    virCheckFlags(0, NULL);
> +
> +    return virshEnumComplete(VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST,
> +                             virDomainHostdevSubsysPCIBackendTypeToString);

Initially I wanted to suggest using virPCIStubDriver and
virPCIStubDriverTypeToString, but that's not really how
virDomainDriverNodeDeviceDetachFlags() translates the string either. So
your code is okay.

Michal




[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