Re: [PATCH v3 6/7] virsh: add function to get the CPU models for an arch

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

 



On 09/11/2013 08:13 AM, Giuseppe Scrivano wrote:
> Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
> ---
>  tools/virsh-host.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tools/virsh.pod    |  5 +++++
>  2 files changed, 59 insertions(+)
> 
> +
> +static bool
> +cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
> +{
> +    char **models;
> +    size_t i;
> +    int nmodels;
> +    const char *arch = NULL;
> +
> +    if (vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0)

ATTRIBUTE_UNUSED is a lie - we just used it :)

> +        return false;
> +
> +    nmodels = virConnectGetCPUModelNames(ctl->conn, arch, &models, 0);

I tweaked this some during my testing of NULL models; but don't think we
need to make virsh expose NULL models to the command line, so I'm not
changing this.

ACK with this squashed in (oh, I just noticed my emacs'
copyright-checker kicked in for my edits; I wonder how many other files
you touched that could use an updated copyright):

diff --git i/tools/virsh-host.c w/tools/virsh-host.c
index 5d47428..30940ad 100644
--- i/tools/virsh-host.c
+++ w/tools/virsh-host.c
@@ -1,7 +1,7 @@
 /*
  * virsh-host.c: Commands in "Host and Hypervisor" group.
  *
- * Copyright (C) 2005, 2007-2012 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -649,7 +649,7 @@ static const vshCmdOptDef opts_cpu_models[] = {
 };

 static bool
-cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
+cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd)
 {
     char **models;
     size_t i;


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]