]> git.proxmox.com Git - pve-qemu.git/commitdiff
small cleanups for pbs-restore
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 30 May 2020 13:24:11 +0000 (15:24 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 30 May 2020 13:24:20 +0000 (15:24 +0200)
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>
debian/patches/pve/0032-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch
debian/patches/pve/0046-util-async-Add-aio_co_reschedule_self.patch

index 566f13fb06c0bd9e41da0dd01c9f3fc2a44236b7..f82ddc073ef3df20f55452c2be810a7c8aa79f4b 100644 (file)
@@ -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
 + *
@@ -124,7 +124,7 @@ index 0000000000..f65de8b890
 +
 +    error_init(argv[0]);
 +
-+    for(;;) {
++    for (;;) {
 +        static const struct option long_options[] = {
 +            {"help", no_argument, 0, 'h'},
 +            {"skip-zero", no_argument, 0, 'S'},
@@ -138,31 +138,31 @@ index 0000000000..f65de8b890
 +        if (c == -1) {
 +            break;
 +        }
-+        switch(c) {
-+        case ':':
-+            fprintf(stderr, "missing argument for option '%s'", argv[optind - 1]);
-+            return -1;
-+        case '?':
-+            fprintf(stderr, "unrecognized option '%s'", argv[optind - 1]);
-+            return -1;
-+        case 'f':
-+            format = g_strdup(argv[optind - 1]);
-+            break;
-+        case 'r':
-+            repository = g_strdup(argv[optind - 1]);
-+            break;
-+        case 'k':
-+            keyfile = g_strdup(argv[optind - 1]);
-+            break;
-+        case 'v':
-+            verbose = true;
-+            break;
-+        case 'S':
-+            skip_zero = true;
-+            break;
-+        case 'h':
-+            help();
-+            return 0;
++        switch (c) {
++            case ':':
++                fprintf(stderr, "missing argument for option '%s'\n", argv[optind - 1]);
++                return -1;
++            case '?':
++                fprintf(stderr, "unrecognized option '%s'\n", argv[optind - 1]);
++                return -1;
++            case 'f':
++                format = g_strdup(argv[optind - 1]);
++                break;
++            case 'r':
++                repository = g_strdup(argv[optind - 1]);
++                break;
++            case 'k':
++                keyfile = g_strdup(argv[optind - 1]);
++                break;
++            case 'v':
++                verbose = true;
++                break;
++            case 'S':
++                skip_zero = true;
++                break;
++            case 'h':
++                help();
++                return 0;
 +        }
 +    }
 +
@@ -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,14 +213,13 @@ 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));
 +        return -1;
 +    }
 +
-+    CallbackData *callback_data = calloc(sizeof( CallbackData), 1);
++    CallbackData *callback_data = calloc(sizeof(CallbackData), 1);
 +
 +    callback_data->target = blk;
 +    callback_data->skip_zero = skip_zero;
index 6791261331ec621608590bd5612fc4a22a4286af..5927453b957093f3b437e061044382f8db9d65cb 100644 (file)
@@ -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).