| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
When parsing info returned by oVirt REST API, the hostname should be
present. However, I recently run remote-viewer against a buggy oVirt
instance where the hostname was missing. This commit handles better this
situation by displaying an error message and exiting.
|
|
|
|
|
|
|
|
|
|
|
| |
VMs managed by oVirt can be hidden behind a proxy. This commit allows
remote-viewer to make use of this information when it's available
A recent oVirt instance is needed so that it's available through the
REST API, as well as libgovirt 0.3.3 or newer.
With older oVirt/libgovirt versions, the worst that can happen is a
runtime warning in the console, and an impossibility to connect to VMs
behind a proxy, so this commit is not raising the minimum libgovirt
requirement.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
G_SOURCE_REMOVE was introduced in GLib 2.32 and has its value defined as
FALSE.
|
|
|
|
| |
Caught by Covscan.
|
| |
|
|
|
|
|
| |
Functions name says it all, it is only implement for Spice, checking
for webdav channel presence.
|
| |
|
|
|
|
| |
Add a menu item Preferences under File and show the preferences dialog
|
| |
|
|
|
|
| |
Connect/disconnect webdav channel to enable or disable sharing folder
|
| |
|
|
|
|
| |
See properties comments for details.
|
| |
|
|
|
|
|
|
|
|
|
| |
It is deprecated since govirt 0.3.1 (and virt-viewer already depends on
govirt 0.3.2).
Silences:
(remote-viewer:19420): libgovirt-WARNING **: Passing a full http:// or https:// URI to ovirt_proxy_new() is deprecated
(remote-viewer:19420): libgovirt-WARNING **: Passing an URI ending in /api to ovirt_proxy_new() is deprecated
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to solve several problems with sizing and resizing displays, a
'map' handler was added to VirtViewerDisplay. The first time the map
handler runs, its queues a resize to attempt to ensure that the window
gets created at its desired size. Subsequent map events generate a call
to _make_resizable(), which was an attempt to ensure that the window was
always 'shrinkable' on the Microsoft Windows platform. Recent testing
suggests that this _make_resizable() is not actually necessary on
Windows anymore, since it is possible to shrink the display even when
this call is removed.
In addition, the call to _queue_resize() is a bit of an indirect
solution to the problem of ensuring the proper size at startup. What we
really want is to guarantee that the very first size request negotiation
returns the desired size rather than the minimum size. In order to do
this, we've added a flag to determine whether we've ever received a size
request, and if not, we return our desired size, even if 'dirty' is not
set.
|
|
|
|
|
|
|
|
|
| |
Using %d as a format-specifier for intptr_t causes a warning with
mingw64:
virt-viewer-events.c: In function 'virt_viewer_events_add_handle':
virt-viewer-events.c:103:5: warning: format '%d' expects argument of
type 'int', but argument 5 has type 'intptr_t' [-Wformat=]
g_debug("Converted fd %d to handle %d", fd, _get_osfhandle(fd));
|
|
|
|
|
| |
Silence the Gtk 3.14 message:
"GtkDialog mapped without a transient parent. This is discouraged."
|
|
|
|
|
|
|
|
| |
Setting the zoom-level using the command line option '--zoom' is not
working for vnc guests. This problem can be solved by emitting
the "display-desktop-resize" signal when vnc is initialized.
https://bugzilla.redhat.com/show_bug.cgi?id=1170071
|
|
|
|
|
| |
When running virt-viewer without argument, and no VM are found, you get
two error dialogs. Only one is enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SpiceSession in spice-gtk v0.27 will remove channels from session during
disconnect (and not when they are actually disposed). When no channels
are left, session-disconnected is emitted, and the VirtViewerSession
will be unref from the application. Use a weak reference to self to
avoid crashing after calling spice_session_disconnect()
As a workaround for existing clients, spice-gtk v0.27 will defer the
disconnection to idle time. But the fix still makes sense and would
prevent potentially future issues if spice-gtk changes back to sync
disconnection.
(the alternative of calling ref/unref would needlessly recreate a
SpiceSession with a call to create_spice_session(), which is something
we can avoid when leaving the application)
|
|
|
|
|
| |
Even when the server doesn't provide a display connection address,
virt-viewer is able to connect to guest with libvirt attach.
|
|
|
|
|
| |
Provide error details if the display can only be access through libvirt
--attach method.
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This isn't required, but makes it easier to track reference issues, as
you have guarantee that callbacks won't be executed if the objects are
disposed.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's currently possible to destroy any virt-viewer window, including the
main window. However, some part of the code expects that the main window
is always present, for example to present status messages.
In particular, stopping the guest (or running virsh destroy) will close
all windows: virt_viewer_session_clear_displays will get called, which
will call into virt_viewer_app_remove_display_removed, and finally into
virt_viewer_app_remove_nth_window, which will destroy the window being
removed if it holds the last reference to it.
So going through virt_viewer_session_clear_displays, all
VirtViewerWindow instances and their corresponding GtkWindow have been
destroyed. This is already an issue as VirtViewerApp::main_window will
be pointing to freed memory.
When using virt-viewer --reconnect, this will cause a crash when
restarting the guest in virt_viewer_app_create_session as it tries to
get a valid GtkWindow through:
GtkWindow *window = virt_viewer_window_get_window(priv->main_window);
This commit avoids this issue by special casing the main window in
virt_viewer_app_remove_nth_window to ensure it never gets removed.
This is similar to what is done in virt_viewer_app_hide_all_windows.
|
|
|
|
|
|
|
| |
Commit 13f493200 changed virt_viewer_app_initial_connect to return a
gboolean rather than an int, but one call site was not updated to the
new convention, and was still checking for a negative value rather than
for FALSE in order to detect failures.
|
|
|
|
|
|
| |
As spice-gtk macro for checking the version numbers was broken, let's
check for 0.26 and avoid to have virt-viewer broken on a few distros
for a good long time.
|
|
|
|
| |
This was introduced in libvirt 1.0.6 but we only require libvirt 0.10.0
|
|
|
|
|
|
|
| |
This causes warnings with older compilers
virt-viewer-vm-connection.c:52: warning: declaration of 'select' shadows
a global declaration
/usr/include/sys/select.h:109: warning: shadowed declaration is here
|
|
|
|
|
|
|
| |
The G_N_ELEMENTS() type is size_t but this was being passed to
a format string with '%lu' which is of a different size on many
platforms. Just delete this part of the warning message since
it was not hugely useful.
|
| |
|
|
|
|
|
| |
The 'free()' function accepts NULL, so you should not
check for NULL before calling it.
|
|
|
|
|
|
| |
virt_viewer_session_on_monitor_geometry_changed() gets called
immediately upon agent connection, but sometimes this is before any
displays have been received. Simply return early when this is the case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using a custom fullscreen display configuration, it's possible to
specify that e.g. a single screen should be fullscreen on client
monitor #4. Since we send down absolute positions and disable alignment
when all windows are in fullscreen, we can send configurations with a
very large offset to the top-left corner. This could result in the guest
trying to create a screen that was much larger than necessary. For
example when sending a configuration of 1280x1024+4240+0, the guest
would need to allocate a screen of size 5520x1024, which might fail if
video memory was too low. To avoid this issue, we shift all displays
so that the minimum X coordinate for all screens is at x=0, and the
minimum y coordinate is at y=0.
|
| |
|
|
|
|
|
|
| |
We have to check for the spice version where the
SPICE_CLIENT_ERROR_AUTH_NEEDS_PASSWORD_AND_USERNAME was introduced and
not for the one where spice_channel_get_error() was introduced.
|
|
|
|
|
|
|
| |
The ability to send a keystroke should not depend on whether a display
is ready or not, it only depends on whether the display exists or not.
See https://bugzilla.redhat.com/show_bug.cgi?id=1152574
|