Re: [PATCHv4 2/3] qemu: Set cpuset.cpus for domain process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/18/2013 12:49 PM, Peter Krempa wrote:
> From: Osier Yang <jyang@xxxxxxxxxx>
> 
> When either "cpuset" of <vcpu> is specified, or the "placement" of
> <vcpu> is "auto", only setting the cpuset.mems might cause the guest
> starting to fail. E.g. ("placement" of both <vcpu> and <numatune> is
> "auto"):
> 
[...]
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index fbe7e6f..0ccbff9 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
[...]
> @@ -652,9 +654,37 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm,
>          }
>      }
> 
> +    if (vm->def->cpumask ||
> +        (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)) {
> +
> +        if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
> +            virBitmapPtr cpumap = virCapabilitiesGetCpusForNodemask(caps, nodemask);

You don't check for error after this line and then ...

> +            cpu_mask = virBitmapFormat(cpumap);
> +            virBitmapFree(cpumap);
> +        } else {
> +            cpu_mask = virBitmapFormat(vm->def->cpumask);
> +        }
> +
> +        if (!cpu_mask) {
> +            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                           _("failed to convert memory nodemask"));

... rewrite it here in case it fails.  With an error about some fancy
"memory nodemask" of yours (copy-paste error) ;-)

ACK with these two nits fixed.

Martin

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]