linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hotplug "rename" event for kobject_rename()?
@ 2004-09-13 17:14 Kay Sievers
  2004-09-15  0:35 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kay Sievers @ 2004-09-13 17:14 UTC (permalink / raw)
  To: linux-hotplug

Hi,
we currently get hotplug events for kobject "add" and "remove". Wouldn't
it be nice to get the same kind of event for a kobject "rename"? 

We currently fake a hotplug-event with udev while renaming a net-device.
We compose the new DEVPATH and call the network hotplug script from a
dev.d/ callout. If we would get a real "rename" event we can get rid of
that indirection and the rest of userspace can act properly too :).

What do you think about emitting a "rename" event from:
  kobject_rename(struct kobject * kobj, char *new_name)

and add the old name to the environment?

Thanks,
Kay



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hotplug "rename" event for kobject_rename()?
  2004-09-13 17:14 hotplug "rename" event for kobject_rename()? Kay Sievers
@ 2004-09-15  0:35 ` Greg KH
  2004-09-15  1:34 ` Kay Sievers
  2004-09-15  3:50 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2004-09-15  0:35 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Sep 13, 2004 at 07:14:33PM +0200, Kay Sievers wrote:
> Hi,
> we currently get hotplug events for kobject "add" and "remove". Wouldn't
> it be nice to get the same kind of event for a kobject "rename"? 

I don't know, what controls a rename, a userspace event, right?

> We currently fake a hotplug-event with udev while renaming a net-device.
> We compose the new DEVPATH and call the network hotplug script from a
> dev.d/ callout. If we would get a real "rename" event we can get rid of
> that indirection and the rest of userspace can act properly too :).
> 
> What do you think about emitting a "rename" event from:
>   kobject_rename(struct kobject * kobj, char *new_name)

Wouldn't it just be the same as a "remove" and an "add" event?

> and add the old name to the environment?

What would the environment variables look like to show the old and new
names?

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hotplug "rename" event for kobject_rename()?
  2004-09-13 17:14 hotplug "rename" event for kobject_rename()? Kay Sievers
  2004-09-15  0:35 ` Greg KH
@ 2004-09-15  1:34 ` Kay Sievers
  2004-09-15  3:50 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2004-09-15  1:34 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Sep 14, 2004 at 05:35:52PM -0700, Greg KH wrote:
> On Mon, Sep 13, 2004 at 07:14:33PM +0200, Kay Sievers wrote:
> > Hi,
> > we currently get hotplug events for kobject "add" and "remove". Wouldn't
> > it be nice to get the same kind of event for a kobject "rename"? 
> 
> I don't know, what controls a rename, a userspace event, right?

Yes, I only know about the network interfaces and that it triggered from
userspace. But with the new event channel, it's a bit difficult to let the
listeners know about that. We can't just call a hotplug script to fake an event.

> > We currently fake a hotplug-event with udev while renaming a net-device.
> > We compose the new DEVPATH and call the network hotplug script from a
> > dev.d/ callout. If we would get a real "rename" event we can get rid of
> > that indirection and the rest of userspace can act properly too :).
> > 
> > What do you think about emitting a "rename" event from:
> >   kobject_rename(struct kobject * kobj, char *new_name)
> 
> Wouldn't it just be the same as a "remove" and an "add" event?

If we define it as that, it may work. But isn't it a bit funny if a
device has a parent that is "removed" and "added" without affecting
the child devices.

> > and add the old name to the environment?
> 
> What would the environment variables look like to show the old and new
> names?

I thought about the following, but it's just off the top of my head:
  ACTION=rename
  DEVPATH=/class/net/world
  DEVPATH_OLD=/class/net/eth0

Thanks,
Kay


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hotplug "rename" event for kobject_rename()?
  2004-09-13 17:14 hotplug "rename" event for kobject_rename()? Kay Sievers
  2004-09-15  0:35 ` Greg KH
  2004-09-15  1:34 ` Kay Sievers
@ 2004-09-15  3:50 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2004-09-15  3:50 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Sep 15, 2004 at 03:34:34AM +0200, Kay Sievers wrote:
> On Tue, Sep 14, 2004 at 05:35:52PM -0700, Greg KH wrote:
> > On Mon, Sep 13, 2004 at 07:14:33PM +0200, Kay Sievers wrote:
> > > Hi,
> > > we currently get hotplug events for kobject "add" and "remove". Wouldn't
> > > it be nice to get the same kind of event for a kobject "rename"? 
> > 
> > I don't know, what controls a rename, a userspace event, right?
> 
> Yes, I only know about the network interfaces and that it triggered from
> userspace. But with the new event channel, it's a bit difficult to let the
> listeners know about that. We can't just call a hotplug script to fake an event.

Yeah, good point.

> > > We currently fake a hotplug-event with udev while renaming a net-device.
> > > We compose the new DEVPATH and call the network hotplug script from a
> > > dev.d/ callout. If we would get a real "rename" event we can get rid of
> > > that indirection and the rest of userspace can act properly too :).
> > > 
> > > What do you think about emitting a "rename" event from:
> > >   kobject_rename(struct kobject * kobj, char *new_name)
> > 
> > Wouldn't it just be the same as a "remove" and an "add" event?
> 
> If we define it as that, it may work. But isn't it a bit funny if a
> device has a parent that is "removed" and "added" without affecting
> the child devices.

Yes, that is "funny" :)

> > > and add the old name to the environment?
> > 
> > What would the environment variables look like to show the old and new
> > names?
> 
> I thought about the following, but it's just off the top of my head:
>   ACTION=rename
>   DEVPATH=/class/net/world
>   DEVPATH_OLD=/class/net/eth0

Ok, I'm sold on this now.  Care to send a patch?

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-15  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-13 17:14 hotplug "rename" event for kobject_rename()? Kay Sievers
2004-09-15  0:35 ` Greg KH
2004-09-15  1:34 ` Kay Sievers
2004-09-15  3:50 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).