hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth"
PATCH 1/1 hw/ppc/spapr: Allow "spapr-vlan" as NIC model name beside "ibmveth"
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.
--- hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/ppc/spapr.c +3 -2
@@ -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 );
Signature · 1 line
1.8.3.1
Quoted 11 lines · On Fri, 9 Mar 2018 08:01:38 +0100 Thomas Huth <[email protected]> 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 <[email protected]>---
Quoted 21 lines
hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/ppc/spapr.c +3
-2@@ -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
AppliedQuoted 10 lines · Thomas Huth
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 <[email protected]>
Applied, thanks.
Quoted 22 lines
--- hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/ppc/spapr.c +3
-2@@ -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 );
Signature · 4 lines
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