Re: [libvirt] [PATCH v2 8/9] Implement cpuBaseline in remote and qemu drivers

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

 



On Thu, Feb 11, 2010 at 04:43:58PM +0100, Jiri Denemark wrote:
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_driver.c     |   15 ++++++++++++++-
>  src/remote/remote_driver.c |   33 ++++++++++++++++++++++++++++++++-
>  2 files changed, 46 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index e053be8..2a07a30 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -8499,6 +8499,19 @@ qemuCPUCompare(virConnectPtr conn,
>      return ret;
>  }
>  
> +static char *
> +qemuCPUBaseline(virConnectPtr conn ATTRIBUTE_UNUSED,
> +                const char **xmlCPUs,
> +                unsigned int ncpus,
> +                unsigned int flags ATTRIBUTE_UNUSED)
> +{
> +    char *cpu;
> +
> +    cpu = cpuBaselineXML(xmlCPUs, ncpus, NULL, 0);
> +
> +    return cpu;
> +}
> +
>  static virDriver qemuDriver = {
>      VIR_DRV_QEMU,
>      "QEMU",
> @@ -8577,7 +8590,7 @@ static virDriver qemuDriver = {
>      qemuDomainIsActive,
>      qemuDomainIsPersistent,
>      qemuCPUCompare, /* cpuCompare */
> -    NULL, /* cpuBaseline */
> +    qemuCPUBaseline, /* cpuBaseline */
>  };
>  
>  
> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index 05dea04..5dda414 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -7587,6 +7587,37 @@ done:
>      return rv;
>  }
>  
> +
> +static char *
> +remoteCPUBaseline(virConnectPtr conn,
> +                  const char **xmlCPUs,
> +                  unsigned int ncpus,
> +                  unsigned int flags)
> +{
> +    struct private_data *priv = conn->privateData;
> +    remote_cpu_baseline_args args;
> +    remote_cpu_baseline_ret ret;
> +    char *cpu = NULL;
> +
> +    remoteDriverLock(priv);
> +
> +    args.xmlCPUs.xmlCPUs_len = ncpus;
> +    args.xmlCPUs.xmlCPUs_val = (char **) xmlCPUs;
> +    args.flags = flags;
> +
> +    memset(&ret, 0, sizeof (ret));
> +    if (call(conn, priv, 0, REMOTE_PROC_CPU_BASELINE,
> +             (xdrproc_t) xdr_remote_cpu_baseline_args, (char *) &args,
> +             (xdrproc_t) xdr_remote_cpu_baseline_ret, (char *) &ret) == -1)
> +        goto done;
> +
> +    cpu = ret.cpu;
> +
> +done:
> +    remoteDriverUnlock(priv);
> +    return cpu;
> +}
> +
>  /*----------------------------------------------------------------------*/
>  
>  
> @@ -8977,7 +9008,7 @@ static virDriver remote_driver = {
>      remoteDomainIsActive, /* domainIsActive */
>      remoteDomainIsPersistent, /* domainIsPersistent */
>      remoteCPUCompare, /* cpuCompare */
> -    NULL, /* cpuBaseline */
> +    remoteCPUBaseline, /* cpuBaseline */
>  };
>  
>  static virNetworkDriver network_driver = {

 ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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