Re: [PATCH] Remove devices from libparted's cache when destroying them (#586622)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux