fsdetails: Remove wrpolicy UI

This is an obscure setting. If users need it they can set
it manually in the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-11-13 12:19:35 -05:00
parent 4cfb3aeff1
commit 374ea52be0
5 changed files with 116 additions and 165 deletions

View File

@ -577,7 +577,6 @@ def testDetailsEditDevices2(app):
# Filesystem tweaks
tab = _select_hw(app, win, "Filesystem /target/", "filesystem-tab")
tab.combo_select("Driver:", "Path")
tab.combo_select("Write Policy:", "Immediate")
tab.find("Source path:", "text").set_text("/frib1")
tab.find("Target path:", "text").set_text("newtarget")
tab.find_fuzzy("Export filesystem", "check box").click()

View File

@ -1,25 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.38.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkAdjustment" id="adjustment6">
<property name="upper">18446744073709</property>
<property name="step_increment">100</property>
<property name="page_increment">1000</property>
<property name="step-increment">100</property>
<property name="page-increment">1000</property>
</object>
<!-- n-columns=3 n-rows=8 -->
<object class="GtkGrid" id="vmm-fs-details">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<property name="can-focus">False</property>
<property name="row-spacing">6</property>
<property name="column-spacing">6</property>
<child>
<object class="GtkBox" id="fs-type-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkComboBox" id="fs-type-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<signal name="changed" handler="on_fs_type_combo_changed" swapped="no"/>
</object>
<packing>
@ -31,7 +32,7 @@
<child>
<object class="GtkLabel" id="fs-type-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label">Passthrough</property>
</object>
@ -43,18 +44,18 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-mode-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkComboBox" id="fs-mode-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<signal name="changed" handler="on_fs_mode_combo_changed" swapped="no"/>
</object>
<packing>
@ -66,7 +67,7 @@
<child>
<object class="GtkLabel" id="fs-mode-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Default</property>
</object>
@ -78,18 +79,18 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-driver-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkComboBox" id="fs-driver-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<signal name="changed" handler="on_fs_driver_combo_changed" swapped="no"/>
</object>
<packing>
@ -101,7 +102,7 @@
<child>
<object class="GtkLabel" id="fs-driver-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Default</property>
</object>
@ -113,82 +114,47 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-wrpolicy-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="fs-wrpolicy-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_fs_wrpolicy_combo_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-wrpolicy-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Default</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="fs-target">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="can-focus">True</property>
<property name="invisible-char">●</property>
<signal name="changed" handler="on_fs_target_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="fs-readonly">
<property name="label" translatable="yes">E_xport filesystem as readonly mount</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_fs_readonly_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-source-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="fs-source">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="can-focus">True</property>
<property name="invisible-char">●</property>
<signal name="changed" handler="on_fs_source_changed" swapped="no"/>
</object>
<packing>
@ -201,9 +167,9 @@
<object class="GtkButton" id="fs-source-browse">
<property name="label" translatable="yes">_Browse...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_fs_source_browse_clicked" swapped="no"/>
</object>
<packing>
@ -214,133 +180,119 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-type-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-type-combo</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-type-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-mode-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">M_ode:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-mode-combo</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-mode-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-driver-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Driver:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-driver-combo</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-driver-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-wrpolicy-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Write Policy:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-wrpolicy-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-source-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label">src labelll:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-source</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-source</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Ta_rget path:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-target</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-target</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-ram-source-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label">_Usage:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-ram-source-spin</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-ram-source-spin</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-ram-source-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkSpinButton" id="fs-ram-source-spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="halign">end</property>
<property name="adjustment">adjustment6</property>
<property name="climb_rate">1</property>
<property name="climb-rate">1</property>
<signal name="changed" handler="on_fs_ram_source_changed" swapped="no"/>
</object>
<packing>
@ -352,7 +304,7 @@
<child>
<object class="GtkLabel" id="fs-ram-units-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">MiB</property>
</object>
@ -364,38 +316,38 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-format-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Format:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-format-combo</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">fs-format-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="fs-format-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkComboBox" id="fs-format-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
<property name="can-focus">False</property>
<property name="has-entry">True</property>
<signal name="changed" handler="on_fs_format_combo_changed" swapped="no"/>
<child internal-child="entry">
<object class="GtkEntry" id="fs-format-entry">
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="can-focus">True</property>
<property name="width-chars">10</property>
</object>
</child>
</object>
@ -408,7 +360,7 @@
<child>
<object class="GtkLabel" id="fs-format-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Default</property>
</object>
@ -420,9 +372,33 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</interface>

View File

@ -34,7 +34,6 @@ class vmmFSDetails(vmmGObjectUI):
"on_fs_driver_combo_changed": self.change_field,
"on_fs_source_browse_clicked": self.browse_fs_source,
"on_fs_mode_combo_changed": self.notify_change,
"on_fs_wrpolicy_combo_changed": self.notify_change,
"on_fs_readonly_toggled": self.notify_change,
"on_fs_format_combo_changed": self.notify_change,
"on_fs_source_changed": self.notify_change,
@ -110,8 +109,6 @@ class vmmFSDetails(vmmGObjectUI):
simple_store_set("fs-driver-combo", drivers + [None])
simple_store_set("fs-format-combo", ["raw", "qcow2"], capitalize=False)
simple_store_set("fs-wrpolicy-combo",
DeviceFilesystem.WRPOLICIES + [None])
self.show_pair_combo("fs-type", self.conn.is_container_only())
self.show_check_button("fs-readonly",
self.conn.is_qemu() or
@ -123,7 +120,6 @@ class vmmFSDetails(vmmGObjectUI):
self.widget("fs-mode-combo").set_active(0)
self.widget("fs-driver-combo").set_active(0)
self.widget("fs-format-combo").set_active(0)
self.widget("fs-wrpolicy-combo").set_active(0)
self.widget("fs-source").set_text("")
self.widget("fs-target").set_text("")
self.widget("fs-readonly").set_active(False)
@ -133,10 +129,6 @@ class vmmFSDetails(vmmGObjectUI):
return uiutil.get_list_selection(self.widget("fs-mode-combo"),
check_visible=True)
def get_config_fs_wrpolicy(self):
return uiutil.get_list_selection(self.widget("fs-wrpolicy-combo"),
check_visible=True)
def get_config_fs_type(self):
if self.widget("fs-type-label").is_visible():
return self.widget("fs-type-label").get_text()
@ -161,7 +153,6 @@ class vmmFSDetails(vmmGObjectUI):
self.set_config_value("fs-type", dev.type)
self.set_config_value("fs-mode", dev.accessmode)
self.set_config_value("fs-driver", dev.driver_type)
self.set_config_value("fs-wrpolicy", dev.driver_wrpolicy)
self.set_config_value("fs-format", dev.driver_format)
if dev.type != DeviceFilesystem.TYPE_RAM:
self.widget("fs-source").set_text(dev.source)
@ -199,12 +190,6 @@ class vmmFSDetails(vmmGObjectUI):
fsdriver is None))
uiutil.set_grid_row_visible(self.widget("fs-mode-box"), show_mode)
show_wrpol = bool(ismount and
fsdriver and (fsdriver == DeviceFilesystem.DRIVER_PATH or
fsdriver == DeviceFilesystem.DRIVER_HANDLE))
uiutil.set_grid_row_visible(self.widget("fs-wrpolicy-box"),
show_wrpol)
show_ram_source = fstype == DeviceFilesystem.TYPE_RAM
uiutil.set_grid_row_visible(
self.widget("fs-ram-source-box"), show_ram_source)
@ -218,7 +203,6 @@ class vmmFSDetails(vmmGObjectUI):
show_mode_combo = False
show_driver_combo = False
show_wrpolicy_combo = self.conn.is_qemu() or self.conn.is_test()
if fstype == DeviceFilesystem.TYPE_TEMPLATE:
source_text = _("Te_mplate:")
else:
@ -232,7 +216,6 @@ class vmmFSDetails(vmmGObjectUI):
self.widget("fs-source-title").set_use_underline(True)
self.show_pair_combo("fs-mode", show_mode_combo)
self.show_pair_combo("fs-driver", show_driver_combo)
self.show_pair_combo("fs-wrpolicy", show_wrpolicy_combo)
def change_field(self, src):
self.update_fs_rows()
@ -275,7 +258,6 @@ class vmmFSDetails(vmmGObjectUI):
readonly = self.get_config_fs_readonly()
driver = self.get_config_fs_driver()
fsformat = self.get_config_fs_format()
wrpolicy = self.get_config_fs_wrpolicy()
dev = DeviceFilesystem(conn)
if fstype == DeviceFilesystem.TYPE_RAM:
@ -297,8 +279,6 @@ class vmmFSDetails(vmmGObjectUI):
dev.driver_format = "raw"
elif driver == DeviceFilesystem.DRIVER_NBD:
dev.driver_format = fsformat
if wrpolicy:
dev.driver_wrpolicy = wrpolicy
dev.validate()
return dev

View File

@ -930,7 +930,6 @@ class vmmDomain(vmmLibvirtObject):
# pylint: disable=maybe-no-member
editdev.type = newdev.type
editdev.accessmode = newdev.accessmode
editdev.driver_wrpolicy = newdev.driver_wrpolicy
editdev.driver_type = newdev.driver_type
editdev.driver_format = newdev.driver_format
editdev.readonly = newdev.readonly

View File

@ -24,9 +24,6 @@ class DeviceFilesystem(Device):
MODE_SQUASH = "squash"
MODES = [MODE_PASSTHROUGH, MODE_MAPPED, MODE_SQUASH]
WRPOLICY_IMM = "immediate"
WRPOLICIES = [WRPOLICY_IMM]
DRIVER_PATH = "path"
DRIVER_HANDLE = "handle"
DRIVER_LOOP = "loop"