aboutsummaryrefslogtreecommitdiff
path: root/hw/net/rocker/rocker_fp.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2015-06-10 18:21:18 -0700
committerStefan Hajnoczi <stefanha@redhat.com>2015-06-12 13:26:27 +0100
commit773495364ffbfc6a4d1e13e24e932f96409ba1d3 (patch)
tree87c67a778bea10f7a70a232d28dc45bbabbcec87 /hw/net/rocker/rocker_fp.c
parentf4d248bdc33167ab9e91b1470ef47a61dffd0b38 (diff)
rocker: Add support for phys name
Add ROCKER_TLV_CMD_PORT_SETTINGS_PHYS_NAME to port settings. This attribute exports the port name to the guest OS allowing it to name interfaces with sensible defaults. Mostly done by Scott for phys_id support; adapted to phys_name by David. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com> Message-id: 1433985681-56138-2-git-send-email-sfeldma@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/net/rocker/rocker_fp.c')
-rw-r--r--hw/net/rocker/rocker_fp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
index 2f1e3b348a..393e9e74f9 100644
--- a/hw/net/rocker/rocker_fp.c
+++ b/hw/net/rocker/rocker_fp.c
@@ -41,6 +41,11 @@ struct fp_port {
NICConf conf;
};
+char *fp_port_get_name(FpPort *port)
+{
+ return port->name;
+}
+
bool fp_port_get_link_up(FpPort *port)
{
return !qemu_get_queue(port->nic)->link_down;
@@ -201,7 +206,7 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
/* front-panel switch port names are 1-based */
- port->name = g_strdup_printf("%s.%d", sw_name, port->pport);
+ port->name = g_strdup_printf("%sp%d", sw_name, port->pport);
memcpy(port->conf.macaddr.a, start_mac, sizeof(port->conf.macaddr.a));
port->conf.macaddr.a[5] += index;