From patchwork Thu Oct 8 18:58:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 35512 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 9DC56B7B65 for ; Fri, 9 Oct 2009 06:20:39 +1100 (EST) Received: from localhost ([127.0.0.1]:34875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvyXU-0002RK-Nh for incoming@patchwork.ozlabs.org; Thu, 08 Oct 2009 15:20:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvyEQ-0006Le-Fc for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvyEJ-0006I4-Pq for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:51 -0400 Received: from [199.232.76.173] (port=52363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvyEJ-0006He-Hf for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60700) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvyEE-00073c-KT for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:43 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n98J0flX027969 for ; Thu, 8 Oct 2009 15:00:41 -0400 Received: from blaa.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n98J0CMT027923; Thu, 8 Oct 2009 15:00:20 -0400 Received: by blaa.localdomain (Postfix, from userid 500) id 3E3474F564; Thu, 8 Oct 2009 19:58:33 +0100 (IST) From: Mark McLoughlin To: qemu-devel@nongnu.org Date: Thu, 8 Oct 2009 19:58:22 +0100 Message-Id: <1255028312-28180-7-git-send-email-markmc@redhat.com> In-Reply-To: <1255028312-28180-1-git-send-email-markmc@redhat.com> References: <1255028312-28180-1-git-send-email-markmc@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Mark McLoughlin Subject: [Qemu-devel] [PATCH 06/16] net: remove id field from NICInfo 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 Just use the name field instead since we now use the id paramater as the name, if supplied. Only implication with this change is that if id is not supplied, the value of the name paramater is used as an id. Signed-off-by: Mark McLoughlin --- hw/pci.c | 4 ++-- net.c | 4 ---- net.h | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 49651d0..abf07ca 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -857,8 +857,8 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, pci_dev = pci_create(bus, devfn, pci_nic_names[i]); dev = &pci_dev->qdev; - if (nd->id) - dev->id = qemu_strdup(nd->id); + if (nd->name) + dev->id = qemu_strdup(nd->name); dev->nd = nd; if (qdev_init(dev) < 0) return NULL; diff --git a/net.c b/net.c index 8895e87..87dcf06 100644 --- a/net.c +++ b/net.c @@ -2414,9 +2414,6 @@ static int net_init_nic(QemuOpts *opts, Monitor *mon, const char *name) if (name) { nd->name = qemu_strdup(name); } - if (qemu_opts_id(opts)) { - nd->id = qemu_strdup(qemu_opts_id(opts)); - } if (qemu_opt_get(opts, "model")) { nd->model = qemu_strdup(qemu_opt_get(opts, "model")); } @@ -3032,7 +3029,6 @@ void net_client_uninit(NICInfo *nd) qemu_free(nd->model); qemu_free(nd->name); qemu_free(nd->devaddr); - qemu_free(nd->id); nd->used = 0; } diff --git a/net.h b/net.h index 49e160d..164ea3d 100644 --- a/net.h +++ b/net.h @@ -98,7 +98,6 @@ struct NICInfo { char *model; char *name; char *devaddr; - char *id; VLANState *vlan; VLANClientState *vc; void *private;