DMLinearDevice is treated like a disk, meaning it can be partitioned.
Like the other device-mapper disk types, it will not have a meaningful
teardown method.
Move setupPartitions up into DMDevice so it can be used by both
DMLinearDevice and MultipathDevice. Also add teardownPartitions even
though it won't get called as of now. Move "slave" property up into
DMDevice also, since all DMDevice subclasses require at least one
backing device.
---
pyanaconda/storage/devicelibs/dm.py | 24 +++++++
pyanaconda/storage/devices.py | 124 ++++++++++++++++++++++++++++++-----
2 files changed, 132 insertions(+), 16 deletions(-)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
12-01-2010, 02:48 PM
Chris Lumens
Add support for linear device-mapper devices.
> + def __init__(self, name, format=None, size=None, dmUuid=None,
> + exists=None, parents=None, sysfsPath='):
> + """ Create a DMLinearDevice instance.
> +
> + Arguments:
> +
> + name -- the device name (generally a device node's basename)
> +
> + Keyword Arguments:
> +
> + size -- the device's size (units/format TBD)
> + dmUuid -- the device's device-mapper UUID
> + sysfsPath -- sysfs device path
> + format -- a DeviceFormat instance
> + parents -- a list of required Device instances
> + exists -- indicates whether this is an existing device
> + """
> + if not parents:
> + raise ValueError("DMLinearDevice requires a backing block device")
> +
> + dmUuid = "ANACONDA-%s" % name
> +
> + DMDevice.__init__(self, name, format=format, size=size,
> + parents=parents, sysfsPath=sysfsPath,
> + exists=exists, target="linear", dmUuid=dmUuid)
Do you really intend to override any dmUuid passed in to __init__ with
the default later on like this?
Otherwise, this looks fine except for all the udev_settle but I suppose
there's nothing we can do about that.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
12-01-2010, 02:55 PM
David Lehman
Add support for linear device-mapper devices.
On Wed, 2010-12-01 at 10:48 -0500, Chris Lumens wrote:
> > + def __init__(self, name, format=None, size=None, dmUuid=None,
> > + exists=None, parents=None, sysfsPath='):
> > + """ Create a DMLinearDevice instance.
> > +
> > + Arguments:
> > +
> > + name -- the device name (generally a device node's basename)
> > +
> > + Keyword Arguments:
> > +
> > + size -- the device's size (units/format TBD)
> > + dmUuid -- the device's device-mapper UUID
> > + sysfsPath -- sysfs device path
> > + format -- a DeviceFormat instance
> > + parents -- a list of required Device instances
> > + exists -- indicates whether this is an existing device
> > + """
> > + if not parents:
> > + raise ValueError("DMLinearDevice requires a backing block device")
> > +
> > + dmUuid = "ANACONDA-%s" % name
> > +
> > + DMDevice.__init__(self, name, format=format, size=size,
> > + parents=parents, sysfsPath=sysfsPath,
> > + exists=exists, target="linear", dmUuid=dmUuid)
>
> Do you really intend to override any dmUuid passed in to __init__ with
> the default later on like this?
For these devices, yes. However, we could set up the UUID in the
devicetree and pass it to the constructor instead. A little more
straightforward, probably. I'm working on a small set of follow-on
cleanup patches and will include the aforementioned.
Dave
>
> Otherwise, this looks fine except for all the udev_settle but I suppose
> there's nothing we can do about that.
>
> - Chris
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list