Commit Graph

41 Commits

Author SHA1 Message Date
Michal Privoznik
9983fe74dd Don't SIGSEGV if no transport is used.
One of previous commits (74b1b62510) allowed us to connect to
localhost directly if ssh transport was used. However, if there's
not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as
one of arguments. Change this to g_strcmp0 which does the same
service but is more friendly to NULL arguments.
2012-11-14 15:20:58 +01:00
Michal Privoznik
fa39c5335c Reconnect to libvirtd after connection breaks
Currently, if user wants to reconnect to a domain he can use
'-r' cmd line argument. This makes virt-viewer listen to
domain events. However, if connection to libvirtd breaks
somehow, we will receive no longer any event. Hence we must
reconnect to the libvirt.
2012-11-13 15:23:51 +01:00
Dave Allan
74b1b62510 Connect to localhost for display when transport is ssh
When connecting to a VM that does not have a 'listen' tag in its
graphcs element, we have to guess where to try to connect to the VM's
display.  The current default is the host specified in the connection
URI which is correct for most transports, however, the SSH transport
makes the display connection from the remote end, so in that case,
attempt to connect to localhost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-11-08 17:44:18 +01:00
Daniel P. Berrange
c4bfbe104f Fix check for IPv6 any address
The string '::' is just one of many possible ways to express
the IPv6 "any" address. Others include  '::0', '0:0:0:0:0:0:0:0',
'0::0' and more. Instead of trying to do strcmp, actually try
parsing the address with GInetAddress and then simply use an
accessor to check what type it is

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-10 16:28:38 +01:00
Christophe Fergeau
d5bbe725d3 Append \n to message in virt_viewer_app_trace
Callers manually add a trailing \n when they call virt_viewer_app_trace,
but it's sometimes forgotten, leading to rhbz#822794. This commit
removes the \n from all callers (it was missing in a few of them)
and adds it in virt_viewer_app_trace.
2012-09-18 15:55:38 +02:00
Daniel P. Berrange
56b0217c62 Don't hardcode 'localhost' in no @listen parameter is given
If no @listen parameter is given, we must not hardcode 'localhost'
since we can't assume we are running on the same host. Instead use
the hostname from the connection URI
2012-02-14 14:55:39 +00:00
Daniel P. Berrange
a52b9f3182 Extract tlsPort for SPICE and use it to enable secure connections 2012-02-14 14:53:59 +00:00
Daniel P. Berrange
0fa4d098f9 Ensure auth popup windows have correct transient parent 2012-02-08 19:33:40 +00:00
Daniel P. Berrange
a893d5ef61 Update copyright headers 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
48c50437fa Remove useless if() before free() 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
e1283a9a60 Convert TABS to spaces & reindent everywhere 2012-02-06 12:40:09 +00:00
Daniel P. Berrange
5bc4c0b342 Support for virDomainOpenGraphics API
Add a new flag --attach, which instructs virt-viewer to attach
to the target display using virDomainOpenGraphics, instead of
initiating a VNC/SPICE connection directly.
2012-01-31 14:27:17 +00:00
Marc-André Lureau
8edbbcf18e Use graphical URI for connection
If specified, use URI for connection details
2012-01-30 17:10:21 +00:00
Daniel P. Berrange
9319081827 Always use canonical URI from libvirt connection
The URI we feed into libvirt may be an alias, so always query the
actual URI used internally
2011-11-07 11:17:41 +00:00
Daniel P. Berrange
168af497b9 Fix setting of window title with --wait
When waiting for a VM to appear or start, set the initial window
title to the command line arg. When the VM actually appears then
update it to the real VM name
2011-10-11 10:01:10 +01:00
Daniel P. Berrange
986c040fd7 Fix crash from previous commit when using UNIX sockets
Code in the previous commit would use 'ghost' even when it was
NULL, as with UNIX domain socket based connections.
2011-09-28 16:39:02 +01:00
Daniel P. Berrange
41703dd458 Fix hostname when XML gives a wildcard address
When the guest XML contains a wildcard address like 0.0.0.0 or ::,
we can't directly use connect() on it. Instead we have to use the
hostname/IP from the libvirt URI.
2011-09-19 16:37:57 +01:00
Daniel P. Berrange
46cf6410c1 Fix setting of window title with domain name 2011-09-16 10:57:53 +01:00
Marc-André Lureau
8d0f1d4235 Show status on all open windows
The split virt_viewer_notebook_show_status() to
virt_viewer_notebook_show_status_va() is unnecessary
in the end, but it's more future-proof.
2011-07-26 12:00:29 +01:00
Marc-André Lureau
734e789b22 Use app fullscreen property instead of app.start() argument 2011-07-26 12:00:29 +01:00
Marc-André Lureau
dcbbf99050 Status messages can be translated 2011-07-26 12:00:28 +01:00
Marc-André Lureau
c7ad98333d Split VirtViewerApp window into VirtViewerWindow 2011-07-26 11:16:34 +01:00
Marc-André Lureau
dd9c85a32d Inherit from VirtViewerApp for VirtViewer
Make it a real GObject.

The parts specific to virt should go in virt-viewer.c
2011-07-22 16:11:18 +01:00
Marc-André Lureau
e2c09a876b Turn VirtViewer into a VirtViewerApp object 2011-07-22 16:11:02 +01:00
Marc-André Lureau
9dcb071166 Split virt_viewer_start() and virt_viewer_new() 2011-07-22 16:10:25 +01:00
Marc-André Lureau
a1f0b01afc Split virt_viewer_activate() and virt_viewer_set_domain() 2011-07-22 16:09:14 +01:00
Marc-André Lureau
e56a8cb203 Split virt_viewer_create_session() out of virt_viewer_extract_connect_info()
For future reusability
2011-07-22 16:09:07 +01:00
Marc-André Lureau
824b12dab0 Reorder _VirtViewer to make it easier to split with RemoteViewer 2011-07-22 14:51:34 +01:00
Marc-André Lureau
3a42577932 Extract scheme in virt_viewer_extract_host()
Needed for remote-viewer.
2011-07-22 14:50:03 +01:00
Daniel P. Berrange
af46dc1408 Annotate unused variables 2011-07-12 11:48:23 +01:00
Daniel P. Berrange
2fd926243d Fix leak of graphics type attribute from XML 2011-07-12 11:27:51 +01:00
Daniel P. Berrange
1def55556f Split pull part of VirtViewerDisplay out into VirtViewerSession
To facilitate introduction of multi-head support, pull some of
the VirtViewerDisplay class out into a new VirtViewerSession
class.
2011-07-11 20:03:32 +01:00
Daniel P. Berrange
9501b9885a Avoid (null) in titlebar 2011-07-11 17:07:36 +01:00
Daniel P. Berrange
4614cb9024 Fix colour of status label to show up on black background 2011-07-11 16:30:43 +01:00
Marc-André Lureau
7cd8b352ba Fill space on the display alignment with black 2011-07-11 15:51:36 +01:00
Marc-André Lureau
7da268c164 Add support for --fullscreen option 2011-07-11 15:50:13 +01:00
Daniel P. Berrange
4ba39d0224 Remove circular dependancy between VirtViewerDisplay and VirtViewer
Add many signals to VirtViewerDisplay which are emitted when various
events occur. This lets us remove all the code in the VirtViewerDisplay
subclasses which call back into VirtViewer methods. Instead VirtViewer
can simply connect signals to the display
2011-07-11 15:35:47 +01:00
Daniel P. Berrange
7a7112a9fa Turn VirtViewerDisplay into a proper Gtk widget
Turn VirtViewerDisplay into a Gtk widget instead of just a GObject,
by merging the functionality from VirtViewerAlign
2011-07-11 14:10:07 +01:00
Daniel P. Berrange
7f91cdf4ab Update to optionally build with GTK3 2011-07-11 12:07:21 +01:00
Daniel P. Berrange
cff795065a Replace use of GtkAlignment with a custom align widget
To use the GtkAlignment we have to play evil tricks overriding
its size request, to make it reallocate the child to the preferred
size we desire based on the virtual desktop size + zoom level.

By replacing the GtkAlignment with a custom widget we can
directly implement the layout/sizing semantics we want without
playing stupid games
2011-07-01 18:07:25 +01:00
Daniel P. Berrange
f3fa999769 Introduce standard naming convention to files & methods
All source files must be named

  virt-viewer-XXXX

All methods named

  virt_viewer_XXX
2011-07-01 16:12:20 +01:00