From patchwork Mon Aug 24 16:59:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1350551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BZyzs6CPZz9sTF; Tue, 25 Aug 2020 03:00:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kAFpW-00034Z-Qg; Mon, 24 Aug 2020 17:00:22 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kAFpU-00033j-IQ for kernel-team@lists.ubuntu.com; Mon, 24 Aug 2020 17:00:20 +0000 Received: from mail-qt1-f199.google.com ([209.85.160.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kAFpU-0006dq-7o for kernel-team@lists.ubuntu.com; Mon, 24 Aug 2020 17:00:20 +0000 Received: by mail-qt1-f199.google.com with SMTP id i42so4352294qtc.2 for ; Mon, 24 Aug 2020 10:00:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tMuLpCGopg0lDgB0eYPqR+Wzbk9tfJpn25JWiRbuEEI=; b=AMcKLGbY/uocM+FZf4AObGzy60Z2E/K8J2f1mNWhPWaOY79Sg3bbpib0KS3FfuCy1i +YXn3ZnNRqOgfvlBm4aHuK+vjxCtqYMOeqWO4XIWD/FIgsDEVgb4aZCqeiyPOjmFx8NN 7vR6bRM7jJ3DQirctX5SwG9B9L7Vo9GqyY6jNRQIk+s3sX38nvXe9krDxfYYqf1Y3JYm aEWfKPYHiW3LNexZt1sHP2XWsheqGDcN8jiLBfb4hx8+fWci0a6zN88phaWWwaMNJUw4 lcevsh/gp11SzdrQc04wo+VmC8GBHOL/6uiRlEZltSMacsU3N46iyJUaA2jfxKZNUHEo UenQ== X-Gm-Message-State: AOAM533lsHIg0Tu1NIthgEKmt0TqRu+0wu44LmB88fgEXj0XO1qq39pW C5HbKY4bVI6c4aHVMJ1fNYM/rSKpiJK42bk8OPoeXgz+rC8m3w0WdTr1sQ9OGZxx/krBHPafRpL Lh5s1lAKXB4vB4rHGyJe2MBI+s+GFG+AstkrVk4FT X-Received: by 2002:ac8:454b:: with SMTP id z11mr5847095qtn.350.1598288414851; Mon, 24 Aug 2020 10:00:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Kd0cJyuD2RR7loQp0/kcdFLhD3+xzm0/puotna5PP2gXOCcw8HdnDN4hxCrzOm0lsXc79Q== X-Received: by 2002:ac8:454b:: with SMTP id z11mr5847060qtn.350.1598288414498; Mon, 24 Aug 2020 10:00:14 -0700 (PDT) Received: from localhost.localdomain ([201.82.186.200]) by smtp.gmail.com with ESMTPSA id i7sm11654722qtb.27.2020.08.24.10.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 10:00:13 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [G/F/B/X][PATCH 1/2] UBUNTU: [Packaging] Bind hv_vss_daemon startup to hv_vss device Date: Mon, 24 Aug 2020 13:59:47 -0300 Message-Id: <20200824165948.476427-2-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200824165948.476427-1-marcelo.cerri@canonical.com> References: <20200824165948.476427-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1891224 Update the systemd service for the vss daemon and add a new udev rule to ensure the service will not fail in case vss is not enabled for the guest. The udev rules is responsible for starting the service only when the vss device is available. In the unit file, the service is now bound to the device unit, so the service can be stopped if the device is removed. And the service is also conditioned to the existence of the device, this way we avoid starting and stopping the service during boot if the device is not available. Signed-off-by: Marcelo Henrique Cerri --- debian/linux-cloud-tools-common.hv-vss-daemon.service | 2 ++ debian/linux-cloud-tools-common.hv-vss-daemon.udev | 1 + debian/rules.d/3-binary-indep.mk | 1 + 3 files changed, 4 insertions(+) create mode 100644 debian/linux-cloud-tools-common.hv-vss-daemon.udev diff --git a/debian/linux-cloud-tools-common.hv-vss-daemon.service b/debian/linux-cloud-tools-common.hv-vss-daemon.service index 20717a7bd159..4ff9e796b3b2 100644 --- a/debian/linux-cloud-tools-common.hv-vss-daemon.service +++ b/debian/linux-cloud-tools-common.hv-vss-daemon.service @@ -4,6 +4,8 @@ [Unit] Description=Hyper-V VSS Protocol Daemon ConditionVirtualization=microsoft +ConditionPathExists=/dev/vmbus/hv_vss +BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device [Service] ExecStart=/usr/sbin/hv_vss_daemon -n diff --git a/debian/linux-cloud-tools-common.hv-vss-daemon.udev b/debian/linux-cloud-tools-common.hv-vss-daemon.udev new file mode 100644 index 000000000000..f4b9a91ad4bf --- /dev/null +++ b/debian/linux-cloud-tools-common.hv-vss-daemon.udev @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-vss-daemon.service" diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index d79e866dfe2e..f4dcba21d620 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -201,6 +201,7 @@ ifeq ($(do_tools_hyperv),true) dh_installinit -p$(cloudpkg) -n --name hv-vss-daemon dh_installinit -p$(cloudpkg) -n --name hv-fcopy-daemon dh_installudev -p$(cloudpkg) -n --name hv-kvp-daemon + dh_installudev -p$(cloudpkg) -n --name hv-vss-daemon dh_systemd_enable -p$(cloudpkg) dh_installinit -p$(cloudpkg) -o --name hv-kvp-daemon dh_installinit -p$(cloudpkg) -o --name hv-vss-daemon