Skip to contentSkip to conversation

kvm: qemu: virtio-net: set info_str

PATCH In review Mark McLoughlin 2 participants 2 messages Dec 9, 2008 – Dec 23, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: qemu: virtio-net: set info_str

Currently 'info network' shows no details for a virtio nic.

---
 qemu/hw/virtio-net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
qemu/hw/virtio-net.c +5 -0
index da2e835..18da625 100644
@@ -403,6 +403,11 @@ PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
     n->vc = qemu_new_vlan_client(nd->vlan, virtio_net_receive,
                                  virtio_net_can_receive, n);
 
+    snprintf(n->vc->info_str, sizeof(n->vc->info_str),
+             "virtio macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
+             n->mac[0], n->mac[1], n->mac[2],
+             n->mac[3], n->mac[4], n->mac[5]);
+
     n->tx_timer = qemu_new_timer(vm_clock, virtio_net_tx_timer, n);
     n->tx_timer_active = 0;
     n->mergeable_rx_bufs = 0;
Signature · 1 line
1.6.0.3
#1 lore raw
Quoted 3 lines · Mark McLoughlin

Currently 'info network' shows no details for a virtio nic.

Sorry, I've missed this. But now virtio-net is in qemu; can you push it there, and I'll merge it in due course?

Quoted 22 lines
---
 qemu/hw/virtio-net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
qemu/hw/virtio-net.c +5 -0
index da2e835..18da625 100644
@@ -403,6 +403,11 @@ PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
     n->vc = qemu_new_vlan_client(nd->vlan, virtio_net_receive,
                                  virtio_net_can_receive, n);
 
+    snprintf(n->vc->info_str, sizeof(n->vc->info_str),
+             "virtio macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
+             n->mac[0], n->mac[1], n->mac[2],
+             n->mac[3], n->mac[4], n->mac[5]);
+
     n->tx_timer = qemu_new_timer(vm_clock, virtio_net_tx_timer, n);
     n->tx_timer_active = 0;
     n->mergeable_rx_bufs = 0;
Signature · 1 line
error compiling committee.c: too many arguments to function