From: Rusty Russell <rusty@rustcorp.com.au>
To: Amit Shah <amit.shah@redhat.com>
Cc: "Greg KH" <gregkh@linuxfoundation.org>,
virtualization@lists.linux-foundation.org,
"Sjur Brændeland" <sjur.brandeland@stericsson.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [RFC] virtio_console: Add DRIVER and INTERFACE to uevent.
Date: Tue, 22 Jan 2013 09:55:20 +1030 [thread overview]
Message-ID: <87pq0yw23j.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1358425438-4633-1-git-send-email-sjur.brandeland@stericsson.com>
sjur.brandeland@stericsson.com writes:
> From: Sjur Brændeland <sjur.brandeland@stericsson.com>
>
> Add information so rproc-serial can be easily recogniced
> from user space. Add the following information to uevent:
> DRIVER=virtio_console|virtio_rproc_serial
> INTERFACE=grand-parent/parent/name
>
> Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
> ---
> Hi,
>
> I need some way to identify the major/minor number for
> the rproc-serial device, given the udev event.
> Review comments are welcomed.
>
> Thanks,
> Sjur
Hmm, I send all uevent questions to Greg KH (CC'd).
Thanks,
Rusty.
> drivers/char/virtio_console.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index 031be0b..96c5ed9 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -2190,6 +2190,27 @@ static struct virtio_driver virtio_rproc_serial = {
> .remove = virtcons_remove,
> };
>
> +int class_virtio_ports_uevent(struct device *_dev, struct kobj_uevent_env *env)
> +{
> + struct port *port = dev_get_drvdata(_dev);
> + struct device *dev;
> + int err;
> +
> + if (!port || !port->portdev || !port->portdev->vdev)
> + return 0;
> +
> + dev = &port->portdev->vdev->dev;
> + err = add_uevent_var(env, "DRIVER=%s", dev->driver->name);
> + if (err)
> + return err;
> +
> + return add_uevent_var(env, "INTERFACE=%s/%s/%s",
> + dev->parent->parent ?
> + dev_name(dev->parent->parent) : "",
> + dev->parent ? dev_name(dev->parent) : "",
> + dev_name(dev));
> +}
> +
> static int __init init(void)
> {
> int err;
> @@ -2201,6 +2222,7 @@ static int __init init(void)
> return err;
> }
>
> + pdrvdata.class->dev_uevent = class_virtio_ports_uevent;
> pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL);
> if (!pdrvdata.debugfs_dir) {
> pr_warning("Error %ld creating debugfs dir for virtio-ports\n",
> --
> 1.7.5.4
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2013-01-21 23:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 12:23 [RFC] virtio_console: Add DRIVER and INTERFACE to uevent sjur.brandeland
2013-01-21 23:25 ` Rusty Russell [this message]
2013-01-22 16:16 ` Greg KH
2013-01-24 13:30 ` Sjur Brændeland
2013-01-24 16:51 ` Greg KH
2013-01-25 9:27 ` Amit Shah
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=87pq0yw23j.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=amit.shah@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=mst@redhat.com \
--cc=sjur.brandeland@stericsson.com \
--cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.