From patchwork Tue May 18 17:07:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Di Ciurcio Filho X-Patchwork-Id: 52895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0385EB7D6B for ; Wed, 19 May 2010 03:24:39 +1000 (EST) Received: from localhost ([127.0.0.1]:44614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEQWr-0000ex-Ht for incoming@patchwork.ozlabs.org; Tue, 18 May 2010 13:24:29 -0400 Received: from [140.186.70.92] (port=32823 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEQRU-0006Pi-Vy for qemu-devel@nongnu.org; Tue, 18 May 2010 13:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEQHK-0005Uk-6j for qemu-devel@nongnu.org; Tue, 18 May 2010 13:08:33 -0400 Received: from mail-yw0-f184.google.com ([209.85.211.184]:51679) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEQHK-0005QE-3z for qemu-devel@nongnu.org; Tue, 18 May 2010 13:08:26 -0400 Received: by mail-yw0-f184.google.com with SMTP id 14so3433770ywh.25 for ; Tue, 18 May 2010 10:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=6e0XmZcK2wZ8e7v83qySDW70nS6h4zVKuEGns5WI+s8=; b=NQz09qnU2CVeRVqKVSMsN9kM5cZrEJkcPixtA1A4Wi3bJEkpu855bw/P0eKf4SORa+ HsrybRIG9ilc/ObOkvLg3O4e6fSEGEH4c3iqkfIN1iad4F10Ezpusa5JNeMLAnI6TXrh BZfu4wuMulrDk0QRtmhEZHCTmaQNDbgASKyzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=rsSHhvuwmoOSr9UfEin4F6C79lw4FQSMCfyREYDTCUsaEVJhPskkUhY5iy6u24sX23 vbVuFbYnXTBmVmrAoxHLYmKUF1f7MATQ1bWg/3oJVY1LoUMPdFSanaZB8iBLIZ1DSi1M obT/DuUlLheFh32MpgrrAL3HH3nR2OaLy8Lr0= Received: by 10.150.173.42 with SMTP id v42mr8230282ybe.244.1274202505989; Tue, 18 May 2010 10:08:25 -0700 (PDT) Received: from localhost.localdomain (quake.ic.unicamp.br [143.106.7.51]) by mx.google.com with ESMTPS id k30sm58427272ybb.19.2010.05.18.10.08.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 May 2010 10:08:25 -0700 (PDT) From: Miguel Di Ciurcio Filho To: qemu-devel@nongnu.org Date: Tue, 18 May 2010 14:07:47 -0300 Message-Id: <1274202469-9332-9-git-send-email-miguel.filho@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274202469-9332-1-git-send-email-miguel.filho@gmail.com> References: <1274202469-9332-1-git-send-email-miguel.filho@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v4 08/10] net: slirp: introduce info_dict X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Miguel Di Ciurcio Filho --- net/slirp.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index b41c60a..a6e25ff 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -32,6 +32,9 @@ #include "monitor.h" #include "sysemu.h" #include "qemu_socket.h" +#include "qdict.h" +#include "qbool.h" +#include "qstring.h" #include "slirp/libslirp.h" static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) @@ -241,7 +244,12 @@ static int net_slirp_init(VLANState *vlan, const char *model, nc = qemu_new_net_client(&net_slirp_info, vlan, NULL, model, name); snprintf(nc->info_str, sizeof(nc->info_str), - "net=%s, restricted=%c", inet_ntoa(net), restricted ? 'y' : 'n'); + "net=%s, restricted=%c", inet_ntoa(net), restricted ? 'y' : 'n'); + + nc->info_dict = qdict_new(); + qdict_put(nc->info_dict, "net", qstring_from_str(inet_ntoa(net))); + qdict_put(nc->info_dict, "model", qstring_from_str("slirp")); + qdict_put(nc->info_dict, "restricted", qbool_from_int(restricted)); s = DO_UPCAST(SlirpState, nc, nc);