~james-page/ubuntu/raring/nova/myfixes

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/driver.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-09-20 07:45:50 UTC
  • mto: This revision was merged to the branch mainline in revision 87.
  • Revision ID: package-import@ubuntu.com-20120920074550-ir9euteqh5gt4ja8
Tags: upstream-2012.2~rc1
ImportĀ upstreamĀ versionĀ 2012.2~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
"""
39
39
 
40
40
import contextlib
 
41
import cPickle as pickle
41
42
import time
42
43
import urlparse
43
44
import xmlrpclib
182
183
        # TODO(Vek): Need to pass context in for access to auth_token
183
184
        self._vmops.confirm_migration(migration, instance, network_info)
184
185
 
185
 
    def finish_revert_migration(self, instance, network_info):
 
186
    def finish_revert_migration(self, instance, network_info,
 
187
                                block_device_info=None):
186
188
        """Finish reverting a resize, powering back on the instance"""
187
189
        # NOTE(vish): Xen currently does not use network info.
188
190
        self._vmops.finish_revert_migration(instance)
189
191
 
190
192
    def finish_migration(self, context, migration, instance, disk_info,
191
 
                         network_info, image_meta, resize_instance=False):
 
193
                         network_info, image_meta, resize_instance=False,
 
194
                         block_device_info=None):
192
195
        """Completes a resize, turning on the migrated instance"""
193
196
        self._vmops.finish_migration(context, migration, instance, disk_info,
194
197
                                     network_info, image_meta, resize_instance)
229
232
        self._vmops.unpause(instance)
230
233
 
231
234
    def migrate_disk_and_power_off(self, context, instance, dest,
232
 
                                   instance_type, network_info):
 
235
                                   instance_type, network_info,
 
236
                                   block_device_info=None):
233
237
        """Transfers the VHD of a running instance to another host, then shuts
234
238
        off the instance copies over the COW disk"""
235
239
        # NOTE(vish): Xen currently does not use network info.
710
714
                                 session.xenapi.host.call_plugin,
711
715
                                 host, plugin, fn, args)
712
716
 
 
717
    def call_plugin_serialized(self, plugin, fn, *args, **kwargs):
 
718
        params = {'params': pickle.dumps(dict(args=args, kwargs=kwargs))}
 
719
        rv = self.call_plugin(plugin, fn, params)
 
720
        return pickle.loads(rv)
 
721
 
713
722
    def _create_session(self, url):
714
723
        """Stubout point. This can be replaced with a mock session."""
715
724
        return self.XenAPI.Session(url)