domain: Remove internal 'cloning' marker

qemu nowadays should reject the common cases here with its default
image locking. Our impl wasn't very good anyways so let's just leave
it up to the lower layers
This commit is contained in:
Cole Robinson 2019-06-16 17:32:41 -04:00
parent 9c8e879ff0
commit b513388979
2 changed files with 18 additions and 35 deletions

View File

@ -838,35 +838,29 @@ class vmmCloneVM(vmmGObjectUI):
progWin.run()
def _async_clone(self, asyncjob):
try:
self.vm.set_cloning(True)
meter = asyncjob.get_meter()
meter = asyncjob.get_meter()
refresh_pools = []
for disk in self.clone_design.clone_disks:
if not disk.wants_storage_creation():
continue
refresh_pools = []
for disk in self.clone_design.clone_disks:
if not disk.wants_storage_creation():
continue
pool = disk.get_parent_pool()
if not pool:
continue
pool = disk.get_parent_pool()
if not pool:
continue
poolname = pool.name()
if poolname not in refresh_pools:
refresh_pools.append(poolname)
poolname = pool.name()
if poolname not in refresh_pools:
refresh_pools.append(poolname)
self.clone_design.start_duplicate(meter)
self.clone_design.start_duplicate(meter)
for poolname in refresh_pools:
try:
pool = self.conn.get_pool(poolname)
self.idle_add(pool.refresh)
except Exception:
logging.debug("Error looking up pool=%s for refresh after "
"VM clone.", poolname, exc_info=True)
finally:
self.vm.set_cloning(False)
for poolname in refresh_pools:
try:
pool = self.conn.get_pool(poolname)
self.idle_add(pool.refresh)
except Exception:
logging.debug("Error looking up pool=%s for refresh after "
def change_storage_browse(self, ignore):
def callback(src_ignore, txt):

View File

@ -252,11 +252,6 @@ class vmmDomain(vmmLibvirtObject):
self._status_reason = self._backend.state()[1]
return self._status_reason
def get_cloning(self):
return self.cloning
def set_cloning(self, val):
self.cloning = bool(val)
# If manual shutdown or destroy specified, make sure we don't continue
# install process
def get_install_abort(self):
@ -1281,9 +1276,6 @@ class vmmDomain(vmmLibvirtObject):
@vmmLibvirtObject.lifecycle_action
def startup(self):
if self.get_cloning():
raise RuntimeError(_("Cannot start guest while cloning "
"operation in progress"))
self._backend.create()
@vmmLibvirtObject.lifecycle_action
@ -1316,9 +1308,6 @@ class vmmDomain(vmmLibvirtObject):
@vmmLibvirtObject.lifecycle_action
def resume(self):
if self.get_cloning():
raise RuntimeError(_("Cannot resume guest while cloning "
"operation in progress"))
self._backend.resume()
@vmmLibvirtObject.lifecycle_action