From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOtGX-00022G-2m for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOtGS-000201-7R for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:20 -0400 Received: from [199.232.76.173] (port=42374 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOtGR-0001zj-St for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54484) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOtGQ-00028N-Ro for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:15 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n69D2ERa016142 for ; Thu, 9 Jul 2009 09:02:14 -0400 From: Gerd Hoffmann Date: Thu, 9 Jul 2009 15:02:09 +0200 Message-Id: <1247144529-8805-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1247144529-8805-1-git-send-email-kraxel@redhat.com> References: <1247144529-8805-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] qdev: fix nic/id windup. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/pci.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 3410ea7..cc4882e 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -821,7 +821,8 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, for (i = 0; pci_nic_models[i]; i++) { if (strcmp(nd->model, pci_nic_models[i]) == 0) { dev = pci_create(pci_nic_names[i], devaddr); - snprintf(dev->id, sizeof(dev->id), "%s", nd->id); + if (nd->id) + snprintf(dev->id, sizeof(dev->id), "%s", nd->id); dev->nd = nd; qdev_init(dev); nd->private = dev; -- 1.6.2.5