mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
inject-nmi: Implementing the public API
This commit is contained in:
parent
b19bd85e15
commit
9a1b5dc66f
@ -5216,6 +5216,50 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* virDomainInjectNMI:
|
||||
* @domain: pointer to domain object, or NULL for Domain0
|
||||
* @flags: the flags for controlling behavior, pass 0 for now
|
||||
*
|
||||
* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user