Patchwork [5/8] net: vde: introduce info_dict

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date June 10, 2010, 9:37 p.m.
Message ID <1276205825-1922-6-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/55272/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - June 10, 2010, 9:37 p.m.
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 net/vde.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/net/vde.c b/net/vde.c
index 0b46fa6..0fe7c09 100644
--- a/net/vde.c
+++ b/net/vde.c
@@ -31,6 +31,9 @@ 
 #include "qemu-char.h"
 #include "qemu-common.h"
 #include "qemu-option.h"
+#include "qdict.h"
+#include "qstring.h"
+#include "qint.h"
 #include "sysemu.h"
 
 typedef struct VDEState {
@@ -102,6 +105,11 @@  static int net_vde_init(VLANState *vlan, const char *model,
     snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d",
              sock, vde_datafd(vde));
 
+    assert(nc->info_dict == NULL);
+    nc->info_dict = qdict_new();
+    qdict_put(nc->info_dict, "sock", qstring_from_str(sock));
+    qdict_put(nc->info_dict, "fd", qint_from_int(vde_datafd(vde)));
+
     s = DO_UPCAST(VDEState, nc, nc);
 
     s->vde = vde;