mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
Convert virDomainVcpuPinIsDuplicate into virDomainPinIsDuplicate
Since both Vcpu and IOThreads code use the same API's, alter the naming of the API's to remove the "Vcpu" specific reference
This commit is contained in:
parent
c16723f606
commit
8cf80b517e
@ -13529,9 +13529,9 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
if (!vcpupin)
|
if (!vcpupin)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virDomainVcpuPinIsDuplicate(def->cputune.vcpupin,
|
if (virDomainPinIsDuplicate(def->cputune.vcpupin,
|
||||||
def->cputune.nvcpupin,
|
def->cputune.nvcpupin,
|
||||||
vcpupin->id)) {
|
vcpupin->id)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("duplicate vcpupin for same vcpu"));
|
"%s", _("duplicate vcpupin for same vcpu"));
|
||||||
virDomainPinDefFree(vcpupin);
|
virDomainPinDefFree(vcpupin);
|
||||||
@ -13560,9 +13560,9 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
for (i = 0; i < def->vcpus; i++) {
|
for (i = 0; i < def->vcpus; i++) {
|
||||||
if (virDomainVcpuPinIsDuplicate(def->cputune.vcpupin,
|
if (virDomainPinIsDuplicate(def->cputune.vcpupin,
|
||||||
def->cputune.nvcpupin,
|
def->cputune.nvcpupin,
|
||||||
i))
|
i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
virDomainPinDefPtr vcpupin = NULL;
|
virDomainPinDefPtr vcpupin = NULL;
|
||||||
@ -13621,9 +13621,9 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
if (!iothreadpin)
|
if (!iothreadpin)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virDomainVcpuPinIsDuplicate(def->cputune.iothreadspin,
|
if (virDomainPinIsDuplicate(def->cputune.iothreadspin,
|
||||||
def->cputune.niothreadspin,
|
def->cputune.niothreadspin,
|
||||||
iothreadpin->id)) {
|
iothreadpin->id)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("duplicate iothreadpin for same iothread"));
|
_("duplicate iothreadpin for same iothread"));
|
||||||
virDomainPinDefFree(iothreadpin);
|
virDomainPinDefFree(iothreadpin);
|
||||||
@ -16736,17 +16736,17 @@ virDomainDefAddImplicitControllers(virDomainDefPtr def)
|
|||||||
/* Check if vcpupin with same id already exists.
|
/* Check if vcpupin with same id already exists.
|
||||||
* Return 1 if exists, 0 if not. */
|
* Return 1 if exists, 0 if not. */
|
||||||
int
|
int
|
||||||
virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
|
virDomainPinIsDuplicate(virDomainPinDefPtr *def,
|
||||||
int nvcpupin,
|
int npin,
|
||||||
int vcpu)
|
int id)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!def || !nvcpupin)
|
if (!def || !npin)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < nvcpupin; i++) {
|
for (i = 0; i < npin; i++) {
|
||||||
if (def[i]->id == vcpu)
|
if (def[i]->id == id)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1913,9 +1913,9 @@ void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin);
|
|||||||
virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src,
|
virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src,
|
||||||
int npin);
|
int npin);
|
||||||
|
|
||||||
int virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
|
int virDomainPinIsDuplicate(virDomainPinDefPtr *def,
|
||||||
int nvcpupin,
|
int npin,
|
||||||
int vcpu);
|
int id);
|
||||||
|
|
||||||
virDomainPinDefPtr virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def,
|
virDomainPinDefPtr virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def,
|
||||||
int nvcpupin,
|
int nvcpupin,
|
||||||
|
@ -387,6 +387,7 @@ virDomainPausedReasonTypeToString;
|
|||||||
virDomainPinDefArrayFree;
|
virDomainPinDefArrayFree;
|
||||||
virDomainPinDefCopy;
|
virDomainPinDefCopy;
|
||||||
virDomainPinDefFree;
|
virDomainPinDefFree;
|
||||||
|
virDomainPinIsDuplicate;
|
||||||
virDomainPMSuspendedReasonTypeFromString;
|
virDomainPMSuspendedReasonTypeFromString;
|
||||||
virDomainPMSuspendedReasonTypeToString;
|
virDomainPMSuspendedReasonTypeToString;
|
||||||
virDomainRedirdevBusTypeFromString;
|
virDomainRedirdevBusTypeFromString;
|
||||||
@ -441,7 +442,6 @@ virDomainTPMModelTypeToString;
|
|||||||
virDomainVcpuPinAdd;
|
virDomainVcpuPinAdd;
|
||||||
virDomainVcpuPinDel;
|
virDomainVcpuPinDel;
|
||||||
virDomainVcpuPinFindByVcpu;
|
virDomainVcpuPinFindByVcpu;
|
||||||
virDomainVcpuPinIsDuplicate;
|
|
||||||
virDomainVideoDefaultRAM;
|
virDomainVideoDefaultRAM;
|
||||||
virDomainVideoDefaultType;
|
virDomainVideoDefaultType;
|
||||||
virDomainVideoDefFree;
|
virDomainVideoDefFree;
|
||||||
|
Loading…
Reference in New Issue
Block a user