From nobody Wed May 1 11:27:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582906998; cv=none; d=zohomail.com; s=zohoarc; b=asZrp9HTBdIKD+/DdEaKaYJsK2LZl/SmaRsWIrLpafavXMUt8Dss8vLlt9birSlU4+zv6fjspckLQd9rFqGXkZHNAERsRcyk3DvEpWOp4+/MdRFJfy+h49paQlK0NVleGh95ArmaBqyRilDMIqHS92m0DZGOTxiux+PfIincVlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582906998; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=lSmMwZ3VQKPEV6L7gvgUy1r6X1y57X+4Apyg74bFtAA=; b=Q/AIULd0m80u8LuddtruhyeiAPqypgO8SXe/m3Ody7IEkD0+g3UXmitzrNnT0AsGwdYkNJUrxHLGA0ySq255eq4Sgkj+yMZRZ2wsoDKeu7DdHzt+yfyNfGIsRNDwrpNnr2RxbH9+g+sOwG5Fa7b9h2yZTCG9Ex/xRjwyICioZQM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582906998075307.27895762490584; Fri, 28 Feb 2020 08:23:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-53-guZ959xKPzqLZcS734xXkw-1; Fri, 28 Feb 2020 11:23:14 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2C006DB6A; Fri, 28 Feb 2020 16:23: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 C744F90793; Fri, 28 Feb 2020 16:23:06 +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 A928C84489; Fri, 28 Feb 2020 16:23:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SGN4Kw004398 for ; Fri, 28 Feb 2020 11:23:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1978C90A16; Fri, 28 Feb 2020 16:23:04 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94A0E90793 for ; Fri, 28 Feb 2020 16:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582906996; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lSmMwZ3VQKPEV6L7gvgUy1r6X1y57X+4Apyg74bFtAA=; b=LbmQfWYQurT2Qo9r3tfePtdDIKLmHQolvgEf/FnjuKYmDDIs5N5HPkspNCpEqwmiTlUMnI y1quk7FSP4wEAJBCfslVYgUdE5uYnDmm+uThqmd5pREgRLC2ip6hQ9DxK/+AXKUhfB3J83 XX2g8mxIhVcuQEABFXW80+EFhwesxDA= X-MC-Unique: guZ959xKPzqLZcS734xXkw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] conf: Don't generate machine names with a dot Date: Fri, 28 Feb 2020 17:22:58 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" According to the linked BZ, machined expects either valid hostname or valid FQDN. While in case of multiple dots, a trailing one doesn't violate FQDN, it does violate the rule in case of something simple, like "domain.". But it's safe to remove it in both cases. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1721804 Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 4 ++-- tests/virsystemdtest.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 17867eeece..9371153618 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30838,8 +30838,8 @@ virDomainMachineNameAppendValid(virBufferPtr buf, virBufferAddChar(buf, *name); } =20 - /* trailing dashes are not allowed */ - virBufferTrimChars(buf, "-"); + /* trailing dashes or dots are not allowed */ + virBufferTrimChars(buf, "-."); } =20 #undef HOSTNAME_CHARS diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index b7dfd64d06..9847f255ac 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -744,6 +744,7 @@ mymain(void) "qemu-100-kstest-network-device-default-httpksc9eed63e-98= 1e-48ec"); TEST_MACHINE("kstest-network-device-default-httpks_(c9eed63e-981e-48ec= --cdc-56b3f8c5f678)", 10, "qemu-10-kstest-network-device-default-httpksc9eed63e-981= e-48ec"); + TEST_MACHINE("demo.test.", 11, "qemu-11-demo.test"); =20 # define TESTS_PM_SUPPORT_HELPER(name, function) \ do { \ --=20 2.24.1