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.
}
+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)
{
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);
virDomainDefGetMemoryActual;
virDomainDefGetMemoryInitial;
virDomainDefGetSecurityLabelDef;
+virDomainDefGetVcpu;
virDomainDefGetVcpus;
virDomainDefGetVcpusMax;
virDomainDefHasDeviceAddress;