From nobody Fri May 16 03:36:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498759485792754.5083096888259; Thu, 29 Jun 2017 11:04:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E48EA3274; Thu, 29 Jun 2017 18:04:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EFEF8C06D; Thu, 29 Jun 2017 18:04:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2D2353FAE8; Thu, 29 Jun 2017 18:04:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5TI4VFA006791 for ; Thu, 29 Jun 2017 14:04:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E60017CC4; Thu, 29 Jun 2017 18:04:31 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAA5A17AC3 for ; Thu, 29 Jun 2017 18:04:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9E48EA3274 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9E48EA3274 From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 29 Jun 2017 20:04:03 +0200 Message-Id: <1498759443-10136-11-git-send-email-abologna@redhat.com> In-Reply-To: <1498759443-10136-1-git-send-email-abologna@redhat.com> References: <1498759443-10136-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/10] conf: Call virDomainDeviceInfoClear() in virDomain*DefNew() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Jun 2017 18:04:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Any struct embedding a virDomainDeviceInfo needs to initialize it by calling virDomainDeviceInfoClear(). Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 055fde9..fcb8465 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1397,6 +1397,8 @@ virDomainInputDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -1725,6 +1727,8 @@ virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt) if (VIR_ALLOC(ret->src) < 0) goto error; =20 + virDomainDeviceInfoClear(&ret->info); + if (xmlopt && xmlopt->privateData.diskNew && !(ret->privateData =3D xmlopt->privateData.diskNew())) @@ -1854,6 +1858,8 @@ virDomainControllerDefNew(virDomainControllerType typ= e) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + def->type =3D type; =20 /* initialize anything that has a non-0 default */ @@ -1910,6 +1916,8 @@ virDomainFSDefNew(void) if (VIR_ALLOC(ret->src) < 0) goto cleanup; =20 + virDomainDeviceInfoClear(&ret->info); + return ret; =20 cleanup: @@ -2040,6 +2048,8 @@ virDomainNetDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2278,6 +2288,8 @@ virDomainSmartcardDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2326,6 +2338,8 @@ virDomainSoundDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2352,6 +2366,8 @@ virDomainMemballoonDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2374,6 +2390,8 @@ virDomainNVRAMDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2395,6 +2413,8 @@ virDomainWatchdogDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2416,6 +2436,8 @@ virDomainRNGDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2449,6 +2471,8 @@ virDomainShmemDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2471,6 +2495,8 @@ virDomainVideoDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2499,6 +2525,8 @@ virDomainHostdevDefNew(virDomainXMLOptionPtr xmlopt) if (!(def->info =3D virDomainDeviceInfoNew())) goto error; =20 + virDomainDeviceInfoClear(def->info); + if (xmlopt && xmlopt->privateData.hostdevNew && !(def->privateData =3D xmlopt->privateData.hostdevNew())) @@ -2597,6 +2625,8 @@ virDomainTPMDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2640,6 +2670,8 @@ virDomainHubDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2660,6 +2692,8 @@ virDomainRedirdevDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2696,6 +2730,8 @@ virDomainMemoryDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -2917,6 +2953,8 @@ virDomainPanicDefNew(void) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + return def; } =20 @@ -11229,6 +11267,8 @@ virDomainChrDefNew(virDomainXMLOptionPtr xmlopt) if (VIR_ALLOC(def) < 0) return NULL; =20 + virDomainDeviceInfoClear(&def->info); + def->target.port =3D -1; =20 if (!(def->source =3D virDomainChrSourceDefNew(xmlopt))) --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list