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

Re: [libvirt] [PATCH 3/6 V3] inject-nmi: Implementing the public API



On Thu, Apr 21, 2011 at 02:42:58PM +0800, Lai Jiangshan wrote:
> 
> 
> Signed-off-by: Lai Jiangshan <laijs cn fujitsu com>
> ---
>  src/libvirt.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 44 insertions(+), 0 deletions(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index 9e6784b..32446d1 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -5214,6 +5214,50 @@ error:
>  }
>  
>  /**
> + * virDomainInjectNMI:
> + * @domain: pointer to domain object, or NULL for Domain0
> + * @flags:  the flags for controlling behaviours
> + *
> + * Send NMI to the guest
> + *
> + * Returns 0 in case of success, -1 in case of failure.
> + */
> +
> +int virDomainInjectNMI(virDomainPtr domain, unsigned int flags)
> +{
> +    virConnectPtr conn;
> +    VIR_DOMAIN_DEBUG(domain, "flags=%u", flags);
> +
> +    virResetLastError();
> +
> +    if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
> +        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
> +        virDispatchError(NULL);
> +        return (-1);
> +    }
> +    if (domain->conn->flags & VIR_CONNECT_RO) {
> +        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
> +        goto error;
> +    }
> +
> +    conn = domain->conn;
> +
> +    if (conn->driver->domainInjectNMI) {
> +        int ret;
> +        ret = conn->driver->domainInjectNMI(domain, flags);
> +        if (ret < 0)
> +            goto error;
> +        return ret;
> +    }
> +
> +    virLibConnError (VIR_ERR_NO_SUPPORT, __FUNCTION__);
> +
> +error:
> +    virDispatchError(domain->conn);
> +    return -1;
> +}
> +
> +/**
>   * virDomainSetVcpus:
>   * @domain: pointer to domain object, or NULL for Domain0
>   * @nvcpus: the new number of virtual CPUs for this domain

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


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