mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
details: Allow viewing and changing disk serial num
This commit is contained in:
@@ -338,6 +338,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
"on_disk_cache_combo_changed": self.config_enable_apply,
|
||||
"on_disk_bus_combo_changed": self.config_enable_apply,
|
||||
"on_disk_format_changed": self.config_enable_apply,
|
||||
"on_disk_serial_changed": self.config_enable_apply,
|
||||
|
||||
"on_network_source_combo_changed": self.config_enable_apply,
|
||||
"on_network_bridge_changed": self.config_enable_apply,
|
||||
@@ -1845,17 +1846,20 @@ class vmmDetails(vmmGObjectUI):
|
||||
cache = self.get_combo_label_value("disk-cache")
|
||||
fmt = self.window.get_widget("disk-format").child.get_text()
|
||||
bus = self.get_combo_label_value("disk-bus")
|
||||
serial = self.window.get_widget("disk-serial").get_text()
|
||||
|
||||
return self._change_config_helper([self.vm.define_disk_readonly,
|
||||
self.vm.define_disk_shareable,
|
||||
self.vm.define_disk_cache,
|
||||
self.vm.define_disk_driver_type,
|
||||
self.vm.define_disk_bus],
|
||||
self.vm.define_disk_bus,
|
||||
self.vm.define_disk_serial],
|
||||
[(dev_id_info, do_readonly),
|
||||
(dev_id_info, do_shareable),
|
||||
(dev_id_info, cache),
|
||||
(dev_id_info, fmt),
|
||||
(dev_id_info, bus)])
|
||||
(dev_id_info, bus),
|
||||
(dev_id_info, serial)])
|
||||
|
||||
# Audio options
|
||||
def config_sound_apply(self, dev_id_info):
|
||||
@@ -2346,6 +2350,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
idx = disk.disk_bus_index
|
||||
cache = disk.driver_cache
|
||||
driver_type = disk.driver_type or ""
|
||||
serial = disk.serial
|
||||
show_format = (not self.is_customize_dialog or
|
||||
disk.path_exists(disk.conn, disk.path))
|
||||
|
||||
@@ -2382,6 +2387,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
self.populate_disk_bus_combo(devtype, no_default)
|
||||
self.set_combo_label("disk-bus", bus)
|
||||
self.window.get_widget("disk-serial").set_text(serial or "")
|
||||
|
||||
button = self.window.get_widget("config-cdrom-connect")
|
||||
if is_cdrom or is_floppy:
|
||||
|
||||
@@ -544,6 +544,11 @@ class vmmDomain(vmmLibvirtObject):
|
||||
|
||||
editdev.bus = newval
|
||||
return self._redefine_device(change, devobj)
|
||||
def define_disk_serial(self, devobj, val):
|
||||
def change(editdev):
|
||||
if val != editdev.serial:
|
||||
editdev.serial = val or None
|
||||
return self._redefine_device(change, devobj)
|
||||
|
||||
# Network define methods
|
||||
|
||||
|
||||
@@ -3362,7 +3362,7 @@ I/O:</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table11">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<property name="row_spacing">3</property>
|
||||
@@ -3386,8 +3386,8 @@ I/O:</property>
|
||||
<property name="mnemonic_widget">disk-format</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -3449,8 +3449,8 @@ I/O:</property>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -3458,13 +3458,13 @@ I/O:</property>
|
||||
<widget class="GtkLabel" id="label32">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Disk B_us:</property>
|
||||
<property name="label" translatable="yes">Disk b_us:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-bus-combo</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -3497,6 +3497,54 @@ I/O:</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label73">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Serial num_ber:</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox23">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="disk-serial">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="width_chars">20</property>
|
||||
<signal name="changed" handler="on_disk_serial_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment44">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
||||
Reference in New Issue
Block a user