mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
hyperv: remove duplicate function hypervGetMemSDByVSSDInstanceId()
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e08393e339
commit
a7fc186fd2
@ -246,31 +246,6 @@ hypervGetProcSDByVSSDInstanceId(hypervPrivate *priv, const char *id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervGetMemSDByVSSDInstanceId(hypervPrivate *priv, const char *id,
|
|
||||||
Msvm_MemorySettingData **data)
|
|
||||||
{
|
|
||||||
g_auto(virBuffer) query = VIR_BUFFER_INITIALIZER;
|
|
||||||
virBufferEscapeSQL(&query,
|
|
||||||
"ASSOCIATORS OF {Msvm_VirtualSystemSettingData.InstanceID='%s'} "
|
|
||||||
"WHERE AssocClass = Msvm_VirtualSystemSettingDataComponent "
|
|
||||||
"ResultClass = Msvm_MemorySettingData",
|
|
||||||
id);
|
|
||||||
|
|
||||||
if (hypervGetWmiClass(Msvm_MemorySettingData, data) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!*data) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Could not look up memory setting data with virtual system instance ID '%s'"),
|
|
||||||
id);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
hypervRequestStateChange(virDomainPtr domain, int state)
|
hypervRequestStateChange(virDomainPtr domain, int state)
|
||||||
{
|
{
|
||||||
@ -1082,11 +1057,10 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hypervGetMemSDByVSSDInstanceId(priv,
|
if (hypervGetMsvmMemorySettingDataFromVSSD(priv,
|
||||||
virtualSystemSettingData->data.common->InstanceID,
|
virtualSystemSettingData->data.common->InstanceID,
|
||||||
&memorySettingData) < 0) {
|
&memorySettingData) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill struct */
|
/* Fill struct */
|
||||||
info->state = hypervMsvmComputerSystemEnabledStateToDomainState(computerSystem);
|
info->state = hypervMsvmComputerSystemEnabledStateToDomainState(computerSystem);
|
||||||
@ -1167,11 +1141,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hypervGetMemSDByVSSDInstanceId(priv,
|
if (hypervGetMsvmMemorySettingDataFromVSSD(priv,
|
||||||
virtualSystemSettingData->data.common->InstanceID,
|
virtualSystemSettingData->data.common->InstanceID,
|
||||||
&memorySettingData) < 0) {
|
&memorySettingData) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill struct */
|
/* Fill struct */
|
||||||
def->virtType = VIR_DOMAIN_VIRT_HYPERV;
|
def->virtType = VIR_DOMAIN_VIRT_HYPERV;
|
||||||
|
Loading…
Reference in New Issue
Block a user