mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: Add helper to get pointer to a certain vCPU definition
Once more stuff will be moved into the vCPU data structure it will be necessary to get a specific one in some ocasions. Add a helper that will simplify this task.
This commit is contained in:
parent
24a7beea5a
commit
233c3ac861
@ -1374,6 +1374,21 @@ virDomainDefGetVcpus(const virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
virDomainVcpuInfoPtr
|
||||
virDomainDefGetVcpu(virDomainDefPtr def,
|
||||
unsigned int vcpu)
|
||||
{
|
||||
if (vcpu > def->maxvcpus) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("vCPU '%u' is not present in domain definition"),
|
||||
vcpu);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &def->vcpus[vcpu];
|
||||
}
|
||||
|
||||
|
||||
virDomainDiskDefPtr
|
||||
virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt)
|
||||
{
|
||||
|
@ -2356,6 +2356,8 @@ bool virDomainDefHasVcpusOffline(const virDomainDef *def);
|
||||
unsigned int virDomainDefGetVcpusMax(const virDomainDef *def);
|
||||
int virDomainDefSetVcpus(virDomainDefPtr def, unsigned int vcpus);
|
||||
unsigned int virDomainDefGetVcpus(const virDomainDef *def);
|
||||
virDomainVcpuInfoPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu)
|
||||
ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def);
|
||||
void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size);
|
||||
|
@ -217,6 +217,7 @@ virDomainDefGetDefaultEmulator;
|
||||
virDomainDefGetMemoryActual;
|
||||
virDomainDefGetMemoryInitial;
|
||||
virDomainDefGetSecurityLabelDef;
|
||||
virDomainDefGetVcpu;
|
||||
virDomainDefGetVcpus;
|
||||
virDomainDefGetVcpusMax;
|
||||
virDomainDefHasDeviceAddress;
|
||||
|
Loading…
x
Reference in New Issue
Block a user