Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement admin.backup.* methods #135

Merged
merged 17 commits into from
Jul 29, 2017
Merged

Conversation

marmarek
Copy link
Member

This is core-admin part of QubesOS/qubes-issues#2931

Plus few related fixes.

It is useless here since backup restore is moved to
qubes-core-admin-client.
Do not assume static list of volume (although it is true for now), and
also use proper API for getting volume size, instead of assuming it's a
normal file.
Those tests are only about Admin API integration, not about actual backup
backend code

QubesOS/qubes-issues#2931
If inner tar returns with non-zero code, mostly like the backup is
incomplete, so it is very important to report it.
Since we have LVM by default, it is possible to backup VMs while they
are running. For now it will include its state from before startup, but
later we may implement some other logic (a snapshot of running VM).
The old format have many issues and is discouraged by tar developers. In
this case the most important one is header with possible non-ASCII
characters, which will result in UnicodeDecodeError (tarfile module
require header parts in utf-8).
PAX format is much cleaner, as it use standard mechanism for extended
headers.
@codecov
Copy link

codecov bot commented Jul 21, 2017

Codecov Report

Merging #135 into master will increase coverage by 1.99%.
The diff coverage is 48.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
+ Coverage   49.12%   51.11%   +1.99%     
==========================================
  Files          53       53              
  Lines        7976     8019      +43     
==========================================
+ Hits         3918     4099     +181     
+ Misses       4058     3920     -138
Flag Coverage Δ
#unittests 51.11% <48.71%> (+1.99%) ⬆️
Impacted Files Coverage Δ
qubes/storage/file.py 56.5% <ø> (+0.44%) ⬆️
qubes/tools/qubesd.py 0% <0%> (ø) ⬆️
qubes/config.py 100% <100%> (ø) ⬆️
qubes/backup.py 41.27% <18.43%> (+26.71%) ⬆️
qubes/storage/lvm.py 47.17% <25%> (-0.48%) ⬇️
qubes/utils.py 38.14% <66.66%> (+4.07%) ⬆️
qubes/api/admin.py 93.18% <84.53%> (-1.44%) ⬇️
qubes/tarwriter.py 91.58% <90.47%> (-2.17%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c17e635...46bfa14. Read the comment docs.

When passphrase is retrieved from VM, it is already encoded. Do not try
to encode it again.

QubesOS/qubes-issues#2931
…s called

In some cases (even manual manipulation) those files may not be present
- especially because thin snapshots do not have nodes in /dev by default.
@marmarek marmarek merged commit 46bfa14 into QubesOS:master Jul 29, 2017
@marmarek marmarek deleted the backup-admin-api branch August 12, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant