[anaconda][master/rhel7-branch][PATCH 3/3] Add GUI and TUI logic to handle unformatted DASDs. (#1064423)
Vratislav Podzimek
vpodzime at redhat.com
Wed Feb 26 09:22:13 UTC 2014
On Wed, 2014-02-26 at 00:07 -0500, Samantha N. Bueno wrote:
> In both graphical and text, if a user selects unformatted DASDs
> from the local disk store, they are formatted when the user opts
> to proceed (either by clicking 'Done' in the GUI or 'c' to
> continue in the TUI).
>
> Following dasdfmt, storage initialization is run again in order
> to properly add the new DASDs to the devicetree and seen by the
> installer.
>
> Resolves:rhbz#1064423
> ---
> pyanaconda/constants.py | 1 +
> pyanaconda/ui/gui/spokes/storage.py | 81 ++++++++++++++++++++++++++++++++++++-
> pyanaconda/ui/tui/spokes/storage.py | 50 +++++++++++++++++++++--
> 3 files changed, 127 insertions(+), 5 deletions(-)
>
> diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
> index cf8a8ea..8de29a9 100644
> --- a/pyanaconda/constants.py
> +++ b/pyanaconda/constants.py
> @@ -131,6 +131,7 @@ THREAD_ISCSI_LOGIN = "AnaIscsiLoginThread"
> THREAD_GEOLOCATION_REFRESH = "AnaGeolocationRefreshThread"
> THREAD_DATE_TIME = "AnaDateTimeThread"
> THREAD_TIME_INIT = "AnaTimeInitThread"
> +THREAD_DASDFMT = "AnaDasdfmtThread"
>
> # Geolocation constants
>
> diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
> index bdd48ef..e565b16 100644
> --- a/pyanaconda/ui/gui/spokes/storage.py
> +++ b/pyanaconda/ui/gui/spokes/storage.py
> @@ -50,17 +50,20 @@ from pyanaconda.ui.gui.spokes.lib.cart import SelectedDisksDialog
> from pyanaconda.ui.gui.spokes.lib.passphrase import PassphraseDialog
> from pyanaconda.ui.gui.spokes.lib.detailederror import DetailedErrorDialog
> from pyanaconda.ui.gui.spokes.lib.resize import ResizeDialog
> +from pyanaconda.ui.gui.spokes.lib.dasdfmt import DasdFormatDialog
> from pyanaconda.ui.gui.categories.system import SystemCategory
> -from pyanaconda.ui.gui.utils import enlightbox, gtk_call_once, gtk_action_wait
> +from pyanaconda.ui.gui.utils import enlightbox, gtk_call_once, gtk_action_wait, ignoreEscape
>
> from pyanaconda.kickstart import doKickstartStorage, getAvailableDiskSpace
> +from blivet import storageInitialize, arch
> from blivet.size import Size
> from blivet.devices import MultipathDevice
> -from blivet.errors import StorageError
> +from blivet.errors import StorageError, DasdFormatError
> from blivet.errors import SanityError
> from blivet.errors import SanityWarning
> from blivet.platform import platform
> from blivet.devicelibs import swap as swap_lib
> +from blivet.devicelibs.dasd import make_unformatted_dasd_list, format_dasd
> from pyanaconda.threads import threadMgr, AnacondaThread
> from pyanaconda.product import productName
> from pyanaconda.flags import flags
> @@ -292,6 +295,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
> self.autoPartType = None
> self.clearPartType = CLEARPART_TYPE_NONE
>
> + if self.data.zerombr.zerombr and arch.isS390():
> + # run dasdfmt on any unformatted DASDs automatically
> + threadMgr.add(AnacondaThread(name=constants.THREAD_DASDFMT,
> + target=self.run_dasdfmt))
> +
> self._previous_autopart = False
>
> self._last_clicked_overview = None
> @@ -357,6 +365,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
> def _doExecute(self):
> self._ready = False
> hubQ.send_not_ready(self.__class__.__name__)
> + # ugly and stupid, but on the off-chance dasdfmt is running, we can't
> + # proceed further with this
> + while threadMgr.get(constants.THREAD_DASDFMT):
> + continue
Is there any reason for doing this busy wait instead of calling
threadMgr.wait(constants.THREAD_DASDFMT)? I believe the result would be
the same.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list