* [Qemu-devel] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth"
@ 2018-03-09 7:01 Thomas Huth
2018-03-09 7:36 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2018-03-09 8:27 ` [Qemu-devel] " David Gibson
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2018-03-09 7:01 UTC (permalink / raw)
To: qemu-devel, David Gibson; +Cc: qemu-ppc
With the new "--nic" command line parameter option, the "old" way of
specifying a NIC model via the nd_table[] is becoming more prominent
again. But for the pseries "spapr-vlan" device, there is a confusing
discrepancy between the model name that is used for "--device" (i.e.
"spapr-vlan") and the model name that has to be used for "--net nic"
or the new "--nic" parameter (i.e. "ibmveth"). Since "spapr-vlan" is
the "real" name of the device, let's allow "spapr-vlan" to be used
as model name for the nd_table[] entries, too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/ppc/spapr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7e1c858..dfa9e43 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2607,10 +2607,11 @@ static void spapr_machine_init(MachineState *machine)
NICInfo *nd = &nd_table[i];
if (!nd->model) {
- nd->model = g_strdup("ibmveth");
+ nd->model = g_strdup("spapr-vlan");
}
- if (strcmp(nd->model, "ibmveth") == 0) {
+ if (g_str_equal(nd->model, "spapr-vlan") ||
+ g_str_equal(nd->model, "ibmveth")) {
spapr_vlan_create(spapr->vio_bus, nd);
} else {
pci_nic_init_nofail(&nd_table[i], phb->bus, nd->model, NULL);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth"
2018-03-09 7:01 [Qemu-devel] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth" Thomas Huth
@ 2018-03-09 7:36 ` Greg Kurz
2018-03-09 8:27 ` [Qemu-devel] " David Gibson
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2018-03-09 7:36 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, David Gibson, qemu-ppc
On Fri, 9 Mar 2018 08:01:38 +0100
Thomas Huth <thuth@redhat.com> wrote:
> With the new "--nic" command line parameter option, the "old" way of
> specifying a NIC model via the nd_table[] is becoming more prominent
> again. But for the pseries "spapr-vlan" device, there is a confusing
> discrepancy between the model name that is used for "--device" (i.e.
> "spapr-vlan") and the model name that has to be used for "--net nic"
> or the new "--nic" parameter (i.e. "ibmveth"). Since "spapr-vlan" is
> the "real" name of the device, let's allow "spapr-vlan" to be used
> as model name for the nd_table[] entries, too.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7e1c858..dfa9e43 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2607,10 +2607,11 @@ static void spapr_machine_init(MachineState *machine)
> NICInfo *nd = &nd_table[i];
>
> if (!nd->model) {
> - nd->model = g_strdup("ibmveth");
> + nd->model = g_strdup("spapr-vlan");
> }
>
> - if (strcmp(nd->model, "ibmveth") == 0) {
> + if (g_str_equal(nd->model, "spapr-vlan") ||
> + g_str_equal(nd->model, "ibmveth")) {
> spapr_vlan_create(spapr->vio_bus, nd);
> } else {
> pci_nic_init_nofail(&nd_table[i], phb->bus, nd->model, NULL);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth"
2018-03-09 7:01 [Qemu-devel] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth" Thomas Huth
2018-03-09 7:36 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
@ 2018-03-09 8:27 ` David Gibson
1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2018-03-09 8:27 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, qemu-ppc
[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]
On Fri, Mar 09, 2018 at 08:01:38AM +0100, Thomas Huth wrote:
> With the new "--nic" command line parameter option, the "old" way of
> specifying a NIC model via the nd_table[] is becoming more prominent
> again. But for the pseries "spapr-vlan" device, there is a confusing
> discrepancy between the model name that is used for "--device" (i.e.
> "spapr-vlan") and the model name that has to be used for "--net nic"
> or the new "--nic" parameter (i.e. "ibmveth"). Since "spapr-vlan" is
> the "real" name of the device, let's allow "spapr-vlan" to be used
> as model name for the nd_table[] entries, too.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Applied, thanks.
> ---
> hw/ppc/spapr.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7e1c858..dfa9e43 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2607,10 +2607,11 @@ static void spapr_machine_init(MachineState *machine)
> NICInfo *nd = &nd_table[i];
>
> if (!nd->model) {
> - nd->model = g_strdup("ibmveth");
> + nd->model = g_strdup("spapr-vlan");
> }
>
> - if (strcmp(nd->model, "ibmveth") == 0) {
> + if (g_str_equal(nd->model, "spapr-vlan") ||
> + g_str_equal(nd->model, "ibmveth")) {
> spapr_vlan_create(spapr->vio_bus, nd);
> } else {
> pci_nic_init_nofail(&nd_table[i], phb->bus, nd->model, NULL);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-09 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-09 7:01 [Qemu-devel] [PATCH] hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth" Thomas Huth
2018-03-09 7:36 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2018-03-09 8:27 ` [Qemu-devel] " David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).