mirror of https://gitee.com/openkylin/libvirt.git
esx: Add various vir*Flags API
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
eded8aad10
commit
cb55026732
|
@ -1984,7 +1984,9 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
|
esxDomainSetMemoryFlags(virDomainPtr domain,
|
||||||
|
unsigned long memory,
|
||||||
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
int result = -1;
|
int result = -1;
|
||||||
esxPrivate *priv = domain->conn->privateData;
|
esxPrivate *priv = domain->conn->privateData;
|
||||||
|
@ -1994,6 +1996,8 @@ esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
|
||||||
esxVI_TaskInfoState taskInfoState;
|
esxVI_TaskInfoState taskInfoState;
|
||||||
char *taskInfoErrorMessage = NULL;
|
char *taskInfoErrorMessage = NULL;
|
||||||
|
|
||||||
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
if (esxVI_EnsureSession(priv->primary) < 0)
|
if (esxVI_EnsureSession(priv->primary) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -2037,6 +2041,12 @@ esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
|
||||||
|
{
|
||||||
|
return esxDomainSetMemoryFlags(domain, memory, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libvirt exposed virtual CPU usage in absolute time, ESX doesn't provide this
|
* libvirt exposed virtual CPU usage in absolute time, ESX doesn't provide this
|
||||||
|
@ -5122,6 +5132,7 @@ static virHypervisorDriver esxHypervisorDriver = {
|
||||||
.domainGetMaxMemory = esxDomainGetMaxMemory, /* 0.7.0 */
|
.domainGetMaxMemory = esxDomainGetMaxMemory, /* 0.7.0 */
|
||||||
.domainSetMaxMemory = esxDomainSetMaxMemory, /* 0.7.0 */
|
.domainSetMaxMemory = esxDomainSetMaxMemory, /* 0.7.0 */
|
||||||
.domainSetMemory = esxDomainSetMemory, /* 0.7.0 */
|
.domainSetMemory = esxDomainSetMemory, /* 0.7.0 */
|
||||||
|
.domainSetMemoryFlags = esxDomainSetMemoryFlags, /* 5.6.0 */
|
||||||
.domainSetMemoryParameters = esxDomainSetMemoryParameters, /* 0.8.6 */
|
.domainSetMemoryParameters = esxDomainSetMemoryParameters, /* 0.8.6 */
|
||||||
.domainGetMemoryParameters = esxDomainGetMemoryParameters, /* 0.8.6 */
|
.domainGetMemoryParameters = esxDomainGetMemoryParameters, /* 0.8.6 */
|
||||||
.domainGetInfo = esxDomainGetInfo, /* 0.7.0 */
|
.domainGetInfo = esxDomainGetInfo, /* 0.7.0 */
|
||||||
|
|
Loading…
Reference in New Issue