small cleanups for pbs-restore
Add trailing newline to two error messages, and drop an extra unconditional `qdict_put_str(options, "driver", format);` Besides that it's just formatting. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4e74eca7ed
commit
c6979241f1
@ -6,8 +6,8 @@ Subject: [PATCH] PVE-Backup: pbs-restore - new command to restore from proxmox
|
||||
|
||||
---
|
||||
Makefile | 4 +-
|
||||
pbs-restore.c | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 211 insertions(+), 1 deletion(-)
|
||||
pbs-restore.c | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 209 insertions(+), 1 deletion(-)
|
||||
create mode 100644 pbs-restore.c
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
@ -34,10 +34,10 @@ index dbd9542ae4..7c1fb58e18 100644
|
||||
|
||||
diff --git a/pbs-restore.c b/pbs-restore.c
|
||||
new file mode 100644
|
||||
index 0000000000..f65de8b890
|
||||
index 0000000000..0b24e35403
|
||||
--- /dev/null
|
||||
+++ b/pbs-restore.c
|
||||
@@ -0,0 +1,208 @@
|
||||
@@ -0,0 +1,206 @@
|
||||
+/*
|
||||
+ * Qemu image restore helper for Proxmox Backup
|
||||
+ *
|
||||
@ -140,10 +140,10 @@ index 0000000000..f65de8b890
|
||||
+ }
|
||||
+ switch (c) {
|
||||
+ case ':':
|
||||
+ fprintf(stderr, "missing argument for option '%s'", argv[optind - 1]);
|
||||
+ fprintf(stderr, "missing argument for option '%s'\n", argv[optind - 1]);
|
||||
+ return -1;
|
||||
+ case '?':
|
||||
+ fprintf(stderr, "unrecognized option '%s'", argv[optind - 1]);
|
||||
+ fprintf(stderr, "unrecognized option '%s'\n", argv[optind - 1]);
|
||||
+ return -1;
|
||||
+ case 'f':
|
||||
+ format = g_strdup(argv[optind - 1]);
|
||||
@ -206,7 +206,6 @@ index 0000000000..f65de8b890
|
||||
+ }
|
||||
+
|
||||
+ QDict *options = qdict_new();
|
||||
+ qdict_put_str(options, "driver", format);
|
||||
+
|
||||
+ if (format) {
|
||||
+ qdict_put_str(options, "driver", format);
|
||||
@ -214,7 +213,6 @@ index 0000000000..f65de8b890
|
||||
+
|
||||
+ Error *local_err = NULL;
|
||||
+ int flags = BDRV_O_RDWR;
|
||||
+
|
||||
+ BlockBackend *blk = blk_new_open(target, NULL, options, flags, &local_err);
|
||||
+ if (!blk) {
|
||||
+ fprintf(stderr, "%s\n", error_get_pretty(local_err));
|
||||
|
@ -3,8 +3,6 @@ From: Kevin Wolf <kwolf@redhat.com>
|
||||
Date: Wed, 27 May 2020 11:33:20 +0200
|
||||
Subject: [PATCH] util/async: Add aio_co_reschedule_self()
|
||||
|
||||
From: Kevin Wolf <kwolf@redhat.com>
|
||||
|
||||
Add a function that can be used to move the currently running coroutine
|
||||
to a different AioContext (and therefore potentially a different
|
||||
thread).
|
||||
|
Loading…
Reference in New Issue
Block a user