Hi, On 01/12/2010 09:06 PM, David Lehman wrote:
This becomes important when removing a disklabel from a device which has a disklabel and partitions but which is not something we support partitioning (eg: lvm lv). In normal cases the partitions will already have been removed, but in the case of an unsupported partitioned device we ignore the partitions when scanning and so have to remove them this way. --- storage/formats/disklabel.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py index e5fab94..567d26b 100644 --- a/storage/formats/disklabel.py +++ b/storage/formats/disklabel.py @@ -229,6 +229,7 @@ class DiskLabel(DeviceFormat): if not os.access(self.device, os.W_OK): raise DeviceFormatError("device path does not exist") + self.partedDisk.deleteAllPartitions() self.partedDevice.clobber() self.commit() self.exists = False
I would rather not have that deleteAllPartitions() as currently implemented in pyparted gets used. I've been advocating its removal for quite some time now. The problem is that deleteAllPartitions() calls a function in libparted which not only removes the partitions from the disk, but also frees the libparted (c-code) partition objects, so if we still have a reference to any python partedPartition object from this disk around, that python partedPartition object now has a c-level pointer to "random" memory. I realize that in this case we probably don't have any such references around, but still I'm strongly against using this function (as said it should be removed). Regards, Hans _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list