From nobody Fri May 16 03:29:39 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 1498759478710129.9521224338704; Thu, 29 Jun 2017 11:04:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 166FB9D768; Thu, 29 Jun 2017 18:04:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C280417ADD; Thu, 29 Jun 2017 18:04:33 +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 B00551853E36; Thu, 29 Jun 2017 18:04:32 +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 v5TI4HDp006708 for ; Thu, 29 Jun 2017 14:04:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 35C9C179DE; Thu, 29 Jun 2017 18:04:17 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2D75179DB for ; Thu, 29 Jun 2017 18:04:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 166FB9D768 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.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 166FB9D768 From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 29 Jun 2017 20:03:59 +0200 Message-Id: <1498759443-10136-7-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 06/10] conf: Introduce virDomainDeviceInfoNew() 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 29 Jun 2017 18:04:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It allocates and initializes a virDomainDeviceInfo struct in one fell swoop. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 13 +++++++++++++ src/conf/device_conf.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 4644580..6ead830 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -32,6 +32,19 @@ =20 #define VIR_FROM_THIS VIR_FROM_DEVICE =20 +virDomainDeviceInfoPtr +virDomainDeviceInfoNew(void) +{ + virDomainDeviceInfoPtr info; + + if (VIR_ALLOC(info) < 0) + return NULL; + + virDomainDeviceInfoClear(info); + + return info; +} + void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) { diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 53abe1b..8f641bc 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -170,6 +170,7 @@ struct _virDomainDeviceInfo { char *loadparm; }; =20 +virDomainDeviceInfoPtr virDomainDeviceInfoNew(void); void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info); int virDomainDeviceInfoCopy(virDomainDeviceInfoPtr dst, virDomainDeviceInfoPtr src); --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list