From nobody Sat May 4 13:53:13 2024 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 From nobody Sat May 4 13:53:13 2024 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 153484661169254.57991558544461; Tue, 21 Aug 2018 03:16:51 -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 8BDBBC049D66; Tue, 21 Aug 2018 10:16:49 +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 4955E2010D02; Tue, 21 Aug 2018 10:16:49 +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 D5B8A1800540; Tue, 21 Aug 2018 10:16:48 +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 w7LACWxq024711 for ; Tue, 21 Aug 2018 06:12:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 831DA94644; Tue, 21 Aug 2018 10:12:32 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2077C94645 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:25 +0200 Message-Id: <4f47d13df104e111f980190c39ecd025336c33aa.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 2/2] conf: Parse guestfwd channel device info again 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.31]); Tue, 21 Aug 2018 10:16:50 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1610072 Due to historical reasons we were not parsing device info on guestfwd channel. Sure, it doesn't make much sense to parse
but it surely makes sense to parse its alias (which might be an user alias). This partially reverts commit 47a3dd46ead20e6fdc30bcdc1b8e707e250d33da which fixed https://bugzilla.redhat.com/show_bug.cgi?id=3D1172526. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3c254801cd..abbc6e8a85 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12807,14 +12807,13 @@ virDomainChrDefParseXML(virDomainXMLOptionPtr xml= opt, } } =20 + if (virDomainDeviceInfoParseXML(xmlopt, node, + &def->info, flags) < 0) + goto error; + if (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && - def->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD= ) { - VIR_DEBUG("Ignoring device address for gustfwd channel"); - } else if (virDomainDeviceInfoParseXML(xmlopt, node, - &def->info, flags) < 0) { - goto error; - } - + def->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD) + virDomainDeviceInfoClearAddress(&def->info); =20 if (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && def->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB && --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list