api/admin: always save after self.dest.storage.resize()

This commit is contained in:
Rusty Bird 2019-06-23 12:48:01 +00:00
parent 2b4b45ead8
commit 66e44e67de
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -457,8 +457,10 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
self.fire_event_for_permission(size=size)
yield from self.dest.storage.resize(self.arg, size)
self.app.save()
try:
yield from self.dest.storage.resize(self.arg, size)
finally: # even if calling qubes.ResizeDisk inside the VM failed
self.app.save()
@qubes.api.method('admin.vm.volume.Import', no_payload=True,
scope='local', write=True)