]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
Introduce VIR_MIGRATE_PARAM_GRAPHICS_URI parameter
authorJiri Denemark <jdenemar@redhat.com>
Tue, 18 Jun 2013 07:46:49 +0000 (09:46 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 24 Jun 2013 23:33:47 +0000 (01:33 +0200)
The parameter specifies connection parameters to use for migrating
client's connection to domain's graphical console.

include/libvirt/libvirt.h.in
tools/virsh-domain.c
tools/virsh.pod

index 19d0c581d9e54e8565c6b3b8f4dc9d9040554a82..b7911251178e7ef9493b32c4552e53b304269964 100644 (file)
@@ -1246,6 +1246,27 @@ typedef enum {
  */
 #define VIR_MIGRATE_PARAM_BANDWIDTH         "bandwidth"
 
+/**
+ * VIR_MIGRATE_PARAM_GRAPHICS_URI:
+ *
+ * virDomainMigrate* params field: URI to use for migrating client's connection
+ * to domain's graphical console as VIR_TYPED_PARAM_STRING. If specified, the
+ * client will be asked to automatically reconnect using these parameters
+ * instead of the automatically computed ones. This can be useful if, e.g., the
+ * client does not have a direct access to the network virtualization hosts are
+ * connected to and needs to connect through a proxy. The URI is formed as
+ * follows:
+ *
+ *      protocol://hostname[:port]/[?parameters]
+ *
+ * where protocol is either "spice" or "vnc" and parameters is a list of
+ * protocol specific parameters separated by '&'. Currently recognized
+ * parameters are "tlsPort" and "tlsSubject". For example,
+ *
+ *      spice://target.host.com:1234/?tlsPort=4567
+ */
+#define VIR_MIGRATE_PARAM_GRAPHICS_URI      "graphics_uri"
+
 
 /* Domain migration. */
 virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
index 04259735ec5016c1db6af182c1dfd250383f8189..5257416543ae3c9b1f75f3f9d53ba0b190031a30 100644 (file)
@@ -8324,6 +8324,10 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_DATA,
      .help = N_("migration URI, usually can be omitted")
     },
+    {.name = "graphicsuri",
+     .type = VSH_OT_DATA,
+     .help = N_("graphics URI to be used for seamless graphics migration")
+    },
     {.name = "dname",
      .type = VSH_OT_DATA,
      .help = N_("rename to new name during migration (if supported)")
@@ -8373,6 +8377,13 @@ doMigrate(void *opaque)
                                 VIR_MIGRATE_PARAM_URI, opt) < 0)
         goto save_error;
 
+    if (vshCommandOptStringReq(ctl, cmd, "graphicsuri", &opt) < 0)
+        goto out;
+    if (opt &&
+        virTypedParamsAddString(&params, &nparams, &maxparams,
+                                VIR_MIGRATE_PARAM_GRAPHICS_URI, opt) < 0)
+        goto save_error;
+
     if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)
         goto out;
     if (opt &&
index f4746cc915ee140135a639b717ead4b15cbb7411..94fe8976a4201ffdc07294f3a6b66d6f64cb2dc0 100644 (file)
@@ -1044,7 +1044,7 @@ stats.
 [I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>]
 [I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>]
 [I<--compressed>] [I<--abort-on-error>]
-I<domain> I<desturi> [I<migrateuri>] [I<dname>]
+I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<dname>]
 [I<--timeout> B<seconds>] [I<--xml> B<file>]
 
 Migrate domain to another host.  Add I<--live> for live migration; <--p2p>
@@ -1136,6 +1136,22 @@ order to comply with local firewall policies.
 
 =back
 
+Optional I<graphicsuri> overrides connection parameters used for automatically
+reconnecting a graphical clients at the end of migration. If omitted, libvirt
+will compute the parameters based on target host IP address. In case the
+client does not have a direct access to the network virtualization hosts are
+connected to and needs to connect through a proxy, I<graphicsuri> may be used
+to specify the address the client should connect to. The URI is formed as
+follows:
+
+    protocol://hostname[:port]/[?parameters]
+
+where protocol is either "spice" or "vnc" and parameters is a list of protocol
+specific parameters separated by '&'. Currently recognized parameters are
+"tlsPort" and "tlsSubject". For example,
+
+    spice://target.host.com:1234/?tlsPort=4567
+
 =item B<migrate-setmaxdowntime> I<domain> I<downtime>
 
 Set maximum tolerable downtime for a domain which is being live-migrated to