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>
Commit 1689ebb25 removed what I thought was an unused audio
handle in the spice viewer code, but apparently it does
something. Strangely some VMs work fine (linux, windows 7),
but my windows 10 VMs need this to actually get audio.
No clue what that's all about
https://bugzilla.redhat.com/show_bug.cgi?id=1881080
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Don't process events when the window isn't showing
* Only update console/details if that tab is actually selected.
Otherwise in some corner cases we can connect to the VM console
while on the details page
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This is an awkward place to put it, and I'm pretty sure it's not
even useful in the non-events case nowadays due to improved
libvirtobject.py infrastructure
Signed-off-by: Cole Robinson <crobinso@redhat.com>
In weird corner cases this can trigger tracebacks, if the boot
page is refreshed while the hardware list changed underneath us.
This is a step in the direction of unwinding it.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Historically we have not advertised host-passthrough because it was
not recommended for general usage. That stance is softening,
tools like gnome-boxes already set it as the default, and users
continue to ask about it.
We may change the default in virt-manager but it will take more
discussion. This is a tiny move in the direction of hiding it less
than we already do.
Drop the label for host-model and call it by its libvirt XML name,
since otherwise it's hard to tell which combo choice is for each
value
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Inspired by some discussion from here:
https://bugzilla.redhat.com/show_bug.cgi?id=1759454
Most libvirt storage volume creation doesn't actually do anything
with allocation, besides interpreting cap == alloc and cap != alloc.
The exceptions are zfs volumes, and raw file volumes. But it's unclear
what the usecase is for the latter at all.
This drops the allocation spinner and adds checkbox in its place
'Allocate entire volume now'. When enabled, it sets cap == alloc.
We only show this for file volumes. For qcow2 it defaults to unselected
(sparse), for all others it defaults to selected. If it's not showing,
it defaults to selected.
Bundled with this change is showing this field for qcow2, where
we previously only allowed nonsparse here. Libvirt and qemu-img
support non-sparse qcow2 these days.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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>
This is another preference that was added before anyone ever asked
for it. I'm fine with suggesting users remove the device manually
if they don't want it
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Remove the preference option to disable this. This was added with
the initial usbredir support because I was afraid people would
complain. They did complain, but only about the auto redir behavior
of the spice client. We still have a toggle to disable that behavior
If people don't want usbredir devices, I'm comfortable telling
them to remove them manually, or use virt-install
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Convert to pytest style functions
* Move lots of shared code to our App class
* Reduce dogtail sleep amounts to speed up the whole testsuite
* Improve robustness in a lot of areas
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This is hiding useful stuff. It was enabled once upon a time because
it was too noisy but let's see if it gets bad like the past
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Instead of using the title of the dialog and prepending the connection
label, create a new title as a single string. This way it is possible to
translate this title as single sentence.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Use a single label to show the single sentence describing the available
space on the storage pool. This avoids the use of 3 different labels,
partially translated separately, and whose content cannot be moved.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Latest libvirt uses socket activation, so libvirtd.service in
offline state does not indicate a problem necessarily.
Also on Fedora nowadays we have a weak RPM dependency on
libvirt-daemon which we didn't in the past.
Both things combine to make this code less useful and less accurate,
so let's remove most of it.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
virtManager/createvm.py:982:8: W0128: Redeclared variable 'ignore' in assignment (redeclared-assigned-name)
tests/uitests/lib/app.py:12:0: C0411: third party import "from gi.repository import Gio" should be placed before "import dogtail.rawinput" (wrong-import-order)
Signed-off-by: Chen Hanxiao <chenhx.fnst@cn.fujitsu.com>
This uncovered some areas in details.py we weren't handling that
the search view unselects the current selection
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Move the VM status and viewer open checks into the default page
path as well, otherwise opening the details dialog for an offline
VM attempts to connect to the inactive VM console and logs backtraces
Signed-off-by: Cole Robinson <crobinso@redhat.com>
As part of making virt-manager cooperate better with external viewers,
add an option to disable console autoconnect. When opening a VM window
for a running VM, you'll see a 'Connect to console' button in place
of the spice/vnc viewer. Click that and things proceed like normal.
This is useful to prevent virt-manager from disconnecting a virt-viewer
instance that's already attached to a VM
https://bugzilla.redhat.com/show_bug.cgi?id=1793876
Signed-off-by: Cole Robinson <crobinso@redhat.com>
When a VM window is launched for the first for a VM, currently we
set the top window size to 800x600 which is small and arbitrary and
is universally shrinks the viewer too much to fit any OS installer
I can find.
Instead do some hacks to resize the window to accomodate a viewer
widget of 1024x768 which seems to be what QXL graphics give us for
win10 and Fedora 32 installers. So for new VMs hitting the OS installer
we don't see scrollbars.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
- Add ui/console.ui for console-pages and below
- Add move auth and graphics unavailable pages to a new subnotebook
- Move all the menubar handling up into vmwindow
- Clarify the control flow as much as I can come up with
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Right now this is tied to widget focus, which is too strong. This
changes it so that say clicking on the window title or toolbar then
allows the user to use Alt+F to trigger the File menu for example.
This roughly matches how virt-viewer works
https://bugzilla.redhat.com/show_bug.cgi?id=1824480
Signed-off-by: Cole Robinson <crobinso@redhat.com>
We check if the page moved forward in uitests by scraping the top
label. Make sure we do that last when the page changes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Move all the menu building to its own class, for clarity
* Rename the menu 'Consoles' since it contains graphical choice as well
* Strip out the VM console duplicate if it exists
* Simplify the code a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This is a quirk of libvirt that the first <device> is usually a
logical duplicate of the first <serial> device. Adjust virt-xml to
understand this quirk and remove both devices at the same time,
like we already do in virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=1685541
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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>
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>
Allows the user to tweak the XML at the destination, which is already
something that libvirt supports
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Drop the network editing, users can use the details window
* Drop the combo box approach in favor of a regular treeview
* Drop a lot validation checks which are redundant with modern
virtinst. We probably lose some checks but I don't think it's
too important
* Use the cloner API
* Add uitest coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
As much as we can. There's not any current way to actually test
the full guestfs implementation, so we exclude it all
Signed-off-by: Cole Robinson <crobinso@redhat.com>
We haven't shown error dialogs for failed connections for a long
while, so all this processing isn't accomplishing anything anymore
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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>
RAM is rarely changed from the default
heads does not have any explicit virt-manager support
and both are viewable from the XML editor.
So remove the explicit fields for them
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This works fine for the StatusIcon backend, but for the appindicator
backend which communicates every menu changes over dbus this is
super slow. Instead update the menu in place when objects change
state or disappear
https://bugzilla.redhat.com/show_bug.cgi?id=1779362
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This was added in 2014 per user request but we never exposed it in the
UI. This is fairly advanced needs from the console viewer IMO and is
better left to console specific tools like virt-viewer, per our
DESIGN.md
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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>
And not connkey. connkey == name, and name can change with object
rename, so it's a bad pattern to propagate that connkey can be used
as a static lookup key for objects. This begins unwinding it
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Otherwise early 'change' signals can give inconsistent
behavior WRT default 'advanced' expander state
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This code path was never hit because it came after caps.guest_lookup
which errors in this case. We need to check things earlier
Signed-off-by: Cole Robinson <crobinso@redhat.com>
In all modern local cases we will be using openFD to get a direct
file descriptor from the VM, so this code should never be triggered
nowadays
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Break it into disable-libguestfs, fake-systemd-success, and
firstrun-uri suboptions, and adjust using code to match
Signed-off-by: Cole Robinson <crobinso@redhat.com>
And also the embedded label, our default behavior covers
this well enough for what is likely to be an obscure case
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Privatize a bunch of stuff
* Make public API explicit
* Add a few minor public APIs to avoid accessing internal state
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This was added in cb182f7e3 in Mar 2017 to work around a bug in
qemu 2.9. This bug only affects the case of virt-manager running
locally with that version, which after three years should be rare
to non-existent. Remove the workaround
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Privatize a lot of stuff
* Separate out many callbacks as thin wrappers around the real code
* Simplify registering EDIT_ handlers
* Organize things better
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This is pretty obscure, and if it's problematic then libvirt
or qemu should be throwing an error or otherwise reporting it
Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Unset rendernode when spicegl is de-selected
* Set rendernode by default when spicegl is first selected
Signed-off-by: Cole Robinson <crobinso@redhat.com>