summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-main.c
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2015-04-14 13:44:47 +0200
committerPavel Grunt <pgrunt@redhat.com>2015-04-14 15:05:11 +0200
commit10264d0d1ecbd67d3e59e3a1a3032936b0635eda (patch)
treec40cbe66e94429966d92536ba3e89c8aedd594ad /src/virt-viewer-main.c
parent9ba2d28a0f35b69befd26d7c122bbe4cd626422f (diff)
downloadvirt-viewer-10264d0d1ecbd67d3e59e3a1a3032936b0635eda.tar.gz
virt-viewer-10264d0d1ecbd67d3e59e3a1a3032936b0635eda.tar.xz
virt-viewer-10264d0d1ecbd67d3e59e3a1a3032936b0635eda.zip
virt-viewer-main: exit when domain names doesn't match
Since the domain name is required as a parameter for the '--wait' option (commit a830275344c88aef12166661b68ea2b4429c7212 ), it is neccessary to check whether all domains names are the same. Otherwise it wouldn't be clear which name should be used. related: rhbz#1211573
Diffstat (limited to 'src/virt-viewer-main.c')
-rw-r--r--src/virt-viewer-main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
index 8c1ca80..638087f 100644
--- a/src/virt-viewer-main.c
+++ b/src/virt-viewer-main.c
@@ -108,6 +108,11 @@ int main(int argc, char **argv)
goto cleanup;
}
+ if (args && waitvm != NULL && g_strcmp0(waitvm, args[0]) != 0) {
+ g_printerr(_("\nDomain names mismatch, got '%s' and '%s'\n\n%s\n\n"), waitvm, args[0], help_msg);
+ goto cleanup;
+ }
+
viewer = virt_viewer_new(uri, (args) ? args[0] : waitvm, direct, attach, waitvm != NULL, reconnect);
if (viewer == NULL)
goto cleanup;