All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhigang Wang <zhigang.x.wang@oracle.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 2/2]Add -s --ssl option to xm migrate
Date: Fri, 23 May 2008 17:23:52 +0800	[thread overview]
Message-ID: <48368D28.9090400@oracle.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

hi

This patch adds -s --ssl option to xm migrate. It will override
xend-relocation-ssl setting in /etc/xen/xend-config.sxp.

When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a command
line option rather than modify /etc/xen/xend-config.sxp every time.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>

thanks,

zhigang



[-- Attachment #2: xen-migrate-ssl.patch --]
[-- Type: text/x-patch, Size: 4313 bytes --]

Add -s --ssl option to xm migrate

This patch adds -s --ssl option to xm migrate. It will override
xend-relocation-ssl setting in /etc/xen/xend-config.sxp.

When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a command
line option rather than modify /etc/xen/xend-config.sxp every time.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>

diff -Nura xen-unstable.bak/tools/python/xen/xend/server/SrvDomain.py xen-unstable/tools/python/xen/xend/server/SrvDomain.py
--- xen-unstable.bak/tools/python/xen/xend/server/SrvDomain.py	2008-05-22 17:28:51.000000000 +0800
+++ xen-unstable/tools/python/xen/xend/server/SrvDomain.py	2008-05-23 15:12:09.000000000 +0800
@@ -115,7 +115,8 @@
                     [['dom',         'int'],
                      ['destination', 'str'],
                      ['live',        'int'],
-                     ['port',        'int']])
+                     ['port',        'int'],
+                     ['ssl',         'int']])
         return fn(req.args, {'dom': self.dom.domid})
 
     def op_pincpu(self, _, req):
diff -Nura xen-unstable.bak/tools/python/xen/xend/XendAPI.py xen-unstable/tools/python/xen/xend/XendAPI.py
--- xen-unstable.bak/tools/python/xen/xend/XendAPI.py	2008-05-22 17:28:51.000000000 +0800
+++ xen-unstable/tools/python/xen/xend/XendAPI.py	2008-05-23 15:07:56.000000000 +0800
@@ -1762,9 +1762,10 @@
         resource = other_config.get("resource", 0)
         port = other_config.get("port", 0)
         node = other_config.get("node", 0)
+        ssl = other_config.get("ssl", 0)
         
         xendom.domain_migrate(xeninfo.getDomid(), destination_url,
-                              bool(live), resource, port, node)
+                              bool(live), resource, port, node, ssl)
         return xen_api_success_void()
 
     def VM_save(self, _, vm_ref, dest, checkpoint):
diff -Nura xen-unstable.bak/tools/python/xen/xend/XendDomain.py xen-unstable/tools/python/xen/xend/XendDomain.py
--- xen-unstable.bak/tools/python/xen/xend/XendDomain.py	2008-05-23 12:51:10.000000000 +0800
+++ xen-unstable/tools/python/xen/xend/XendDomain.py	2008-05-23 15:20:06.000000000 +0800
@@ -1258,7 +1258,7 @@
 
         return val       
 
-    def domain_migrate(self, domid, dst, live=False, port=0, node=-1):
+    def domain_migrate(self, domid, dst, live=False, port=0, node=-1, ssl=None):
         """Start domain migration.
         
         @param domid: Domain ID or Name
@@ -1269,6 +1269,8 @@
         @type port: int        
         @keyword live: Live migration
         @type live: bool
+        @keyword ssl: use ssl connection
+        @type ssl: bool
         @rtype: None
         @keyword node: use node number for target
         @rtype: int 
@@ -1294,7 +1296,9 @@
             """ Make sure there's memory free for enabling shadow mode """
             dominfo.checkLiveMigrateMemory()
 
-        ssl = xoptions.get_xend_relocation_ssl()
+        if ssl is None:
+            ssl = xoptions.get_xend_relocation_ssl()
+
         if ssl:
             from OpenSSL import SSL
             from xen.web import connection
diff -Nura xen-unstable.bak/tools/python/xen/xm/migrate.py xen-unstable/tools/python/xen/xm/migrate.py
--- xen-unstable.bak/tools/python/xen/xm/migrate.py	2008-05-22 17:28:51.000000000 +0800
+++ xen-unstable/tools/python/xen/xm/migrate.py	2008-05-23 14:59:42.000000000 +0800
@@ -47,6 +47,10 @@
           fn=set_int, default=-1,
           use="Use specified NUMA node on target.")
 
+gopts.opt('ssl', short='s',
+          fn=set_true, default=None,
+          use="Use ssl connection for migration.")
+
 def help():
     return str(gopts)
     
@@ -65,11 +69,13 @@
         vm_ref = get_single_vm(dom)
         other_config = {
             "port":     opts.vals.port,
-            "node":     opts.vals.node
+            "node":     opts.vals.node,
+            "ssl":      opts.vals.ssl
             }
         server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
                                  other_config)
     else:
         server.xend.domain.migrate(dom, dst, opts.vals.live,
                                    opts.vals.port,
-                                   opts.vals.node)
+                                   opts.vals.node,
+                                   opts.vals.ssl)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2008-05-23  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23  9:23 Zhigang Wang [this message]
2008-05-23 10:56 ` [PATCH 2/2]Add -s --ssl option to xm migrate Masaki Kanno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48368D28.9090400@oracle.com \
    --to=zhigang.x.wang@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.