Remove devices from libparted's cache when destroying them (#586622)
Patch looks fine. Is this intended for f13-branch as well? If it has
been tested on any branch I would support its inclusion in F13. Also, it looks like your commit message was truncated. Dave On Wed, 2010-04-28 at 20:41 +0200, Hans de Goede wrote: > Leaving them in the cache causes device.size to report the size of > the old device if later on a new device with the same name gets > created, sometimes leaving to spurious not enough free space to install > selected packages. This patch is also for rhel-6 branch where it fixes > --- > storage/deviceaction.py | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/storage/deviceaction.py b/storage/deviceaction.py > index 859c0f1..4524e7c 100644 > --- a/storage/deviceaction.py > +++ b/storage/deviceaction.py > @@ -217,6 +217,11 @@ class ActionDestroyDevice(DeviceAction): > def execute(self, intf=None): > self.device.destroy() > > + # Make sure libparted does not keep cached info for this device > + # and returns it when we create a new device with the same name > + if self.device.partedDevice: > + self.device.partedDevice.removeFromCache() > + > > class ActionResizeDevice(DeviceAction): > """ An action representing the resizing of an existing device. """ _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list |
Remove devices from libparted's cache when destroying them (#586622)
On second thought, is there any reason not to do this in
StorageDevice.destroy instead of ActionDestroyDevice.execute? Is there any case in which we would want StorageDevice.destroy to run without flushing the cache? Dave On Wed, 2010-04-28 at 15:56 -0500, David Lehman wrote: > Patch looks fine. Is this intended for f13-branch as well? If it has > been tested on any branch I would support its inclusion in F13. Also, it > looks like your commit message was truncated. > > Dave > > On Wed, 2010-04-28 at 20:41 +0200, Hans de Goede wrote: > > Leaving them in the cache causes device.size to report the size of > > the old device if later on a new device with the same name gets > > created, sometimes leaving to spurious not enough free space to install > > selected packages. This patch is also for rhel-6 branch where it fixes > > --- > > storage/deviceaction.py | 5 +++++ > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > diff --git a/storage/deviceaction.py b/storage/deviceaction.py > > index 859c0f1..4524e7c 100644 > > --- a/storage/deviceaction.py > > +++ b/storage/deviceaction.py > > @@ -217,6 +217,11 @@ class ActionDestroyDevice(DeviceAction): > > def execute(self, intf=None): > > self.device.destroy() > > > > + # Make sure libparted does not keep cached info for this device > > + # and returns it when we create a new device with the same name > > + if self.device.partedDevice: > > + self.device.partedDevice.removeFromCache() > > + > > > > class ActionResizeDevice(DeviceAction): > > """ An action representing the resizing of an existing device. """ > > > _______________________________________________ > 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 |
Remove devices from libparted's cache when destroying them (#586622)
Hi,
On 04/28/2010 10:56 PM, David Lehman wrote: Patch looks fine. Is this intended for f13-branch as well? If it has been tested on any branch I would support its inclusion in F13. Also, it looks like your commit message was truncated. I've tested the patch on rhel6-branch. I've pushed it to f13-branch, Regards, Hans _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list |
Remove devices from libparted's cache when destroying them (#586622)
Hi,
On 04/28/2010 11:39 PM, David Lehman wrote: On second thought, is there any reason not to do this in StorageDevice.destroy instead of ActionDestroyDevice.execute? Is there any case in which we would want StorageDevice.destroy to run without flushing the cache? No, we always want to flush the cache, for all device types / classes. Which is why I did it in the DestroyAction execute method, so it applies to all device classes without having to duplicate the code (with the change of forgetting this or that class). Actually I think that for F-14 we need to clean up the device class destroy and teardown methods in general, they are anything but consistent: 1) not all destroy method's first call teardown 2) not all teardown method teardown the formats: * some don't teardown formats at all * some only teardown the current format not the original * some teardown both. And there is a lot of code duplication here. I think we need something like a deviceteardown and then let StorageDevice.teardown do all the "boilerplate" stuff (like tearing down the formats) and call then call deviceteardown. Then all device class specific teardown code can be moved to deviceteardown and we lose all the duplication. Once something like that is in place for teardown and destroy, the purging of the libparted cache can move to devices.py. For know I did not want to make the code duplication bigger, with the risk of adding more inconsistencies. Regards, Hans _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list |
| All times are GMT. The time now is 12:19 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.