From patchwork Mon Apr 25 21:13:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 66644 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1261055qge; Mon, 25 Apr 2016 14:16:14 -0700 (PDT) X-Received: by 10.202.197.70 with SMTP id v67mr14935219oif.63.1461618974297; Mon, 25 Apr 2016 14:16:14 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id t186si11616107qkd.278.2016.04.25.14.16.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 14:16:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3PLDLUX045403; Mon, 25 Apr 2016 17:13:22 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3PLDJm7006699 for ; Mon, 25 Apr 2016 17:13:19 -0400 Received: from colepc.redhat.com (ovpn-113-101.phx2.redhat.com [10.3.113.101]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3PLDI50023199; Mon, 25 Apr 2016 17:13:19 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 25 Apr 2016 17:13:17 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] spec: If installing default network, restart libvirtd 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com If libvirt-daemon-config-network is installed while libvirtd is already running, the daemon doesn't notice the network. Users then have to manually restart libvirtd (or reboot) to pick up the network. Instead let's trigger a daemon restart when the package is first installed. Then the default network is available immediately if libvirtd was already running. https://bugzilla.redhat.com/show_bug.cgi?id=867546 --- Plain restart is kind of suboptimal since it will drop all open libvirt connections. Ideally we would use reload which is meant for this case, but it's kinda crashy with current git: http://www.redhat.com/archives/libvir-list/2016-April/msg01624.html And in fact daemon restart is what the spec triggers on libvirt-daemon upgrade anyways, so this isn't anything new WRT packaging. libvirt.spec.in | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/libvirt.spec.in b/libvirt.spec.in index 35212da..1a04c88 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1849,6 +1849,14 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; < %{_datadir}/libvirt/networks/default.xml \ > %{_sysconfdir}/libvirt/qemu/networks/default.xml ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml + + # Make sure libvirt picks up the new network defininiton + %if %{with_systemd} + /bin/systemctl reload libvirtd.service >/dev/null 2>&1 ||: + %else + /sbin/service libvirtd reload > /dev/null 2>&1 || : + %endif + fi %endif