Re: [PATCH v2 6/9] remote: Implement virDomainGetState

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

 



On Tue, May 10, 2011 at 03:39:08PM +0200, Jiri Denemark wrote:
> ---
> Notes:
>     Version 2:
>     - rebased
>     - unsigned int flags
> 
>  daemon/remote_generator.pl |    3 ++-
>  src/remote/remote_driver.c |   35 ++++++++++++++++++++++++++++++++++-
>  2 files changed, 36 insertions(+), 2 deletions(-)
> 
> diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
> index ff279d5..736a352 100755
> --- a/daemon/remote_generator.pl
> +++ b/daemon/remote_generator.pl
> @@ -780,7 +780,8 @@ elsif ($opt_k) {
>                            "GetType",
>                            "NodeDeviceGetParent",
>                            "NodeGetSecurityModel",
> -                          "SecretGetValue");
> +                          "SecretGetValue",
> +                          "DomainGetState");
>      } elsif ($structprefix eq "qemu") {
>          @ungeneratable = ("MonitorCommand");
>      }

Also needs rebasing

> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index 90d95d6..e3bfa29 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -2324,6 +2324,39 @@ done:
>  }
>  
>  static int
> +remoteDomainGetState(virDomainPtr domain,
> +                     int *state,
> +                     int *reason,
> +                     unsigned int flags)
> +{
> +    int rv = -1;
> +    remote_domain_get_state_args args;
> +    remote_domain_get_state_ret ret;
> +    struct private_data *priv = domain->conn->privateData;
> +
> +    remoteDriverLock(priv);
> +
> +    make_nonnull_domain(&args.dom, domain);
> +    args.flags = flags;
> +
> +    memset(&ret, 0, sizeof ret);
> +    if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_STATE,
> +             (xdrproc_t) xdr_remote_domain_get_state_args, (char *) &args,
> +             (xdrproc_t) xdr_remote_domain_get_state_ret, (char *) &ret) == -1)
> +        goto done;
> +
> +    *state = ret.state;
> +    if (reason)
> +        *reason = ret.reason;
> +
> +    rv = 0;
> +
> +done:
> +    remoteDriverUnlock(priv);
> +    return rv;
> +}
> +
> +static int
>  remoteNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel)
>  {
>      remote_node_get_security_model_ret ret;
> @@ -6417,7 +6450,7 @@ static virDriver remote_driver = {
>      remoteDomainSetBlkioParameters, /* domainSetBlkioParameters */
>      remoteDomainGetBlkioParameters, /* domainGetBlkioParameters */
>      remoteDomainGetInfo, /* domainGetInfo */
> -    NULL, /* domainGetState */
> +    remoteDomainGetState, /* domainGetState */
>      remoteDomainSave, /* domainSave */
>      remoteDomainRestore, /* domainRestore */
>      remoteDomainCoreDump, /* domainCoreDump */

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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