Re: [virt-tools-list] [Patch V2] Add virDomainSetMigrateMaxDowntime support

2010-11-30 Thread Cole Robinson
On 11/29/2010 10:24 PM, Wen Congyang wrote:
 At 2010-11-30 08:15, Cole Robinson Write:

 Hmm, I didn't think of that. I've pushed a change to virtinst now that
 should practically eliminate the likelihood of side effects:

 http://hg.fedorahosted.org/hg/python-virtinst/rev/df54d069af85

 I'd be interested in a follow up patch to clean up these comments, and
 use the support check earlier in the migrate dialog.

 Thanks,
 Cole

 
 # HG changeset patch
 # User Wen Congyang we...@cn.fujitsu.com
 # Date 1291087313 -28800
 # Node ID 85433ed45ba949b868457ef67d6cae42158dae80
 # Parent  6437bc731bb0d32bcc127184a6d69258c043a542
 check whether the domain supports downtime early
 

Great! Pushed now

http://hg.fedorahosted.org/hg/virt-manager/rev/dedbf8d0d5a3

Thanks,
Cole

 diff -r 6437bc731bb0 -r 85433ed45ba9 src/virtManager/domain.py
 --- a/src/virtManager/domain.py   Mon Nov 29 16:58:23 2010 +0800
 +++ b/src/virtManager/domain.py   Tue Nov 30 11:21:53 2010 +0800
 @@ -858,8 +858,6 @@
  return self._backend.XMLDesc(flags)
  
  def support_downtime(self):
 -# Note: this function has side effect
 -# if domain supports downtime, the downtime may be overriden to 30ms
  return support.check_domain_support(self._backend,
  support.SUPPORT_DOMAIN_MIGRATE_DOWNTIME)
  
 diff -r 6437bc731bb0 -r 85433ed45ba9 src/virtManager/migrate.py
 --- a/src/virtManager/migrate.py  Mon Nov 29 16:58:23 2010 +0800
 +++ b/src/virtManager/migrate.py  Tue Nov 30 11:21:53 2010 +0800
 @@ -146,6 +146,15 @@
  self.window.get_widget(migrate-rate).set_value(0)
  self.window.get_widget(migrate-secure).set_active(False)
  
 +downtime_box = self.window.get_widget(migrate-maxdowntime-box)
 +support_downtime = self.vm.support_downtime()
 +downtime_tooltip = 
 +if not support_downtime:
 +downtime_tooltip = _(Libvirt version does not support setting 
 + downtime.)
 +downtime_box.set_sensitive(support_downtime)
 +util.tooltip_wrapper(downtime_box, downtime_tooltip)
 +
  if self.conn.is_xen():
  # Default xen port is 8002
  self.window.get_widget(migrate-port).set_value(8002)
 @@ -497,13 +506,9 @@
  logging.debug(Migrating vm=%s from %s to %s, vm.get_name(),
srcconn.get_uri(), dstconn.get_uri())
  timer = None
 -if max_downtime != 0 and vm.support_downtime():
 +if max_downtime != 0:
  # 0 means that the spin box migrate-max-downtime does not
  # be enabled.
 -#
 -# We should check whether the domain supports downtime
 -# early, but vm.support_downtime() has side effect, so
 -# we check it only when user needs to modify downtime...
  current_thread = threading.currentThread()
  timer = util.safe_timeout_add(100,

 self._async_set_max_downtime,

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [Patch V2] Add virDomainSetMigrateMaxDowntime support

2010-11-29 Thread Cole Robinson
On 11/23/2010 10:40 PM, Wen Congyang wrote:
 # HG changeset patch
 # User Wen Congyang we...@cn.fujitsu.com
 # Date 1290569680 -28800
 # Node ID 519e30777e538476c18a329984b44d37d27c39c9
 # Parent  076759c3ada6fbb26c32d9181fb381097ed6bd0c
 Add virDomainSetMigrateMaxDowntime support
 

Thanks, I've pushed this now:

http://hg.fedorahosted.org/hg/virt-manager/rev/f2d5683fb5ed


 diff -r 076759c3ada6 -r 519e30777e53 src/virtManager/domain.py
 --- a/src/virtManager/domain.py   Tue Nov 23 20:13:50 2010 -0500
 +++ b/src/virtManager/domain.py   Wed Nov 24 11:34:40 2010 +0800
 @@ -944,6 +944,12 @@
  def _XMLDesc(self, flags):
  return self._backend.XMLDesc(flags)
  
 +def support_downtime(self):
 +# Note: this function has side effect
 +# if domain supports downtime, the downtime may be overriden to 30ms
 +return support.check_domain_support(self._backend,
 +support.SUPPORT_DOMAIN_MIGRATE_DOWNTIME)
 +

Hmm, I didn't think of that. I've pushed a change to virtinst now that
should practically eliminate the likelihood of side effects:

http://hg.fedorahosted.org/hg/python-virtinst/rev/df54d069af85

I'd be interested in a follow up patch to clean up these comments, and
use the support check earlier in the migrate dialog.

Thanks,
Cole

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [Patch V2] Add virDomainSetMigrateMaxDowntime support

2010-11-29 Thread Wen Congyang
At 2010-11-30 08:15, Cole Robinson Write:
 
 Hmm, I didn't think of that. I've pushed a change to virtinst now that
 should practically eliminate the likelihood of side effects:
 
 http://hg.fedorahosted.org/hg/python-virtinst/rev/df54d069af85
 
 I'd be interested in a follow up patch to clean up these comments, and
 use the support check earlier in the migrate dialog.
 
 Thanks,
 Cole
 

# HG changeset patch
# User Wen Congyang we...@cn.fujitsu.com
# Date 1291087313 -28800
# Node ID 85433ed45ba949b868457ef67d6cae42158dae80
# Parent  6437bc731bb0d32bcc127184a6d69258c043a542
check whether the domain supports downtime early

diff -r 6437bc731bb0 -r 85433ed45ba9 src/virtManager/domain.py
--- a/src/virtManager/domain.py Mon Nov 29 16:58:23 2010 +0800
+++ b/src/virtManager/domain.py Tue Nov 30 11:21:53 2010 +0800
@@ -858,8 +858,6 @@
 return self._backend.XMLDesc(flags)
 
 def support_downtime(self):
-# Note: this function has side effect
-# if domain supports downtime, the downtime may be overriden to 30ms
 return support.check_domain_support(self._backend,
 support.SUPPORT_DOMAIN_MIGRATE_DOWNTIME)
 
diff -r 6437bc731bb0 -r 85433ed45ba9 src/virtManager/migrate.py
--- a/src/virtManager/migrate.pyMon Nov 29 16:58:23 2010 +0800
+++ b/src/virtManager/migrate.pyTue Nov 30 11:21:53 2010 +0800
@@ -146,6 +146,15 @@
 self.window.get_widget(migrate-rate).set_value(0)
 self.window.get_widget(migrate-secure).set_active(False)
 
+downtime_box = self.window.get_widget(migrate-maxdowntime-box)
+support_downtime = self.vm.support_downtime()
+downtime_tooltip = 
+if not support_downtime:
+downtime_tooltip = _(Libvirt version does not support setting 
+ downtime.)
+downtime_box.set_sensitive(support_downtime)
+util.tooltip_wrapper(downtime_box, downtime_tooltip)
+
 if self.conn.is_xen():
 # Default xen port is 8002
 self.window.get_widget(migrate-port).set_value(8002)
@@ -497,13 +506,9 @@
 logging.debug(Migrating vm=%s from %s to %s, vm.get_name(),
   srcconn.get_uri(), dstconn.get_uri())
 timer = None
-if max_downtime != 0 and vm.support_downtime():
+if max_downtime != 0:
 # 0 means that the spin box migrate-max-downtime does not
 # be enabled.
-#
-# We should check whether the domain supports downtime
-# early, but vm.support_downtime() has side effect, so
-# we check it only when user needs to modify downtime...
 current_thread = threading.currentThread()
 timer = util.safe_timeout_add(100,
   self._async_set_max_downtime,

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list