diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ca02bb9493b0d2bf80f6dd22a5dfebe1316c0a0c..6b74f96d2976c6b82f8b802f00bed6f0439025d5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2003,11 +2003,11 @@ virDomainClockDefClear(virDomainClockDefPtr def) VIR_FREE(def->timers); } -virDomainVcpuPinDefPtr * -virDomainVcpuPinDefCopy(virDomainVcpuPinDefPtr *src, int nvcpupin) +virDomainPinDefPtr * +virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, int nvcpupin) { size_t i; - virDomainVcpuPinDefPtr *ret = NULL; + virDomainPinDefPtr *ret = NULL; if (VIR_ALLOC_N(ret, nvcpupin) < 0) goto error; @@ -2037,7 +2037,7 @@ virDomainVcpuPinDefCopy(virDomainVcpuPinDefPtr *src, int nvcpupin) } void -virDomainVcpuPinDefFree(virDomainVcpuPinDefPtr def) +virDomainVcpuPinDefFree(virDomainPinDefPtr def) { if (def) { virBitmapFree(def->cpumask); @@ -2046,7 +2046,7 @@ virDomainVcpuPinDefFree(virDomainVcpuPinDefPtr def) } void -virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def, +virDomainVcpuPinDefArrayFree(virDomainPinDefPtr *def, int nvcpupin) { size_t i; @@ -12759,14 +12759,14 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, * A vcpuid of -1 is valid and only valid for emulatorpin. So callers * have to check the returned cpuid for validity. */ -static virDomainVcpuPinDefPtr +static virDomainPinDefPtr virDomainVcpuPinDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, int maxvcpus, bool emulator, bool iothreads) { - virDomainVcpuPinDefPtr def; + virDomainPinDefPtr def; xmlNodePtr oldnode = ctxt->node; int vcpuid = -1; unsigned int iothreadid; @@ -13523,7 +13523,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; for (i = 0; i < n; i++) { - virDomainVcpuPinDefPtr vcpupin = NULL; + virDomainPinDefPtr vcpupin = NULL; vcpupin = virDomainVcpuPinDefParseXML(nodes[i], ctxt, def->maxvcpus, false, false); @@ -13566,7 +13566,7 @@ virDomainDefParseXML(xmlDocPtr xml, i)) continue; - virDomainVcpuPinDefPtr vcpupin = NULL; + virDomainPinDefPtr vcpupin = NULL; if (VIR_ALLOC(vcpupin) < 0) goto error; @@ -13615,7 +13615,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; for (i = 0; i < n; i++) { - virDomainVcpuPinDefPtr iothreadpin = NULL; + virDomainPinDefPtr iothreadpin = NULL; iothreadpin = virDomainVcpuPinDefParseXML(nodes[i], ctxt, def->iothreads, false, true); @@ -16737,7 +16737,7 @@ virDomainDefAddImplicitControllers(virDomainDefPtr def) /* Check if vcpupin with same vcpuid already exists. * Return 1 if exists, 0 if not. */ int -virDomainVcpuPinIsDuplicate(virDomainVcpuPinDefPtr *def, +virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def, int nvcpupin, int vcpu) { @@ -16754,8 +16754,8 @@ virDomainVcpuPinIsDuplicate(virDomainVcpuPinDefPtr *def, return 0; } -virDomainVcpuPinDefPtr -virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def, +virDomainPinDefPtr +virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def, int nvcpupin, int vcpu) { @@ -16773,13 +16773,13 @@ virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def, } int -virDomainVcpuPinAdd(virDomainVcpuPinDefPtr **vcpupin_list, +virDomainVcpuPinAdd(virDomainPinDefPtr **vcpupin_list, size_t *nvcpupin, unsigned char *cpumap, int maplen, int vcpu) { - virDomainVcpuPinDefPtr vcpupin = NULL; + virDomainPinDefPtr vcpupin = NULL; if (!vcpupin_list) return -1; @@ -16821,7 +16821,7 @@ void virDomainVcpuPinDel(virDomainDefPtr def, int vcpu) { int n; - virDomainVcpuPinDefPtr *vcpupin_list = def->cputune.vcpupin; + virDomainPinDefPtr *vcpupin_list = def->cputune.vcpupin; for (n = 0; n < def->cputune.nvcpupin; n++) { if (vcpupin_list[n]->vcpuid == vcpu) { @@ -16838,7 +16838,7 @@ virDomainEmulatorPinAdd(virDomainDefPtr def, unsigned char *cpumap, int maplen) { - virDomainVcpuPinDefPtr emulatorpin = NULL; + virDomainPinDefPtr emulatorpin = NULL; if (!def->cputune.emulatorpin) { /* No emulatorpin exists yet. */ @@ -16879,14 +16879,13 @@ virDomainEmulatorPinDel(virDomainDefPtr def) } int -virDomainIOThreadsPinAdd(virDomainVcpuPinDefPtr **iothreadspin_list, +virDomainIOThreadsPinAdd(virDomainPinDefPtr **iothreadspin_list, size_t *niothreadspin, unsigned char *cpumap, int maplen, unsigned int iothread_id) { - /* IOThreads share the virDomainVcpuPinDefPtr */ - virDomainVcpuPinDefPtr iothreadpin = NULL; + virDomainPinDefPtr iothreadpin = NULL; if (!iothreadspin_list) return -1; @@ -16929,8 +16928,7 @@ virDomainIOThreadsPinDel(virDomainDefPtr def, unsigned int iothread_id) { size_t i; - /* IOThreads share the virDomainVcpuPinDefPtr */ - virDomainVcpuPinDefPtr *iothreadspin_list = def->cputune.iothreadspin; + virDomainPinDefPtr *iothreadspin_list = def->cputune.iothreadspin; for (i = 0; i < def->cputune.niothreadspin; i++) { if (iothreadspin_list[i]->vcpuid == iothread_id) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 319ec646ea62b16a466d4e85855fe0826cf371fa..a06f4ac48b7dd7abd0e6ba753e972f4e084fb88d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1900,26 +1900,26 @@ struct _virDomainClockDef { # define VIR_DOMAIN_CPUMASK_LEN 1024 -typedef struct _virDomainVcpuPinDef virDomainVcpuPinDef; -typedef virDomainVcpuPinDef *virDomainVcpuPinDefPtr; -struct _virDomainVcpuPinDef { +typedef struct _virDomainPinDef virDomainPinDef; +typedef virDomainPinDef *virDomainPinDefPtr; +struct _virDomainPinDef { int vcpuid; virBitmapPtr cpumask; }; -void virDomainVcpuPinDefFree(virDomainVcpuPinDefPtr def); -void virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def, int nvcpupin); +void virDomainVcpuPinDefFree(virDomainPinDefPtr def); +void virDomainVcpuPinDefArrayFree(virDomainPinDefPtr *def, int nvcpupin); -virDomainVcpuPinDefPtr *virDomainVcpuPinDefCopy(virDomainVcpuPinDefPtr *src, - int nvcpupin); +virDomainPinDefPtr *virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, + int nvcpupin); -int virDomainVcpuPinIsDuplicate(virDomainVcpuPinDefPtr *def, +int virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def, int nvcpupin, int vcpu); -virDomainVcpuPinDefPtr virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def, - int nvcpupin, - int vcpu); +virDomainPinDefPtr virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def, + int nvcpupin, + int vcpu); typedef struct _virBlkioDevice virBlkioDevice; typedef virBlkioDevice *virBlkioDevicePtr; @@ -2009,10 +2009,10 @@ struct _virDomainCputune { unsigned long long emulator_period; long long emulator_quota; size_t nvcpupin; - virDomainVcpuPinDefPtr *vcpupin; - virDomainVcpuPinDefPtr emulatorpin; + virDomainPinDefPtr *vcpupin; + virDomainPinDefPtr emulatorpin; size_t niothreadspin; - virDomainVcpuPinDefPtr *iothreadspin; + virDomainPinDefPtr *iothreadspin; size_t nvcpusched; virDomainThreadSchedParamPtr vcpusched; @@ -2557,7 +2557,7 @@ int virDomainDefCompatibleDevice(virDomainDefPtr def, virDomainDeviceDefPtr dev, virDomainDeviceAction action); -int virDomainVcpuPinAdd(virDomainVcpuPinDefPtr **vcpupin_list, +int virDomainVcpuPinAdd(virDomainPinDefPtr **vcpupin_list, size_t *nvcpupin, unsigned char *cpumap, int maplen, @@ -2571,8 +2571,7 @@ int virDomainEmulatorPinAdd(virDomainDefPtr def, int virDomainEmulatorPinDel(virDomainDefPtr def); -/* IOThreads share the virDomainVcpuPinDefPtr */ -int virDomainIOThreadsPinAdd(virDomainVcpuPinDefPtr **iothreadspin_list, +int virDomainIOThreadsPinAdd(virDomainPinDefPtr **iothreadspin_list, size_t *niothreads, unsigned char *cpumap, int maplen, diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index f4491d0b366d6b9b441a4d2b0639c6a99ad2482e..4a233edabff763cd204f6e07efad359c8f878ca3 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2047,7 +2047,7 @@ libxlDomainGetVcpuPinInfo(virDomainPtr dom, int ncpumaps, libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); virDomainObjPtr vm = NULL; virDomainDefPtr targetDef = NULL; - virDomainVcpuPinDefPtr *vcpupin_list; + virDomainPinDefPtr *vcpupin_list; virBitmapPtr cpumask = NULL; int maxcpu, hostcpus, vcpu, pcpu, n, ret = -1; unsigned char *cpumap; diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 2b5a1828741b1e07614d9f6b116320f15d5a945e..260c3c52192892b7eb35017a0e7fe0c44d303281 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -941,7 +941,7 @@ qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - virDomainVcpuPinDefPtr *vcpupin, + virDomainPinDefPtr *vcpupin, int nvcpupin, int vcpuid) { @@ -957,7 +957,7 @@ qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, int qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup, - virDomainVcpuPinDefPtr *iothreadspin, + virDomainPinDefPtr *iothreadspin, int niothreadspin, int iothreadid) { diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index a5d9c49d27633dfc6e1ef4823da9be11a22cff80..b311af31489dc5cd515f4330fa15ae140a0d80d4 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -53,12 +53,12 @@ int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, unsigned long long period, long long quota); int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - virDomainVcpuPinDefPtr *vcpupin, + virDomainPinDefPtr *vcpupin, int nvcpupin, int vcpuid); int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, virBitmapPtr cpumask); int qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup, - virDomainVcpuPinDefPtr *iothreadspin, + virDomainPinDefPtr *iothreadspin, int niothreadspin, int iothreadid); int qemuSetupCgroupForVcpu(virDomainObjPtr vm); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 65160effce33c51db9c449dc963c278cc6c04463..c5dc5a8eccbb3f7275b4e57df700c890f8f3415f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4744,7 +4744,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, /* vm->def->cputune.vcpupin can't be NULL if * vm->def->cpumask is not NULL. */ - virDomainVcpuPinDefPtr vcpupin = NULL; + virDomainPinDefPtr vcpupin = NULL; if (VIR_ALLOC(vcpupin) < 0) goto cleanup; @@ -5046,7 +5046,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, qemuDomainObjPrivatePtr priv; bool doReset = false; size_t newVcpuPinNum = 0; - virDomainVcpuPinDefPtr *newVcpuPin = NULL; + virDomainPinDefPtr *newVcpuPin = NULL; virBitmapPtr pcpumap = NULL; virQEMUDriverConfigPtr cfg = NULL; virCapsPtr caps = NULL; @@ -5283,7 +5283,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, goto cleanup; for (vcpu = 0; vcpu < ncpumaps; vcpu++) { - virDomainVcpuPinDefPtr pininfo; + virDomainPinDefPtr pininfo; virBitmapPtr bitmap = NULL; unsigned char *tmpmap = NULL; int tmpmaplen; @@ -5336,7 +5336,7 @@ qemuDomainPinEmulator(virDomainPtr dom, qemuDomainObjPrivatePtr priv; bool doReset = false; size_t newVcpuPinNum = 0; - virDomainVcpuPinDefPtr *newVcpuPin = NULL; + virDomainPinDefPtr *newVcpuPin = NULL; virBitmapPtr pcpumap = NULL; virQEMUDriverConfigPtr cfg = NULL; virCapsPtr caps = NULL; @@ -5815,7 +5815,7 @@ qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef, goto cleanup; for (i = 0; i < targetDef->iothreads; i++) { - virDomainVcpuPinDefPtr pininfo; + virDomainPinDefPtr pininfo; if (VIR_ALLOC(info_ret[i]) < 0) goto cleanup; @@ -5920,7 +5920,7 @@ qemuDomainPinIOThread(virDomainPtr dom, virDomainDefPtr persistentDef = NULL; virBitmapPtr pcpumap = NULL; qemuDomainObjPrivatePtr priv; - virDomainVcpuPinDefPtr *newIOThreadsPin = NULL; + virDomainPinDefPtr *newIOThreadsPin = NULL; size_t newIOThreadsPinNum = 0; virCgroupPtr cgroup_iothread = NULL; virObjectEventPtr event = NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2b4de310a729d7795d043a10598d8447916c20e3..51cae97c29c420b9b741993b29910b83414cfeeb 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2413,7 +2413,7 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm) { qemuDomainObjPrivatePtr priv = vm->privateData; virDomainDefPtr def = vm->def; - virDomainVcpuPinDefPtr pininfo; + virDomainPinDefPtr pininfo; int n; int ret = -1; VIR_DEBUG("Setting affinity on CPUs nvcpupin=%zu nvcpus=%d nvcpupids=%d", @@ -2479,7 +2479,7 @@ qemuProcessSetIOThreadsAffinity(virDomainObjPtr vm) { qemuDomainObjPrivatePtr priv = vm->privateData; virDomainDefPtr def = vm->def; - virDomainVcpuPinDefPtr pininfo; + virDomainPinDefPtr pininfo; size_t i; int ret = -1;