From patchwork Wed Jun 30 14:53:02 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: 57420 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 AD9B6B6F06 for ; Thu, 1 Jul 2010 01:02:24 +1000 (EST) Received: from localhost ([127.0.0.1]:49637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTynr-0000ag-0f for incoming@patchwork.ozlabs.org; Wed, 30 Jun 2010 11:02:19 -0400 Received: from [140.186.70.92] (port=52513 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTyfU-0004Ox-1r for qemu-devel@nongnu.org; Wed, 30 Jun 2010 10:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTyfJ-0007DO-HK for qemu-devel@nongnu.org; Wed, 30 Jun 2010 10:53:39 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:41310) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTyfJ-0007DI-Eo for qemu-devel@nongnu.org; Wed, 30 Jun 2010 10:53:29 -0400 Received: by gye5 with SMTP id 5so472876gye.4 for ; Wed, 30 Jun 2010 07:53:28 -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=w2xxesmmu0WDI2y73uKxKqWEVgw9dbYBhJglTdpb85M=; b=s4SJaWu02AI6sq/TaKLfjEPVfZ2lhsut2pYC6f+1nPo7LZF6bmL5LtnM123KaAbV1E Xu2UdFLa83SXtKrB3OF0Ujgs52gGcWPWQh/K67sLEK8RaediAf1DuSrH3Kq3gzoQNT48 82nF4UrfEmjDfV1RMCgsXl555oM62z38D1AyA= 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=wiJGkQmlvZlh2O0jQ534a/L+KFpld7KhLZLTyOCb2ylNXeU1XoJ2CwilvtOUBDlH1E x728vAwrhwoc0WeKFe4CZh3Fj/QEeXaj6aT6AT+hlg9V1yl8GlS0V9rW+fTAOOhdfDPS I3fEU/WSAL7IQA1VdBkvM2Fmq360uF5+XSPQU= Received: by 10.101.130.8 with SMTP id h8mr11014089ann.36.1277909608769; Wed, 30 Jun 2010 07:53:28 -0700 (PDT) Received: from localhost.localdomain (curitiba.ic.unicamp.br [143.106.7.130]) by mx.google.com with ESMTPS id t5sm38169951ani.25.2010.06.30.07.53.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Jun 2010 07:53:27 -0700 (PDT) From: Miguel Di Ciurcio Filho To: qemu-devel@nongnu.org Date: Wed, 30 Jun 2010 11:53:02 -0300 Message-Id: <1277909584-13012-6-git-send-email-miguel.filho@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1277909584-13012-1-git-send-email-miguel.filho@gmail.com> References: <1277909584-13012-1-git-send-email-miguel.filho@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: avi@redhat.com, Miguel Di Ciurcio Filho , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v2 5/7] net: vde: 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/vde.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) 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;