Re: [PATCH 33/34] qemu: driver: Refactor qemuDomainHelperGetVcpus

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

 



On Tue, Nov 24, 2015 at 07:56:19 -0500, John Ferlan wrote:
> On 11/20/2015 10:22 AM, Peter Krempa wrote:
> > Change some of the control structures and switch to using the new vcpu
> > structure.
> > ---
> >  src/qemu/qemu_driver.c | 77 ++++++++++++++++++++++++++++----------------------
> >  1 file changed, 43 insertions(+), 34 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> > index c659328..b9f8e72 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c

[...]

> > +
> > +    if (cpumaps)
> > +        memset(cpumaps, 0, sizeof(*cpumaps) * maxinfo);
> > +
> > +    for (i = 0; i < virDomainDefGetVCpusMax(vm->def) && ncpuinfo < maxinfo; i++) {
> 
> This line is longer than 80 cols.
> 
> > +        virDomainVCpuInfoPtr vcpu = virDomainDefGetVCpu(vm->def, i);
> > +        pid_t vcpupid = qemuDomainGetVCpuPid(vm, i);
> > +
> > +        if (!vcpu->online)
> > +            continue;
> 
> So if the goal is to eventually allow vcpu 0 & 2 of 4 vcpu's to be
> online, then this algorithm will need a slight adjustment.

Yes that's the goal.

> 
> Of course there's also the what if 'vcpupid == 0' that hasn't been
> checked here (comments from patch 32).
> 
> I "believe" what needs to be done is change the [i] below to [ncpuinfo]
> - that way the info & cpumaps would be returned with only the
> ONLINE/RUNNING vCPU's and 'info[]' won't have gaps which won't be
> accessible if a "2" is returned...  I think the same holds true for the
> VIR_GET_CPUMAP

Oh, yeah. I forgot to fix that when trying multiple approaches

Attachment: signature.asc
Description: Digital signature

--
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]