mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Marc Olson <marcolso@amazon.com>
Cc: xen-devel@lists.xenproject.org,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blkfront: add uevent for size change
Date: Tue, 11 Apr 2017 16:04:59 -0400	[thread overview]
Message-ID: <20170411200459.GB30956@char.us.oracle.com> (raw)
In-Reply-To: <20170411192403.GA26778@amazon.com>

On Tue, Apr 11, 2017 at 12:24:09PM -0700, Marc Olson wrote:
> 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.

Looks pretty reasonable.

Could you confirm what the udevadm --monitor --kernel --udev emits when this happens?

Thanks!

> 
> Signed-off-by: Marc Olson <marcolso@amazon.com>
> ---
>  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:
> -- 
> 2.7.4
> 

  reply	other threads:[~2017-04-11 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 19:24 Marc Olson
2017-04-11 20:04 ` Konrad Rzeszutek Wilk [this message]
2017-04-12  0:05   ` Marc Olson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170411200459.GB30956@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcolso@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®