Skip to content

Commit

Permalink
show warning if auto mode attempts to backup raw devices incrementally
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Nov 28, 2024
1 parent 5c37721 commit dd6aa2f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 2.18
---------
* If auto backup mode is switched to incremental and --raw option
is passed, backup would fails instead of showing an warning that
raw devices are excluded (#239)

Version 2.17
---------
* Add rpm package build for fedora 41 (#234)
Expand Down
2 changes: 1 addition & 1 deletion libvirtnbdbackup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

__version__ = "2.17"
__version__ = "2.18"
4 changes: 2 additions & 2 deletions man/virtnbdbackup.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH VIRTNBDBACKUP "1" "November 2024" "virtnbdbackup 2.17" "User Commands"
.TH VIRTNBDBACKUP "1" "November 2024" "virtnbdbackup 2.18" "User Commands"
.SH NAME
virtnbdbackup \- backup utility for libvirt
.SH DESCRIPTION
Expand Down Expand Up @@ -52,7 +52,7 @@ Backup only disk with target dev name (\fB\-i\fR vda)
Exclude disk(s) with target dev name (\fB\-x\fR vda,vdb)
.TP
\fB\-f\fR SOCKETFILE, \fB\-\-socketfile\fR SOCKETFILE
Use specified file for NBD Server socket (default: \fI\,/var/tmp/virtnbdbackup.174352\/\fP)
Use specified file for NBD Server socket (default: \fI\,/var/tmp/virtnbdbackup.1305388\/\fP)
.TP
\fB\-n\fR, \fB\-\-noprogress\fR
Disable progress bar
Expand Down
2 changes: 1 addition & 1 deletion man/virtnbdmap.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH VIRTNBDMAP "1" "November 2024" "virtnbdmap 2.17" "User Commands"
.TH VIRTNBDMAP "1" "November 2024" "virtnbdmap 2.18" "User Commands"
.SH NAME
virtnbdmap \- map virtnbdbackup image files to nbd devices
.SH DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions man/virtnbdrestore.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH VIRTNBDRESTORE "1" "November 2024" "virtnbdrestore 2.17" "User Commands"
.TH VIRTNBDRESTORE "1" "November 2024" "virtnbdrestore 2.18" "User Commands"
.SH NAME
virtnbdrestore \- restore utility for libvirt
.SH DESCRIPTION
Expand Down Expand Up @@ -41,7 +41,7 @@ Process only disk matching target dev name. (default: None)
Disable progress bar
.TP
\fB\-f\fR SOCKETFILE, \fB\-\-socketfile\fR SOCKETFILE
Use specified file for NBD Server socket (default: \fI\,/var/tmp/virtnbdbackup.174357\/\fP)
Use specified file for NBD Server socket (default: \fI\,/var/tmp/virtnbdbackup.1305393\/\fP)
.TP
\fB\-r\fR, \fB\-\-raw\fR
Copy raw images as is during restore. (default: False)
Expand Down
14 changes: 7 additions & 7 deletions virtnbdbackup
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,6 @@ def main() -> None:
if args.compress is not False:
logging.info("Compression enabled, level [%s]", args.compress)

if args.raw is True and args.level in ("inc", "diff"):
logging.warning(
"Raw disks can't be included during incremental or differential backup."
)
logging.warning("Excluding raw disks.")
args.raw = False

try:
check.arguments(args)
except exceptions.BackupException as e:
Expand Down Expand Up @@ -364,6 +357,13 @@ def main() -> None:
except exceptions.CheckpointException:
sys.exit(1)

if args.raw is True and args.level in ("inc", "diff"):
logging.warning(
"Raw disks can't be included during incremental or differential backup."
)
logging.warning("Excluding raw disks.")
args.raw = False

signal.signal(
signal.SIGINT,
partial(sighandle.Backup.catch, args, domObj, virtClient, logging),
Expand Down

0 comments on commit dd6aa2f

Please sign in to comment.