diff mbox

[v4,07/10] net: dump: introduce info_dict

Message ID 1274202469-9332-8-git-send-email-miguel.filho@gmail.com
State New
Headers show

Commit Message

Miguel Di Ciurcio Filho May 18, 2010, 5:07 p.m. UTC
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 net/dump.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/net/dump.c b/net/dump.c
index 6db7ecf..32514ad 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -26,6 +26,9 @@ 
 #include "qemu-common.h"
 #include "sysemu.h"
 #include "qemu-error.h"
+#include "qdict.h"
+#include "qstring.h"
+#include "qint.h"
 #include "qemu-log.h"
 
 typedef struct DumpState {
@@ -129,7 +132,12 @@  static int net_dump_init(VLANState *vlan, const char *device,
     nc = qemu_new_net_client(&net_dump_info, vlan, NULL, device, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str),
-             "dump to %s (len=%d)", filename, len);
+                "dump to %s (len=%d)", filename, len);
+
+    nc->info_dict = qdict_new();
+    qdict_put(nc->info_dict, "filename", qstring_from_str(filename));
+    qdict_put(nc->info_dict, "len", qint_from_int(len));
+    qdict_put(nc->info_dict, "model", qstring_from_str("dump"));
 
     s = DO_UPCAST(DumpState, nc, nc);