All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>, pbonzini@redhat.com
Subject: Re: [PATCH 2/3] net: Restore printing of the help text with "-nic help"
Date: Thu, 10 Nov 2022 12:59:54 +0100	[thread overview]
Message-ID: <87f37780-910f-18ea-622f-d1157419de93@suse.de> (raw)
In-Reply-To: <082435f5-6a91-1418-1d27-9369e439854d@redhat.com>

On 11/10/22 12:35, Thomas Huth wrote:
> On 08/11/2022 10.43, Claudio Fontana wrote:
>> On 11/8/22 09:59, Thomas Huth wrote:
>>> On 08/11/2022 09.52, Claudio Fontana wrote:
>>>> On 11/8/22 09:42, Thomas Huth wrote:
>>>>> On 07/11/2022 13.27, Claudio Fontana wrote:
>>>>>> should -net and -netdev be adapted too?
>>>>>
>>>>> "-netdev help" already works just fine ... and "-net" should IMHO rather be
>>>>> removed than improved ;-)
>>>>>
>>>>>     Thomas
>>>>>
>>>>
>>>> I wonder if it could be done once for all, in net_init_clients,
>>>> instead of repeating the is_help_option in net_init_netdev and net_param_nic
>>>> (and that would take care of net_init_client too, so we'd get "net" for free)..
>>>
>>> I don't think that it makes too much sense to have one option for all -
>>> since all three CLI options are slightly different anyway. E.g. "-net nic"
>>> only exists for "-net", "hubport" cannot be used with "-net", "-nic" can
>>> also be used to configure the NIC model, etc.
>>>
>>>    Thomas
>>>
>>
>> Hi Thomas, I would not suggest to merge everything together,
>>
>> I was considering whether it would make sense to just check the "type" id for is_help_option
>> once, since all the options "net", "netdev", "nic" have a "type" implied_opt_name,
>>
>> and so it should be possible to make a list of structs that signify what to do for "net", "netdev", "nic", and
>> loop on that and check for that help string once,
>>
>> and then split off the codepath into the "net", "netdev", "nic" - specific code as it is now,
>> either manually or by storing the function that is now in the foreach as a function pointer in the struct, ie moving the is_help_option check one level up.
>>
>> However, it might not be worth it since it seems that for "nic" the nic models need to also be printed, so it might make things needlessly verbose.
>>
>> Not sure, have not tried to write the code for it.
> 
> Sorry, I currently fail to see how that should really work out nicely, so 
> I'll continue with my current patch. But feel free to write some patches, 
> maybe it's clearer to me if I see the code.
> 
>   Thomas
> 

No worries, maybe it's just too complex and not worth it.

Ciao,

C


  reply	other threads:[~2022-11-10 12:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 12:57 [PATCH 0/3] Fix the "-nic help" option Thomas Huth
2022-11-04 12:57 ` [PATCH 1/3] net: Move the code to collect available NIC models to a separate function Thomas Huth
2022-11-07 12:02   ` Claudio Fontana
2022-11-07 17:34   ` Alex Bennée
2022-11-10 10:35     ` Thomas Huth
2022-11-10 12:45       ` Thomas Huth
2022-11-04 12:57 ` [PATCH 2/3] net: Restore printing of the help text with "-nic help" Thomas Huth
2022-11-07 12:27   ` Claudio Fontana
2022-11-08  8:42     ` Thomas Huth
2022-11-08  8:52       ` Claudio Fontana
2022-11-08  8:59         ` Thomas Huth
2022-11-08  9:43           ` Claudio Fontana
2022-11-10 11:35             ` Thomas Huth
2022-11-10 11:59               ` Claudio Fontana [this message]
2022-11-08  9:49   ` Claudio Fontana
2022-11-10 11:42     ` Thomas Huth
2022-11-10 12:05       ` Claudio Fontana
2022-11-10 12:09         ` Claudio Fontana
2022-11-10 12:23         ` Thomas Huth
2022-11-10 13:05           ` Claudio Fontana
2022-11-04 12:57 ` [PATCH 3/3] net: Replace "Supported NIC models" with "Available NIC models" Thomas Huth
2022-11-07 12:27   ` Claudio Fontana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87f37780-910f-18ea-622f-d1157419de93@suse.de \
    --to=cfontana@suse.de \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.