From 483f3436aa8826d76d78cdbf5cbc5f3bc44ac65c Mon Sep 17 00:00:00 2001 From: "Hugh O. Brock" Date: Wed, 20 Dec 2006 09:31:09 -0500 Subject: [PATCH] Update non-sparse file UI to match rhel5 patch --- src/virt-manager.glade | 111 ++++++++------------------------------ src/virtManager/create.py | 11 +--- 2 files changed, 25 insertions(+), 97 deletions(-) diff --git a/src/virt-manager.glade b/src/virt-manager.glade index 6a8943115..49cc5c505 100644 --- a/src/virt-manager.glade +++ b/src/virt-manager.glade @@ -4254,15 +4254,11 @@ For all domains - 300 - 100 True Saving VM Image GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER_ON_PARENT False - 300 - 100 True False True @@ -7860,89 +7856,6 @@ TB - - - True - File _Type: - True - True - GTK_JUSTIFY_RIGHT - False - False - 1 - 0.5 - 4 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 7 - 8 - fill - - - - - - - True - False - 0 - - - - True - True - sparse - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - True - - - - - - True - True - non-sparse - True - GTK_RELIEF_NORMAL - True - True - False - True - sparse - - - 6 - False - True - - - - - 3 - 4 - 7 - 8 - fill - fill - - - True @@ -7969,7 +7882,7 @@ TB True - <small><b>Warning:</b> Creating a guest with sparse file storage is quicker, but it can lead to catastrophic failure of the guest in the event the host file system runs out of space.</small> + <small><b>Warning:</b> If you do not allocate the entire disk at VM creation, space will be allocated as needed while the guest is running. If sufficient free space is not available on the host, this may result in data corruption on the guest.</small> False True GTK_JUSTIFY_LEFT @@ -7999,6 +7912,28 @@ TB fill + + + + True + True + Allocate entire virtual disk now? + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 3 + 4 + 7 + 8 + fill + + + diff --git a/src/virtManager/create.py b/src/virtManager/create.py index 400534921..88b56ff18 100644 --- a/src/virtManager/create.py +++ b/src/virtManager/create.py @@ -42,7 +42,6 @@ VM_INSTALL_FROM_CD = 2 VM_STORAGE_PARTITION = 1 VM_STORAGE_FILE = 2 -VM_STORAGE_FILE_SPARSE = False DEFAULT_STORAGE_FILE_SIZE = 500 @@ -187,7 +186,6 @@ class vmmCreate(gobject.GObject): self.window.get_widget("create-memory-startup").set_value(500) self.window.get_widget("create-vcpus").set_value(1) self.window.get_widget("non-sparse").set_active(True) - self.window.get_widget("sparse").set_active(False) model = self.window.get_widget("pv-media-url").get_model() self.populate_url_model(model, self.config.get_media_urls()) model = self.window.get_widget("pv-ks-url").get_model() @@ -516,11 +514,9 @@ class vmmCreate(gobject.GObject): file = self.get_config_disk_image() if file != None and len(file) > 0 and not(os.path.exists(file)): self.window.get_widget("storage-file-size").set_sensitive(True) - self.window.get_widget("sparse").set_sensitive(True) self.window.get_widget("non-sparse").set_sensitive(True) else: self.window.get_widget("storage-file-size").set_sensitive(False) - self.window.get_widget("sparse").set_sensitive(False) self.window.get_widget("non-sparse").set_sensitive(False) if file != None and len(file) > 0 and os.path.isfile(file): size = os.path.getsize(file)/(1024*1024) @@ -547,7 +543,6 @@ class vmmCreate(gobject.GObject): self.window.get_widget("storage-partition-box").set_sensitive(True) self.window.get_widget("storage-file-box").set_sensitive(False) self.window.get_widget("storage-file-size").set_sensitive(False) - self.window.get_widget("sparse").set_sensitive(False) self.window.get_widget("non-sparse").set_sensitive(False) else: self.window.get_widget("storage-partition-box").set_sensitive(False) @@ -721,10 +716,8 @@ class vmmCreate(gobject.GObject): return "%2.2f MB" % (mem/1024.0) def is_sparse_file(self): - if self.window.get_widget("sparse").get_active(): - return True - elif self.window.get_widget("non-sparse").get_active(): + if self.window.get_widget("non-sparse").get_active(): return False else: - return None + return True