On Fri, Oct 16, 2015 at 11:00:19AM +0200, Arvin Schnell wrote:
> On Thu, Oct 15, 2015 at 06:17:06PM +0200, Arvin Schnell wrote:
> > On Thu, Oct 15, 2015 at 05:30:15PM +0200, Martin Vidner wrote:
> 
> > > What is a Holder? It seems to be characterized by having a source
> > > sid and a target sid, which still does not give me a hint.
> > > Its subclasses Subdevice and User are even more opaque to me.
> > 
> > Technical it's the edge in the graph, so it expresses what device
> > is linked what device. The name I have borrowed from sysfs (but
> > it's not the same as in sysfs), e.g. on my system I have
> > (simplified)
> > 
> > # ll /sys/block/sda/sda2/holders/
> > lrwxrwxrwx 1 root root 0 Oct 15 17:17 dm-0 -> 
> > ../../../../../../../../../../virtual/block/dm-0
> > lrwxrwxrwx 1 root root 0 Oct 15 17:17 dm-1 -> 
> > ../../../../../../../../../../virtual/block/dm-1

Ah, interesting. As an illustration, this is what I get on 2
different machines with
LANG=C ls -l `find /sys/block/*/ -type l` | egrep holders\|slaves | cut -d' ' 
-f9-

prutrz:
/sys/block/dm-0/slaves/sda3 -> 
../../../../pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda3
/sys/block/dm-1/holders/dm-2 -> ../../dm-2
/sys/block/dm-1/holders/dm-3 -> ../../dm-3
/sys/block/dm-1/holders/dm-4 -> ../../dm-4
/sys/block/dm-1/holders/dm-5 -> ../../dm-5
/sys/block/dm-1/holders/dm-6 -> ../../dm-6
/sys/block/dm-1/slaves/sda3 -> 
../../../../pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda3
/sys/block/dm-2/slaves/dm-1 -> ../../dm-1
/sys/block/dm-3/slaves/dm-1 -> ../../dm-1
/sys/block/dm-4/slaves/dm-1 -> ../../dm-1
/sys/block/dm-5/holders/dm-7 -> ../../dm-7
/sys/block/dm-5/slaves/dm-1 -> ../../dm-1
/sys/block/dm-6/slaves/dm-1 -> ../../dm-1
/sys/block/dm-7/slaves/dm-5 -> ../../dm-5
/sys/block/sda/sda3/holders/dm-0 -> 
../../../../../../../../../../virtual/block/dm-0
/sys/block/sda/sda3/holders/dm-1 -> 
../../../../../../../../../../virtual/block/dm-1

mrakoplas:
/sys/block/dm-0/slaves/loop0 -> ../../loop0
/sys/block/dm-0/slaves/loop1 -> ../../loop1
/sys/block/loop0/holders/dm-0 -> ../../dm-0
/sys/block/loop1/holders/dm-0 -> ../../dm-0

> > In the graph there are different holders.
> > 
> > - Subdevice: E.g. a partition is the subdevice of a Disk and a
> >   logical volume is the subdevice of a volume group.
> > 
> > - User: E.g. a partition is used by a volume group (the case on
> >   my system), a disk is used by a RAID, a logical volume is used
> >   by a filesystem.
> > 
> > So far the distinction is not really important so it could
> > change.
> 
> The idea is of course to have more Holder classes that even have
> data. E.g. a RaidUser which has a "spare device" flag or a
> FilesystemUser which has a "journal/log device" flag.
> 
> By keeping that data in the holders you don't need special care
> when manipulating the graph, e.g. removing a device or copying
> the graph.
> 
> With extra lists in the Raid or Filesystem object such special
> care would be needed.

Thanks for the explanation.

I didn't mean to object to the existence of these classes.
Association classes are fine. I'm trying to find a fitting and
accurate name and description for them.

So is there a 1-1 correspondence between a Holder and an edge in the
DeviceGraph? Then I think a little more explanatory name would be
Dependency, with a description "an edge in the DeviceGraph"

The subclasses make more sense to me if they are phrased as verbs:
  User -> Uses
  Subdevice -> Contains
-- 
Martin Vidner, YaST Team
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu

Attachment: signature.asc
Description: Digital signature

Reply via email to