From nobody Mon Feb 9 13:23:55 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511967548786847.1330110979367; Wed, 29 Nov 2017 06:59:08 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB85B4E33A; Wed, 29 Nov 2017 14:59:07 +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 810A25D976; Wed, 29 Nov 2017 14:59:07 +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 80BC64BB79; Wed, 29 Nov 2017 14:59:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vATEx4V1014906 for ; Wed, 29 Nov 2017 09:59:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 606DC60C89; Wed, 29 Nov 2017 14:59:04 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAFA3609A5 for ; Wed, 29 Nov 2017 14:59:03 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 29 Nov 2017 15:58:54 +0100 Message-Id: <40e0a25e40303a7384421a2fcf6c438306020469.1511967132.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] Move USER_ALIAS_PREFIX to the header file 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 29 Nov 2017 14:59:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow other parts of code to decide whether the alias is user-specified or not. --- src/conf/domain_conf.c | 3 +-- src/conf/domain_conf.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b31917dad..41c94ed18 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6656,7 +6656,6 @@ virDomainDeviceAddressParseXML(xmlNodePtr address, } =20 =20 -#define USER_ALIAS_PREFIX "ua-" #define USER_ALIAS_CHARS \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" =20 @@ -6713,7 +6712,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt ATTRIBUTE_UNUSED, =20 if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) || (xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_USER_ALIAS && - STRPREFIX(aliasStr, USER_ALIAS_PREFIX) && + STRPREFIX(aliasStr, VIR_DOMAIN_USER_ALIAS_PREFIX) && strspn(aliasStr, USER_ALIAS_CHARS) =3D=3D strlen(aliasStr))) VIR_STEAL_PTR(info->alias, aliasStr); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 48b07226e..afba0ede3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -57,6 +57,8 @@ # include "virtypedparam.h" # include "virsavecookie.h" =20 +# define VIR_DOMAIN_USER_ALIAS_PREFIX "ua-" + /* forward declarations of all device types, required by * virDomainDeviceDef */ --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list