From nobody Sun Feb 8 19:43:47 2026 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534846357989108.93180337402703; Tue, 21 Aug 2018 03:12:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D5F181DE1; Tue, 21 Aug 2018 10:12:36 +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 66CC42010D06; Tue, 21 Aug 2018 10:12:35 +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 7EF8D18005D0; Tue, 21 Aug 2018 10:12:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7LACVdF024705 for ; Tue, 21 Aug 2018 06:12:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id D600094644; Tue, 21 Aug 2018 10:12:31 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7527294641 for ; Tue, 21 Aug 2018 10:12:31 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 21 Aug 2018 12:12:24 +0200 Message-Id: <179ccd96901dc25a02b35864613ce24df3ff207a.1534846269.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/2] device_conf: Split virDomainDeviceInfoClear 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Aug 2018 10:12:36 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Some callers might want to clear the address but not the alias. Split the virDomainDeviceInfoClear() function to allow that. Signed-off-by: Michal Privoznik --- src/conf/device_conf.c | 10 ++++++++-- src/conf/device_conf.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index d69f94fadf..8fa6bb4fe0 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -54,9 +54,8 @@ virDomainDeviceInfoCopy(virDomainDeviceInfoPtr dst, } =20 void -virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) +virDomainDeviceInfoClearAddress(virDomainDeviceInfoPtr info) { - VIR_FREE(info->alias); memset(&info->addr, 0, sizeof(info->addr)); info->type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; VIR_FREE(info->romfile); @@ -65,6 +64,13 @@ virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) info->isolationGroupLocked =3D false; } =20 +void +virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) +{ + VIR_FREE(info->alias); + virDomainDeviceInfoClearAddress(info); +} + void virDomainDeviceInfoFree(virDomainDeviceInfoPtr info) { diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index a31ce9c376..1d0e9e6925 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -179,6 +179,7 @@ struct _virDomainDeviceInfo { =20 int virDomainDeviceInfoCopy(virDomainDeviceInfoPtr dst, virDomainDeviceInfoPtr src); +void virDomainDeviceInfoClearAddress(virDomainDeviceInfoPtr info); void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info); void virDomainDeviceInfoFree(virDomainDeviceInfoPtr info); =20 --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list