Re: [Qemu-devel] [PATCH v2] vl.c: Support multiple CPU ranges on -numa option

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

 



Markus Armbruster <armbru@xxxxxxxxxx> writes:

> Anthony Liguori <anthony@xxxxxxxxxxxxx> writes:
>
>> Paolo Bonzini <pbonzini@xxxxxxxxxx> writes:
>>
>>                                                 What about:
>>
>> [numa]
>> node=1
>> cpus=2
>> cpus=3
>>
>> qemu -readconfig numa.cfg -numa node=1,cpus=1
>
> I figure you mean
>
>     [numa]
>     nodeid=1
>     cpus=2
>     cpus=3
>
>     qemu -readconfig numa.cfg -numa node,nodeid=1,cpus=1
>
> The config file configures node 1 to use cpus 2 and 3.
>
> The command line configures node 1 to use cpus 1.
>
> QemuOpts can optionally be made to merge options with the same ID.  We
> use that in cases like -machine, where multiple options make no sense,
> but merging them does.

With QemuOpts, this is treated as two distinct sections with anonymous
ids so whatever the code is to handle NUMA options would get called
twice and it's up to that code to determine how it handles the
conflict.  (This is admittedly irrelevant to the discussion.)

> Merging options doesn't make sense for -numa.  Therefore, configuration
> file and command line are *not* merged.  In particular, the two cpus
> lists are not merged.
>
> So, what we have is two conflicting bits of configuration for the same
> thing.  That's not a new problem, we got that everywhere.  Either treat
> as error, or let the last one win.  Matter of taste.  Currently, we do
> the latter.
>
>> I'm pretty sure you won't be able to say without looking at the source
>> code.
>
> I hereby certify that I did not look at the source code, only at help
> output.  So there.
>
>> Now what about ranges?  I'm pretty sure that what a user really wants to
>> say is:
>>
>> qemu -numa node=1,cpus=0-3:8-11
>>
>> This is easy to do with the patch I sent.  We can add range support
>> integer lists by just adding a check for '-' before doing dispatch.
>> That's a heck of a lot nicer than:
>>
>> qemu -numa
>> node=1,cpus=0,cpus=1,cpus=2,cpus=3,cpus=8,cpus=9,cpus=10,cpus=11
>
> Let me pick up the baby you just threw out with the bathwater for you:
>
>     qemu -numa node,nodeid=1,cpus=0-3,cpus=8-11

If you're okay with making '-' be special syntax, why are you not okay
with ':' being special syntax?

What I assume your proposing is making cpus be a string list and then
parsing within the NUMA code.  Why not do it all in QemuOpts core code?

Regards,

Anthony Liguori

>
>> With respect to escaping, for string lists (the only place where this
>> point is even relevant), we can simply support escaping.  But I'd like
>> to hear a use-case for a string list first.
>
> There is no need for the syntactic warts you so cavalierly propose.
> Whenever you do key=X:Y, I can do key=X,key=Y.  Whatever semantics you
> propose for the former, I'll propose for the latter.

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