diff mbox

[5/7] net: vde: introduce info_dict

Message ID 1277307603-28960-6-git-send-email-miguel.filho@gmail.com
State New
Headers show

Commit Message

Miguel Di Ciurcio Filho June 23, 2010, 3:40 p.m. UTC
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 net/vde.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/net/vde.c b/net/vde.c
index 0b46fa6..a8a5b03 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,17 @@  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)));
+    qdict_put(nc->info_dict, "port", qint_from_int(port));
+    qdict_put(nc->info_dict, "mode", qint_from_int(mode));
+
+    if (group) {
+        qdict_put(nc->info_dict, "group", qstring_from_str(group));
+    }
+
     s = DO_UPCAST(VDEState, nc, nc);
 
     s->vde = vde;