From patchwork Tue Apr 11 19:24:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Olson X-Patchwork-Id: 9676017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20A1D600CB for ; Tue, 11 Apr 2017 19:30:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10E38285A2 for ; Tue, 11 Apr 2017 19:30:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0504D285A4; Tue, 11 Apr 2017 19:30:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82831285A2 for ; Tue, 11 Apr 2017 19:30:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy1SL-0004dK-D6; Tue, 11 Apr 2017 19:28:01 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy1On-0004Xv-D8 for xen-devel@lists.xenproject.org; Tue, 11 Apr 2017 19:24:21 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 26/BD-13192-46D2DE85; Tue, 11 Apr 2017 19:24:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRWlGSWpSXmKPExsVyfvU+Lt1k3bc RBmtOm1h83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBlzm2exFSzgqJhy7QpbA+M/ti5GLg4Wgc3M Ep8urGXvYuTkkBDwl/g+5S0jSEJI4AmjxLY9p6CchUwSUxfOhXL2MkpMv/sFylnFKHHs9Cqwf hYBVYlnh+axdjFycLAJqEl8vpIKYooIqEjc3msAUs4s8JdRon/FYTaQcmEBU4kvB9cyg9i8Av oSHTdPM0HYghInZz5hAbGZBXQkFuz+xAYyh1lAWmL5Pw4QUxRo5KuD9SCmhICCxL+TWhD350k cXb0ebKCAgIDEhlcP2CcwCs9CMnMWkpmzEGYuYGRexahRnFpUllqka2Sul1SUmZ5RkpuYmaNr aGCml5taXJyYnpqTmFSsl5yfu4kRGOQMQLCDcfHawEOMkhxMSqK8lxXeRgjxJeWnVGYkFmfEF 5XmpBYfYpTh4FCS4L2pDZQTLEpNT61Iy8wBxhtMWoKDR0mE10wHKM1bXJCYW5yZDpE6xagoJc 7LAZIQAElklObBtcFi/BKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeVeCbOfJzCuBm/4KaDE T0OIzu16CLC5JREhJNTDO8Fni8t903Yr/x21UGNfkMEt+aRFKOvPi5znzwNOJdWuqJ+hzXD/O Z7qmOHBSam9nru87tr3ZxScqG5rsc8VXJHFoWczv2dX8/npdn36/vNfDI3yrn5s96O35MW2W+ CV+n92cp9PDNBYt/ms0PXH5jBtlP3lfrp66asPl6JbZ75kKoz0uHvBVYinOSDTUYi4qTgQAuY AGa+wCAAA= X-Env-Sender: prvs=267faed66=marcolso@amazon.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1491938658!44001441!1 X-Originating-IP: [207.171.190.10] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13586 invoked from network); 11 Apr 2017 19:24:19 -0000 Received: from smtp-fw-33001.amazon.com (HELO smtp-fw-33001.amazon.com) (207.171.190.10) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 11 Apr 2017 19:24:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1491938659; x=1523474659; h=date:from:to:cc:subject:message-id:mime-version; bh=XTOioZW88lbSPImKqZbDhwMdupv6LWimyjHENOxSexE=; b=tMngIXKyEZBpwpi4SM5tTZUEXBwj3ZdgrSnl2p9xDvMJTjwEE6ecPQDO AajKpwY2CuuwLv4jVJwqol6/wle3a/JMik/XoD27ge1hlo0DHNvi2YpMU BFKtxXESBT/CNRdxmicr0tnu6sTBXIdnTfHz8MLs33BFDtd8+9ZEpoRhL A=; X-IronPort-AV: E=Sophos;i="5.37,186,1488844800"; d="scan'208";a="665566874" Received: from sea19-co-svc-lb5-vlan3.sea.amazon.com (HELO email-inbound-relay-71001.iad55.amazon.com) ([10.47.22.166]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Apr 2017 19:24:15 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-71001.iad55.amazon.com (8.14.7/8.14.7) with ESMTP id v3BJOAGo005106 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 11 Apr 2017 19:24:13 GMT Received: from EX13D16UWC004.ant.amazon.com (10.43.162.72) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Tue, 11 Apr 2017 19:24:12 +0000 Received: from amazon.com (10.43.160.19) by EX13D16UWC004.ant.amazon.com (10.43.162.72) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Tue, 11 Apr 2017 19:24:12 +0000 Date: Tue, 11 Apr 2017 12:24:09 -0700 From: Marc Olson To: Message-ID: <20170411192403.GA26778@amazon.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.43.160.19] X-ClientProxiedBy: EX13D05UWB002.ant.amazon.com (10.43.161.50) To EX13D16UWC004.ant.amazon.com (10.43.162.72) Precedence: Bulk X-Mailman-Approved-At: Tue, 11 Apr 2017 19:28:00 +0000 Cc: linux-kernel@vger.kernel.org, Boris Ostrovsky , Roger Pau =?iso-8859-1?Q?Monn=E9?= , David Vrabel Subject: [Xen-devel] [PATCH] blkfront: add uevent for size change X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP When a blkfront device is resized from dom0, emit a KOBJ_CHANGE uevent to notify the guest about the change. This allows for custom udev rules, such as automatically resizing a filesystem, when an event occurs. Signed-off-by: Marc Olson --- drivers/block/xen-blkfront.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 2fee2ee..66abf9c 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1996,6 +1996,7 @@ static void blkfront_connect(struct blkfront_info *info) unsigned long sector_size; unsigned int physical_sector_size; unsigned int binfo; + char *envp[] = { "RESIZE=1", NULL }; int err; switch (info->connected) { @@ -2012,6 +2013,8 @@ static void blkfront_connect(struct blkfront_info *info) sectors); set_capacity(info->gd, sectors); revalidate_disk(info->gd); + kobject_uevent_env(&disk_to_dev(info->gd)->kobj, + KOBJ_CHANGE, envp); return; case BLKIF_STATE_SUSPENDED: