From nobody Mon Feb 9 01:06:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594894510; cv=none; d=zohomail.com; s=zohoarc; b=jLu1GIzJ1xssmfJbnd5NkS75J9aNk2vmGWz+xgT5pYoWk39qFVsu4e542NkbzVLMpxxyT87q0Ni6cOzqWHfQ6hpzH/gK7opn34dpjY2bsqIFx3QSvj96jl7CmrfR45ehu7ZEUYUl77yBTn/dZ+1qSgMOC3nuuBI6WCDnUXGmgTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894510; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k2IlvSzYy/lg3Gi+/OXNtZvjJ5Eimr/5xCqsqaCFWAg=; b=X3j0DY2jDByb8jG2qXj4LaBCnhUXiWYmS5ZKxRRNarGrcGiFwpQ4YT/cnyPuWT/XW8HVfqtf5crdVLbsHuPOo6rthtKttYhDGj7W4wvImWXvmvG9+0f4S9erZeMBxCwCvo8wKS18nSL3NV/tL7x/HIs5upRMVjPyiIqnfqmUCv8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594894510159565.8402654531677; Thu, 16 Jul 2020 03:15:10 -0700 (PDT) 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-501-VEETnuV7O-SWPg2iZGGqwg-1; Thu, 16 Jul 2020 06:09:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4AE81888AA9; Thu, 16 Jul 2020 10:09:51 +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 8F6011001B07; Thu, 16 Jul 2020 10:09:51 +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 57DEC181A96B; Thu, 16 Jul 2020 10:09:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA5ow3018721 for ; Thu, 16 Jul 2020 06:05:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id D381F2B6DC; Thu, 16 Jul 2020 10:05:50 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C2722B6DB for ; Thu, 16 Jul 2020 10:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894508; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=k2IlvSzYy/lg3Gi+/OXNtZvjJ5Eimr/5xCqsqaCFWAg=; b=NG18Waxp8LeIGZ1I5QDrwJqteTLIpaBGSHPUR7BWPfWv+MXqH2ZNVWcaJCVV1oOZV2nNdT /SGuweIKB74h+Jqwlc/1n2kXk2KUfzPnuVY7LnKRVYbaD7kEy7EgITB2xhALutUOgnJhNf j68vprvo47xANJ4xo6czmkkvTBKuUzI= X-MC-Unique: VEETnuV7O-SWPg2iZGGqwg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 233/351] meson: src/network: install default network xml Date: Thu, 16 Jul 2020 11:57:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.22 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" Signed-off-by: Pavel Hrdina --- scripts/install-symlink.sh | 7 +++++ scripts/meson.build | 1 + src/network/Makefile.inc.am | 20 ------------- src/network/{default.xml =3D> default.xml.in} | 0 src/network/meson.build | 32 +++++++++++++++++++++ 5 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 scripts/install-symlink.sh rename src/network/{default.xml =3D> default.xml.in} (100%) diff --git a/scripts/install-symlink.sh b/scripts/install-symlink.sh new file mode 100644 index 00000000000..bfd1f5ad37d --- /dev/null +++ b/scripts/install-symlink.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +mkdir -p $DESTDIR/$1 + +cd $DESTDIR/$1 + +ln -f -s $2 $3 diff --git a/scripts/meson.build b/scripts/meson.build index 8e4f16349e5..3038dfc8d21 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -21,6 +21,7 @@ scripts =3D [ 'hvsupport.py', 'hyperv_wmi_generator.py', 'install-dirs.sh', + 'install-symlink.sh', 'meson-python.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 8482f924a15..c19b1f99529 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -7,23 +7,7 @@ STATEFUL_DRIVER_SOURCE_FILES +=3D \ if WITH_NETWORK INSTALL_DATA_DIRS +=3D network =20 -UUID=3D$(shell uuidgen 2>/dev/null) - install-data-network: - $(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart" - $(INSTALL_DATA) $(srcdir)/network/default.xml \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml - test -z "$(UUID)" || \ - { sed -e "s,,; $(UUID)," \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml | \ - tr ";" "\n" > \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml.t && \ - cp $(DESTDIR)$(confdir)/qemu/networks/default.xml.t \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml && \ - rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; } - ( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \ - rm -f default.xml && \ - $(LN_S) ../default.xml default.xml ) if WITH_FIREWALLD_ZONE $(MKDIR_P) "$(DESTDIR)$(prefix)/lib/firewalld/zones" $(INSTALL_DATA) $(srcdir)/network/libvirt.zone \ @@ -31,10 +15,6 @@ if WITH_FIREWALLD_ZONE endif WITH_FIREWALLD_ZONE =20 uninstall-data-network: - rm -f $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml - rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml - rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || : - rmdir "$(DESTDIR)$(confdir)/qemu/networks" || : if WITH_FIREWALLD_ZONE rm -f $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml endif WITH_FIREWALLD_ZONE diff --git a/src/network/default.xml b/src/network/default.xml.in similarity index 100% rename from src/network/default.xml rename to src/network/default.xml.in diff --git a/src/network/meson.build b/src/network/meson.build index c2085091bce..2ca7d268c6e 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -83,4 +83,36 @@ if conf.has('WITH_NETWORK') localstatedir / 'lib' / 'libvirt' / 'dnsmasq', runstatedir / 'libvirt' / 'network', ] + + uuidgen_prog =3D find_program('uuidgen', required: false) + + if uuidgen_prog.found() + uuid =3D run_command(uuidgen_prog).stdout().strip() + + configure_file( + input: 'default.xml.in', + output: 'default.xml', + command: [ + 'sed', '-e', 's||\\n @0@|'.format(uuid= ), + '@INPUT@', + ], + capture: true, + install: true, + install_dir: confdir / 'qemu' / 'networks', + ) + else + configure_file( + input: 'default.xml.in', + output: 'default.xml', + copy: true, + install: true, + install_dir: confdir / 'qemu' / 'networks', + ) + endif + + meson.add_install_script( + install_symlink_prog.path(), + confdir / 'qemu' / 'networks' / 'autostart', + '../default.xml', 'default.xml', + ) endif --=20 2.26.2