mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: Refactor cpumask handling
Declare local variables at the start of the block and fix trivial formatting issues.
This commit is contained in:
parent
00a9da9b88
commit
2a60ce323b
@ -14463,9 +14463,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
def->cputune.emulator_quota);
|
def->cputune.emulator_quota);
|
||||||
|
|
||||||
for (i = 0; i < def->cputune.nvcpupin; i++) {
|
for (i = 0; i < def->cputune.nvcpupin; i++) {
|
||||||
/* Ignore the vcpupin which inherit from "cpuset"
|
char *cpumask;
|
||||||
* of "<vcpu>."
|
/* Ignore the vcpupin which inherit from "cpuset of "<vcpu>." */
|
||||||
*/
|
|
||||||
if (def->cpumask &&
|
if (def->cpumask &&
|
||||||
virBitmapEqual(def->cpumask,
|
virBitmapEqual(def->cpumask,
|
||||||
def->cputune.vcpupin[i]->cpumask))
|
def->cputune.vcpupin[i]->cpumask))
|
||||||
@ -14474,10 +14473,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
virBufferAsprintf(buf, " <vcpupin vcpu='%u' ",
|
virBufferAsprintf(buf, " <vcpupin vcpu='%u' ",
|
||||||
def->cputune.vcpupin[i]->vcpuid);
|
def->cputune.vcpupin[i]->vcpuid);
|
||||||
|
|
||||||
char *cpumask = NULL;
|
if (!(cpumask = virBitmapFormat(def->cputune.vcpupin[i]->cpumask))) {
|
||||||
cpumask = virBitmapFormat(def->cputune.vcpupin[i]->cpumask);
|
|
||||||
|
|
||||||
if (cpumask == NULL) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("failed to format cpuset for vcpupin"));
|
"%s", _("failed to format cpuset for vcpupin"));
|
||||||
goto error;
|
goto error;
|
||||||
@ -14488,11 +14484,10 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (def->cputune.emulatorpin) {
|
if (def->cputune.emulatorpin) {
|
||||||
|
char *cpumask;
|
||||||
virBufferAsprintf(buf, " <emulatorpin ");
|
virBufferAsprintf(buf, " <emulatorpin ");
|
||||||
|
|
||||||
char *cpumask = NULL;
|
if (!(cpumask = virBitmapFormat(def->cputune.emulatorpin->cpumask))) {
|
||||||
cpumask = virBitmapFormat(def->cputune.emulatorpin->cpumask);
|
|
||||||
if (cpumask == NULL) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("failed to format cpuset for emulator"));
|
"%s", _("failed to format cpuset for emulator"));
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user