Patchwork [05/22] net: eepro100: replace qemu_format_nic_info_str by qemu_format_nic_info_dict

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date April 8, 2010, 8:16 p.m.
Message ID <1270757799-31891-6-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/49749/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - April 8, 2010, 8:16 p.m.
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 hw/eepro100.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Luiz Capitulino - April 9, 2010, 5:42 p.m.
On Thu,  8 Apr 2010 17:16:22 -0300
Miguel Di Ciurcio Filho <miguel.filho@gmail.com> wrote:

> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
> ---
>  hw/eepro100.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/eepro100.c b/hw/eepro100.c
> index 7db6fb5..329fe15 100644
> --- a/hw/eepro100.c
> +++ b/hw/eepro100.c
> @@ -47,6 +47,8 @@
>  #include "pci.h"
>  #include "net.h"
>  #include "eeprom93xx.h"
> +#include "qdict.h"
> +#include "qstring.h"
>  
>  #define KiB 1024
>  
> @@ -1978,8 +1980,9 @@ static int nic_init(PCIDevice *pci_dev, uint32_t device)
>      s->nic = qemu_new_nic(&net_eepro100_info, &s->conf,
>                            pci_dev->qdev.info->name, pci_dev->qdev.id, s);
>  
> -    qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a);
> -    TRACE(OTHER, logout("%s\n", s->nic->nc.info_str));
> +    qemu_format_nic_info_dict(&s->nic->nc, s->conf.macaddr.a);
> +    TRACE(OTHER, logout("%s\n",
> +        qstring_get_str(qdict_to_qstring(s->nic->nc.info_dic))));

 You have to free the returned qstring.

>  
>      qemu_register_reset(nic_reset, s);
>

Patch

diff --git a/hw/eepro100.c b/hw/eepro100.c
index 7db6fb5..329fe15 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -47,6 +47,8 @@ 
 #include "pci.h"
 #include "net.h"
 #include "eeprom93xx.h"
+#include "qdict.h"
+#include "qstring.h"
 
 #define KiB 1024
 
@@ -1978,8 +1980,9 @@  static int nic_init(PCIDevice *pci_dev, uint32_t device)
     s->nic = qemu_new_nic(&net_eepro100_info, &s->conf,
                           pci_dev->qdev.info->name, pci_dev->qdev.id, s);
 
-    qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a);
-    TRACE(OTHER, logout("%s\n", s->nic->nc.info_str));
+    qemu_format_nic_info_dict(&s->nic->nc, s->conf.macaddr.a);
+    TRACE(OTHER, logout("%s\n",
+        qstring_get_str(qdict_to_qstring(s->nic->nc.info_dic))));
 
     qemu_register_reset(nic_reset, s);