| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libvirt-glib dependency was dropped in commit 296f91c in favor to
maintain the full glib event loop integration into virt-viewer tree.
This decision was taken because libvirt-glib was not mature enough at
that time, which is not the case nowadays.
The libvirt-glib version chosen as dependency (0.1.8) is the first
release that includes the fixes for the glib event loop integration that
were backported to virt-viewer last year.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of this patch consists in code being shuffled around to fit the
expected flow while using the new APIs. I tried my best to make this
patch the less intrusive as possible. Main changes are:
- Updated build requirements
* glib version 2.38
* gtk+ version 3.10
* gio
- VirtViewerApp is now a subclass of GtkApplication.
Some mainloop calls were replaced:
* gtk_main() -> g_application_run()
* gtk_quit() -> g_application_quit()
- Unified command line option handling.
The logic has moved from the main functions and split in common
options, and specific ones for each application. With this, the main
functions were highly simplified, and now basically responsible for
instantiating the App object and running the main loop.
- All Window objects must be associated with the Application.
With this, there is no need to emit our own 'window-added'/'window-
removed' signals, as those will be emited by GtkApplication whenever
gtk_application_add_window() and gtk_application_remove_window() are
called. Also, 'window-removed' was not being used anywhere.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
|
|
|
| |
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
|
|
|
| |
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the connection to libvirtd is lost, virt-viewer starts polling for
libvirtd to come back. The polling mechanism is also used when
connecting to very old libvirtd which don't support
virConnectDomainEventDeregisterAny().
Currently, once we could reconnect to libvirtd, virt-viewer will keep
polling, thus behaving as if the libvirtd connection does not support
virConnectDomainEventDeregisterAny(). This commit makes sure we stop
polling once the new libvirtd connection is established.
This has the side-effect of preventing
https://bugzilla.redhat.com/show_bug.cgi?id=1271519 from occurring with
recent libvirt as it's caused by some race occurring when using the
polling code.
|
|
|
|
|
|
|
| |
Setting the keepAlive on libvirt connection is needed in order to
receive the CloseCallback event.
Resolves: rhbz#1164052
|
|
|
|
|
|
|
|
|
|
|
| |
When starting virt-viewer with the --reconnect switch to a guest that
has a password, if the user cancels the authentication dialog (e.g.
pressing 'Esc'), the window will display "Waiting for guest domain to
restart". Obviously, the domain will never restart because it's already
running.
After this fix, the application will simply exit when the user cancels
authentication, even if the --reconnect switch is used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
File->Screenshot, File->Preferences, View->Zoom and Send keys are now
sensitive only while quest is connected.
Changed behaviour of zoom:
Previously, zoom could be set while quest wasn't connected. The zoom
would then be set on connection. There was no indication of current zoom
level while not connected to guest.
Now, the menu is not sensitive while not connected to guest. Zoom can
now be only modified while connected to guest, or from the command line.
|
| |
|
|
|
|
|
|
|
|
|
| |
All the situations where virt_viewer_update_display() can fail are
those when we won't be able to connect regardless of what changes on the
remote host. So, propagate the error instead of waiting for the guest to
start.
Related: rhbz#1085216
|
|
|
|
|
|
|
|
|
|
| |
Remove all the dialogs used to report errors on extract_connect_info()
and just propagate the errors we got from it.
The only exception is virt_viewer_domain_event(), that is a callback
that doesn't have GError as argument. In this specific case, we show the
error dialog instead of propagating it.
Related: rhbz#1085216
|
|
|
|
|
|
|
| |
By convention functions that take GError parameters should return FALSE
(or NULL) or error.
Related: rhbz#1085216
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).
Related: rhbz#1085216
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).
Related: rhbz#1085216
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).
Related: rhbz#1085216
|
| |
|
|
|
|
|
|
|
|
| |
It is safe to clean up when running virt-viewer without specifying
vm name if no vm was chosen. It brings back behavior before 88f6341.
The 'if (dom == NULL && err != NULL)' part was affected by commits
824c4b9, 1eaaf8c, 15c7d17 so the check for 'err' is not needed anymore.
|
|
|
|
|
|
| |
Since the error is propagated to the main, report the error there.
To make it work GError VIRT_VIEWER_ERROR_FAILED is set for all
failing states and it is reported using virt_viewer_app_simple_message_dialog().
|
|
|
|
|
|
|
|
|
| |
This applies for:
libvirt authentication dialog (e.g. virt-viewer --attach guest)
'recent connection' dialog (e.g. remote-viewer)
'vm choose' dialog when connecting without specifying the vm name
This is done by using a new GError VIRT_VIEWER_ERROR_CANCELLED.
|
|
|
|
|
|
|
|
| |
Although commit 88f6341 allowed to use virt-viewer with a wrong guest name,
the user is informed about the nonexistent guest only by a dialog showing
the list of running machines or informing about the connection error.
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1201177
|
|
|
|
|
|
|
|
|
|
| |
When connecting to a remote host (using qemu+ssh://...) that has a
virtual machine listening to "127.0.0.1", virt_viewer_is_reachable() must
take --direct into account, otherwise it can end up connecting to a local
virtual machine listening to "0.0.0.0" instead of returning that the
guest is not reachable.
Resolves: rhbz#1085216
|
|
|
|
| |
Caught by Covscan.
|
|
|
|
|
| |
Commit c3d24f8b sets transient parent for the most part of the
GtkDialogs, but seems like this one was forgotten.
|
|
|
|
|
|
|
|
|
|
|
| |
When connecting to a remote libvirt instance, a VM may only be listening
on localhost for SPICE/VNC connections. In such a situation, virt-viewer
then tries to connect to localhost, which is not correct as this
'localhost' referred to the remote libvirt host it connected to.
This commit adds a couple of tests on the libvirt URI used and the
<graphics> listen address to error out in this situation.
Resolves: rhbz#1108523
|
|
|
|
|
| |
Silence the Gtk 3.14 message:
"GtkDialog mapped without a transient parent. This is discouraged."
|
|
|
|
|
| |
When running virt-viewer without argument, and no VM are found, you get
two error dialogs. Only one is enough.
|
|
|
|
|
| |
Even when the server doesn't provide a display connection address,
virt-viewer is able to connect to guest with libvirt attach.
|
|
|
|
| |
Use a UI dialog to inform of connection error.
|
|
|
|
|
|
|
| |
- do not overwrite err if ->initial_connect() sets it
- remove need for waitvm if the display server isn't yet started (note:
this function might be untested, I am not sure relying on libvirt events
is enough)
|
|
|
|
|
|
| |
- remove need for waitvm if the display server isn't yet started (note:
this function might be untested, I am not sure relying on libvirt events
is enough)
|
|
|
|
|
|
|
|
| |
Some refactoring to make the code easier to read, mostly code
movement/reindenting and introduction of a "wait" label which has the
same purpose as "done".
This also adds a "goto wait" within an if block, but this does not
change the initial code flow, just makes it more explicit.
|
|
|
|
|
|
| |
This error type isn't really an error, it is used to skip error report
code. The functions can simply return FALSE on failure, without GError
set, to indicate that program should quit normally.
|
| |
|
|
|
|
|
| |
This is libvirt specific, no need to share it in the VirtViewerApp base
class.
|
|
|
|
| |
Once we have priv->domain_event, we don't need priv->withEvents anymore
|
|
|
|
|
| |
The usage of virConnectDomainEventRegister() is no longer recommended
according to the libvirt's documentation.
|
|
|
|
| |
Avoid a possible use/free after the object has been freed.
|
|
|
|
|
|
| |
Although all the used functions have a explicit check for a valid
virConnPtr, let's be safe and only use priv->conn when its value is
non-NULL.
|
|
|
|
| |
This was introduced in libvirt 1.0.6 but we only require libvirt 0.10.0
|
| |
|
|
|
|
|
| |
The 'free()' function accepts NULL, so you should not
check for NULL before calling it.
|
|
|
|
|
| |
Lets prefill the username entry using the user name of the
current user.
|
|
|
|
|
|
| |
When user starts virt-viewer without specifying VM domain name
or with a wrong name a list of running machines is shown
and user may choose one of them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The virDomainOpenGraphics API cannot label the socket
we pass to it. Prefer virDomainOpenGraphicsFD (if building
with libvirt 1.2.8 or later) which creates the socket for us
and works with SELinux too.
Fall back to the old API if the new one is unsupported
(i.e. the libvirtd on the host is older than the libvirt version
virt-viewer was compiled against).
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1141228
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
|
|
|
| |
Adding a better error message to our default error message, based on the
libvirt error. Also, the libvirt error is shown as debug.
https://bugzilla.redhat.com/show_bug.cgi?id=1142742
|
|
|
|
|
|
|
|
|
|
| |
As the function should return < 0 in error cases, let's explicitly
return/set the return value to -1 in error cases. Otherwise, the
function will return 0.
This patch also fixes a regression introduced by (a5ce2ed3).
https://bugzilla.redhat.com/show_bug.cgi?id=1142742
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1145460
|
|
|
|
| |
Don't leak priv->uri or priv->domkey from VirtViewer class
|
|
|
|
|
|
| |
This allows the user to obtain the GUID and vm name of the currently-connected
guest. Obviously, this only works with spice. In the future, it will allow them
to set guest-specific configuration options (using a GUID as a key)
|
| |
|