summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2014-11-19 15:02:47 +0100
committerFabiano FidĂȘncio <fidencio@redhat.com>2014-11-20 11:15:05 +0100
commita7e95e8f3c172bf18bbb8eec4155f837eb9913a0 (patch)
treee1f0eec95d2d7538735633d34a12a2b66aa3c939 /src/virt-viewer.c
parentfe95067c859875553b9a4fd17a6f2c48c3602e6e (diff)
downloadvirt-viewer-a7e95e8f3c172bf18bbb8eec4155f837eb9913a0.tar.gz
virt-viewer-a7e95e8f3c172bf18bbb8eec4155f837eb9913a0.tar.xz
virt-viewer-a7e95e8f3c172bf18bbb8eec4155f837eb9913a0.zip
Replace priv->withEvents usage for priv->domain_event
Once we have priv->domain_event, we don't need priv->withEvents anymore
Diffstat (limited to 'src/virt-viewer.c')
-rw-r--r--src/virt-viewer.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 2c19057..231d1a8 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -55,7 +55,6 @@ struct _VirtViewerPrivate {
virConnectPtr conn;
virDomainPtr dom;
char *domkey;
- gboolean withEvents;
gboolean waitvm;
gboolean reconnect;
gboolean auth_cancelled;
@@ -114,6 +113,7 @@ static void
virt_viewer_init(VirtViewer *self)
{
self->priv = GET_PRIVATE(self);
+ self->priv->domain_event = -1;
}
static void
@@ -128,7 +128,7 @@ virt_viewer_deactivated(VirtViewerApp *app, gboolean connect_error)
}
if (priv->reconnect) {
- if (!priv->withEvents) {
+ if (priv->domain_event < 0) {
g_debug("No domain events, falling back to polling");
virt_viewer_app_start_reconnect_poll(app);
}
@@ -531,7 +531,7 @@ virt_viewer_dispose (GObject *object)
VirtViewerPrivate *priv = self->priv;
if (priv->conn) {
- if (priv->withEvents) {
+ if (priv->domain_event >= 0) {
virConnectDomainEventDeregisterAny(priv->conn,
priv->domain_event);
priv->domain_event = -1;
@@ -833,12 +833,7 @@ virt_viewer_connect(VirtViewerApp *app)
VIR_DOMAIN_EVENT_CALLBACK(virt_viewer_domain_event),
self,
NULL);
- if (priv->domain_event < 0)
- priv->withEvents = FALSE;
- else
- priv->withEvents = TRUE;
-
- if (!priv->withEvents &&
+ if (priv->domain_event < 0 &&
!virt_viewer_app_is_active(app)) {
g_debug("No domain events, falling back to polling");
virt_viewer_app_start_reconnect_poll(app);