Use self.dest.storage.import* wrappers instead.

This commit is contained in:
WillyPillow 2020-07-16 00:38:02 +08:00
parent 5c7b57e690
commit 56fbf108f8
No known key found for this signature in database
GPG Key ID: 3839E194B1415A9C

View File

@ -499,12 +499,12 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
size = volume.size
# Clear the volume by importing empty data into it
path = yield from volume.import_data(size)
path = yield from self.dest.storage.import_data(self.arg, size)
self.dest.fire_event('domain-volume-import-begin',
volume=self.arg, size=size)
pathlib.Path(path).touch()
try:
yield from volume.import_data_end(True)
yield from self.dest.storage.import_data_end(self.arg, True)
except:
self.dest.fire_event('domain-volume-import-end',
volume=self.arg, success=False)