mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
Replace virDomainIOThreadsPinAdd with virDomainPinAdd
This one is no longer necessary since the Vcpu and IOThreads API's share
This commit is contained in:
parent
cacf27f212
commit
01c8f66275
@ -16875,51 +16875,6 @@ virDomainEmulatorPinDel(virDomainDefPtr def)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
virDomainIOThreadsPinAdd(virDomainPinDefPtr **iothreadspin_list,
|
|
||||||
size_t *niothreadspin,
|
|
||||||
unsigned char *cpumap,
|
|
||||||
int maplen,
|
|
||||||
unsigned int iothread_id)
|
|
||||||
{
|
|
||||||
virDomainPinDefPtr iothreadpin = NULL;
|
|
||||||
|
|
||||||
if (!iothreadspin_list)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
iothreadpin = virDomainPinFind(*iothreadspin_list,
|
|
||||||
*niothreadspin,
|
|
||||||
iothread_id);
|
|
||||||
if (iothreadpin) {
|
|
||||||
iothreadpin->id = iothread_id;
|
|
||||||
virBitmapFree(iothreadpin->cpumask);
|
|
||||||
iothreadpin->cpumask = virBitmapNewData(cpumap, maplen);
|
|
||||||
if (!iothreadpin->cpumask)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* No existing iothreadpin matches iothread_id, adding a new one */
|
|
||||||
|
|
||||||
if (VIR_ALLOC(iothreadpin) < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
iothreadpin->id = iothread_id;
|
|
||||||
iothreadpin->cpumask = virBitmapNewData(cpumap, maplen);
|
|
||||||
if (!iothreadpin->cpumask)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (VIR_APPEND_ELEMENT(*iothreadspin_list, *niothreadspin, iothreadpin) < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
error:
|
|
||||||
virDomainPinDefFree(iothreadpin);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virDomainIOThreadsPinDel(virDomainDefPtr def,
|
virDomainIOThreadsPinDel(virDomainDefPtr def,
|
||||||
unsigned int iothread_id)
|
unsigned int iothread_id)
|
||||||
|
@ -2571,12 +2571,6 @@ int virDomainEmulatorPinAdd(virDomainDefPtr def,
|
|||||||
|
|
||||||
int virDomainEmulatorPinDel(virDomainDefPtr def);
|
int virDomainEmulatorPinDel(virDomainDefPtr def);
|
||||||
|
|
||||||
int virDomainIOThreadsPinAdd(virDomainPinDefPtr **iothreadspin_list,
|
|
||||||
size_t *niothreads,
|
|
||||||
unsigned char *cpumap,
|
|
||||||
int maplen,
|
|
||||||
unsigned int iothread_id);
|
|
||||||
|
|
||||||
void virDomainIOThreadsPinDel(virDomainDefPtr def,
|
void virDomainIOThreadsPinDel(virDomainDefPtr def,
|
||||||
unsigned int iothread_id);
|
unsigned int iothread_id);
|
||||||
|
|
||||||
|
@ -312,7 +312,6 @@ virDomainHubTypeToString;
|
|||||||
virDomainHypervTypeFromString;
|
virDomainHypervTypeFromString;
|
||||||
virDomainHypervTypeToString;
|
virDomainHypervTypeToString;
|
||||||
virDomainInputDefFree;
|
virDomainInputDefFree;
|
||||||
virDomainIOThreadsPinAdd;
|
|
||||||
virDomainIOThreadsPinDel;
|
virDomainIOThreadsPinDel;
|
||||||
virDomainLeaseDefFree;
|
virDomainLeaseDefFree;
|
||||||
virDomainLeaseIndex;
|
virDomainLeaseIndex;
|
||||||
|
@ -5997,8 +5997,8 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
|||||||
newIOThreadsPinNum = 0;
|
newIOThreadsPinNum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainIOThreadsPinAdd(&newIOThreadsPin, &newIOThreadsPinNum,
|
if (virDomainPinAdd(&newIOThreadsPin, &newIOThreadsPinNum,
|
||||||
cpumap, maplen, iothread_id) < 0) {
|
cpumap, maplen, iothread_id) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("failed to update iothreadspin"));
|
_("failed to update iothreadspin"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -6069,11 +6069,11 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
persistentDef->cputune.niothreadspin = 0;
|
persistentDef->cputune.niothreadspin = 0;
|
||||||
}
|
}
|
||||||
if (virDomainIOThreadsPinAdd(&persistentDef->cputune.iothreadspin,
|
if (virDomainPinAdd(&persistentDef->cputune.iothreadspin,
|
||||||
&persistentDef->cputune.niothreadspin,
|
&persistentDef->cputune.niothreadspin,
|
||||||
cpumap,
|
cpumap,
|
||||||
maplen,
|
maplen,
|
||||||
iothread_id) < 0) {
|
iothread_id) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("failed to update or add iothreadspin xml "
|
_("failed to update or add iothreadspin xml "
|
||||||
"of a persistent domain"));
|
"of a persistent domain"));
|
||||||
|
Loading…
Reference in New Issue
Block a user