Patchwork [3/7] net: Introduce VLANClientState->info_dict

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date June 23, 2010, 3:39 p.m.
Message ID <1277307603-28960-4-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/56686/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - June 23, 2010, 3:39 p.m.
There is no standard format when formatting VLANClientState.info_str,
so it is difficult to extract information and transmit it over QMP.

This patch adds info_dict, a QDict to better handle this information.

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 net.c |    1 +
 net.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
Luiz Capitulino - June 28, 2010, 9:59 p.m.
On Wed, 23 Jun 2010 12:39:59 -0300
Miguel Di Ciurcio Filho <miguel.filho@gmail.com> wrote:

> There is no standard format when formatting VLANClientState.info_str,
> so it is difficult to extract information and transmit it over QMP.
> 
> This patch adds info_dict, a QDict to better handle this information.
> 
> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
> ---
>  net.c |    1 +
>  net.h |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net.c b/net.c
> index 0703698..7daf253 100644
> --- a/net.c
> +++ b/net.c
> @@ -301,6 +301,7 @@ void qemu_del_vlan_client(VLANClientState *vc)
>  
>      qemu_free(vc->name);
>      qemu_free(vc->model);
> +    qemu_free(vc->info_dict);

QDECREF(vc->info_dict);

>      qemu_free(vc);
>  }
>  
> diff --git a/net.h b/net.h
> index 518cf9c..cfe837f 100644
> --- a/net.h
> +++ b/net.h
> @@ -65,6 +65,7 @@ struct VLANClientState {
>      char *model;
>      char *name;
>      char info_str[256];
> +    QDict *info_dict;
>      unsigned receive_disabled : 1;
>  };
>

Patch

diff --git a/net.c b/net.c
index 0703698..7daf253 100644
--- a/net.c
+++ b/net.c
@@ -301,6 +301,7 @@  void qemu_del_vlan_client(VLANClientState *vc)
 
     qemu_free(vc->name);
     qemu_free(vc->model);
+    qemu_free(vc->info_dict);
     qemu_free(vc);
 }
 
diff --git a/net.h b/net.h
index 518cf9c..cfe837f 100644
--- a/net.h
+++ b/net.h
@@ -65,6 +65,7 @@  struct VLANClientState {
     char *model;
     char *name;
     char info_str[256];
+    QDict *info_dict;
     unsigned receive_disabled : 1;
 };