Commit Graph

72 Commits

Author SHA1 Message Date
Pavel Hrdina
3247dab74c meson: add virtManager files
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-11-12 23:18:32 +01:00
Cole Robinson
7ae3e10bc4 netlist: Fix UI error when virtual network doesn't exist
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-02 13:22:45 -05:00
Cole Robinson
cbc5b89707 Clean up FileChooser usage a bit
* Move browse_reason handling entirely into storagebrowser.py
* Open code some of the browse_local logic at the few callers

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-12-14 12:31:17 -05:00
Lin Ma
58f5e36da7 fsdetails: Fix an error with source.socket of virtiofs
Using the source.socket of virtiofs needs a virtiofsd daemon launched
outside of libvirtd, So the filesystem UI doesn't support it yet. If
users need it they can set it manually in the XML editor.
But if we view the filesystem info of such a VM on the details page,
It fails with this error message:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details/details.py", line 1713, in _refresh_page
    self._refresh_filesystem_page(dev)
  File "/usr/share/virt-manager/virtManager/details/details.py", line 2241, in _refresh_filesystem_page
    self.fsDetails.set_dev(dev)
  File "/usr/share/virt-manager/virtManager/device/fsdetails.py", line 193, in set_dev
    self.widget("fs-source").set_text(dev.source)
TypeError: Argument 1 does not allow None as a value

This patch fixes above issue by leaving the 'source path' info blank in
case of source.socket.
In this case, Considering that showing 'target path' info without source
info is kind of meaningless, So this patch leaves the 'target path' info
blank as well.

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-17 10:24:10 -04:00
Cole Robinson
9c0a132f2a fsdetails: Point users to Memory screen if shared memory not enabled
If the user selects virtiofs when editting or adding a new VM, and
we don't detect that they have shared memory enabled, show
a warning label in the UI pointing them to the Memory screen.

It would be nicer if we did this for them, but to get that totally
correct would require both duplicating libvirt's shared memory
detection logic, and some surgery to the addhw wizard. This is good
enough for now

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:44:29 -05:00
Cole Robinson
a7682fc9eb fsdetails: Show virtio-9p vs virtiofs driver field
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson
72b7dcaceb fsdetails: Hide 'Type:' field for qemu driver
The qemu driver only accepts type=mount

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson
fd079a6132 fsdetails: Drop 'Mode:' UI
We only ever show mapped vs squashed, and the difference is pretty
advanced, so if users need it they can use the XML editor. Upcoming
virtiofs support will also make handling this field more complicated

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson
fd181cecc3 virtManager: Split out tpmdetails.py and tweak it
Split out tpmdetails.py, following the pattern of fsdetails.py. This
adds more UI editing fields for an already attached TPM.

Move the model and version under an 'Advanced options' expander,
since we should be getting this correct by default.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:22 -05:00
Cole Robinson
8377b7f7b6 details: Remove 'detect zeroes' UI
After checking with qemu devs, this option is not really recommended
for common usage and doesn't get used much in practice. So I don't
think it is suitable for the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 13:50:53 -05:00
Cole Robinson
6c3b5def81 netlist: Revive portgroup UI
I removed Portgroup UI in 4c3c53f773 release 3.0.0, but there's been
a steady stream of requests to bring it back. It seems it's commonly
used with some certain openvswitch config.

Maint burden isn't too bad. Let's bring it back

Fixes: https://github.com/virt-manager/virt-manager/issues/169

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 16:01:17 -05:00
Cole Robinson
c6bf106dd3 device: netlist: Rework source row data structure
Put non-UI bits into a class, rather that stuff them into gtk
columns. Simplifies adding bits here

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 15:35:55 -05:00
Cole Robinson
2815b7406e gfxdetails: Fix switching from listen=none to listen=address
... with the 'hypervisor default' address. In this case, we need to
force set port=-1 in the XML, to make the changes actually stick

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-20 16:34:59 -05:00
Cole Robinson
10515ea167 gfxdetails: Default to configured graphics type, not always spice
So if the user chooses a different value from Preferences, or
app is built with a different value, default to that in Add Hardware

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-01 11:24:43 -04:00
Cole Robinson
e7222b5058 addstorage: Don't pass None to widget.set_active()
Older pygobject can't handle it. Mentioned here:
https://github.com/virt-manager/virt-manager/issues/188

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-21 17:17:33 -05:00
Cole Robinson
488f153655 fsdetails: Rework XML building logic
Make it work more like gfxdetails. The problem with the current
approach is that it requires effectively rebuilding the whole device
to match the original device when we want to edit a single field,
which is error prone.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 16:09:21 -05:00
Cole Robinson
fca338d2d1 fsdetails: Remove some dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 17:05:00 -05:00
Cole Robinson
41023192ca fsdetails: Stop showing the 'driver' combo for qemu
The only valid value now is 'path' which is also the default,
so drop the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:17:41 -05:00
Cole Robinson
b7b75ab8fc fsdetails: Drop driver="handle" UI
It was removed in qemu 4.0.0

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:09:03 -05:00
Cole Robinson
2b864a9294 fsdetails: Remove the combo vs label dynamic
If something would normally be shown only in a label, just
hide the row entirely. This was interesting for viewer XML
properties before we had the XML editor, but now it doesn't
add much

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 12:53:10 -05:00
Cole Robinson
374ea52be0 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>
2020-11-13 12:20:57 -05:00
Cole Robinson
3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
129865aea0 mediacombo: Clear text entry when New VM is launched
We were leaving the ISO field populated with whatever the old value
was. This is likely useful in some cases but it's consistent with
how we handle fields in the rest of the wizard, and has some weird
interaction with OS detection

Fixes: #159

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-30 10:35:21 -04:00
Cole Robinson
9a5ab50b51 gfxdetails: Use a single 'changed' signal
And absord device building from addhardware. This moves all the
knowledge to gfxdetails, which saves sprinkling it around in other
places

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-21 22:11:17 -04:00
Cole Robinson
ba08f84b34 addstorage: Return to using qcow2 sparse by default
https://bugzilla.redhat.com/show_bug.cgi?id=1759454

See 15a6a7e210

The idea behind virt-manager's sparse vs nonsparse default, is that if
the user selected 'raw' for as the default image format, assume they
want to maximize performance, so fully allocate the disk.

qcow2 didn't support anything except sparse, so the sparse=True vs
sparse=False made no difference. So we always set sparse=False

Then qcow2 grows non-sparse support, and virt-manager is suddenly
defaulting to it, which is not the intention.

Default to sparse when requested format isn't raw

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-20 10:11:36 -04:00
Cole Robinson
64222783d2 addhardware: Allow settings USB removable setting
We need to update addstorage when the user changes the bus setting

Fixes: #148

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 18:12:13 -04:00
Cole Robinson
ac51ff8684 cli: Fill in all --filesystem suboptions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
7d69783042 virtManager: misc reference leak fixes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:32:00 -04:00
Cole Robinson
d073ee9a48 addstorage: Revive disk serial UI
coreos is going to start using disk serial for ignition disk, so
setting this in the UI for distro testing will become more common

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:32:00 -04:00
Cole Robinson
c54da68535 addstorage: Absorb advanced field UI
Share the UI for changing all these disk properties:

- shareable
- readonly
- removable
- cache
- discard
- detect zeroes

Move them all under the 'Advanced options' expander in details, and
add the checkbox options to the addhardware wizard.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:32:00 -04:00
Cole Robinson
a10d746c41 gfxdetails: Update UI a bit
Refactor the internals to cleanly separate the pieces that fill in
the UI, and the pieces that react to UI state to dynamically show/hide
fields.

Improve spice GL warnings while he are here, and several other minor
fixes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 20:10:34 -04:00
Cole Robinson
bd4b53e7da netlist: Remove some leftover print debugging
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 18:04:29 -04:00
Cole Robinson
e45a2228dc objects: Erase the notion of connkey
Make it explicit that all uses of this is actually the object
name. We already leaked this abstraction in several places so better
to make it explicit. This also communicates to users that this is a
field that is not immutable so it shouldn't be used as a unique key

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson
e4c0191f83 createvm: Only check network selection on final page
Otherwise early 'change' signals can give inconsistent
behavior WRT default 'advanced' expander state

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson
70a5cb7b55 gfxdetails: Improve UI interaction with spice GL + rendernode
* Unset rendernode when spicegl is de-selected
* Set rendernode by default when spicegl is first selected

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 08:35:52 -04:00
Cole Robinson
5ccbcb898f uitests: Finish netlist.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
ea49c1d932 netlist: Rework the 'no network' case
Always force a network selection. If we have to fall back to
manual bridge UI because nothing else exists, show a warning.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
153dcba126 uitests: test createvm.py with an empty connection
Fix the 'No networking' createvm case that it shows was broken

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
f15cdd732d graphics: Remove spice GL/rendernode version support warnings
The versions we are warning about are all over 4 years old, and
these warnings were initially just informative to help users know
when the config wasn't going to work. Drop most of it. Still warn
in the UI when a VM misconfig will prevent spice GL from working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
4b4f2ddba3 uitests: Finish addstorage.py coverage
We need to wire up some craziness to make path permission
searching fail, but this is a critical area to get correct
so it is worth it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
57f916461f uitests: Finish fsdetails.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
c323ecfd55 fsdetails: Rework xml builder APIs
Don't have the caller call a validate function, they all catch
errors anyways. Let the build step raise error if there's a problem

Drop some validation checks that libvirt should be performing for us

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
4c439cda21 uitests: Add vsockdetails full coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
bc9d6cf6d5 Drop some explicit openvz handling
I don't think many, if any, people are using virt-manager with
openvz. Drop the specific handling the filesystem UI, users can use
the raw XML editor if they need special behavior

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
886339e8dd virtManager: add coverage annotations and remove dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
d0e725f439 gfxdetails: Remove explicit SDL UI fields
Users can look at the device XML easy enough, and very few people
are using SDL with libvirt

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Pino Toscano
71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano
deb6462843 i18n: avoid string puzzle in display autoport string
When updating the checkbox aobut the automatic port, set a full string
(without or with the port) instead of "cutting" an existing label.
Not only it avoids to manipulate a UI string, it also allows translators
to properly translate the whole string that includes a port.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano
0145d9838b i18n: fix few spellings
"iSCSI", "KVM", "QEMU", "UNIX", "UUID", "VirtIO", "XML", "vCPU".

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Cole Robinson
fec9f0b136 po: Fix message format warnings printed from xgettext
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00