Skip to content

Commit

Permalink
tools/qvm-volume import: do not retrieve old size anymore
Browse files Browse the repository at this point in the history
Since admin.vm.volume.ImportWithSize method is used now, there is no
need to retrieve old size anymore (to decide whether to resize or not).
  • Loading branch information
marmarek committed May 10, 2020
1 parent 65dcee4 commit 83b1fc6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
55 changes: 0 additions & 55 deletions qubesadmin/tests/tools/qvm_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,6 @@ def test_050_import_file(self):
self.app.expected_calls[
('testvm', 'admin.vm.volume.List', None, None)] = \
b'0\x00root\nprivate\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
b'0\x00pool=lvm\n' \
b'vid=qubes_dom0/vm-testvm-private\n' \
b'size=2147483648\n' \
b'usage=10000000\n' \
b'rw=True\n' \
b'save_on_stop=True\n' \
b'snap_on_start=False\n' \
b'revisions_to_keep=0\n' \
b'is_outdated=False\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
b'0\x00'
Expand All @@ -526,17 +515,6 @@ def test_051_import_stdin(self):
self.app.expected_calls[
('testvm', 'admin.vm.volume.List', None, None)] = \
b'0\x00root\nprivate\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
b'0\x00pool=lvm\n' \
b'vid=qubes_dom0/vm-testvm-private\n' \
b'size=2147483648\n' \
b'usage=10000000\n' \
b'rw=True\n' \
b'save_on_stop=True\n' \
b'snap_on_start=False\n' \
b'revisions_to_keep=0\n' \
b'is_outdated=False\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
b'0\x00'
Expand All @@ -557,17 +535,6 @@ def test_052_import_file_size(self):
self.app.expected_calls[
('testvm', 'admin.vm.volume.List', None, None)] = \
b'0\x00root\nprivate\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
b'0\x00pool=lvm\n' \
b'vid=qubes_dom0/vm-testvm-private\n' \
b'size=2147483648\n' \
b'usage=10000000\n' \
b'rw=True\n' \
b'save_on_stop=True\n' \
b'snap_on_start=False\n' \
b'revisions_to_keep=0\n' \
b'is_outdated=False\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'512\ntest-data')] = \
b'0\x00'
Expand All @@ -587,17 +554,6 @@ def test_053_import_file_noresize(self):
self.app.expected_calls[
('testvm', 'admin.vm.volume.List', None, None)] = \
b'0\x00root\nprivate\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
b'0\x00pool=lvm\n' \
b'vid=qubes_dom0/vm-testvm-private\n' \
b'size=2147483648\n' \
b'usage=10000000\n' \
b'rw=True\n' \
b'save_on_stop=True\n' \
b'snap_on_start=False\n' \
b'revisions_to_keep=0\n' \
b'is_outdated=False\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Import', 'private', b'test-data')] = \
b'0\x00'
Expand All @@ -617,17 +573,6 @@ def test_053_import_file_matching_size(self):
self.app.expected_calls[
('testvm', 'admin.vm.volume.List', None, None)] = \
b'0\x00root\nprivate\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
b'0\x00pool=lvm\n' \
b'vid=qubes_dom0/vm-testvm-private\n' \
b'size=9\n' \
b'usage=1\n' \
b'rw=True\n' \
b'save_on_stop=True\n' \
b'snap_on_start=False\n' \
b'revisions_to_keep=0\n' \
b'is_outdated=False\n'
self.app.expected_calls[
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
b'0\x00'
Expand Down
1 change: 0 additions & 1 deletion qubesadmin/tools/qvm_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def import_volume(args):
''' Import a file into volume '''

volume = args.volume
old_size = volume.size
input_path = args.input_path
if input_path == '-':
input_file = sys.stdin.buffer
Expand Down

0 comments on commit 83b1fc6

Please sign in to comment.