diff --git a/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch b/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch index 7523c62..853cc8f 100644 --- a/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch +++ b/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch @@ -26,6 +26,7 @@ Suggested-by: Ma Haocong Signed-off-by: Ma Haocong Signed-off-by: John Snow Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- block/mirror.c | 98 +++++++++++++++++++++++++------- blockdev.c | 39 ++++++++++++- @@ -35,7 +36,7 @@ Signed-off-by: Fabian Grünbichler 5 files changed, 145 insertions(+), 29 deletions(-) diff --git a/block/mirror.c b/block/mirror.c -index 98fc66eabf..9d73875bd6 100644 +index 85b781bc21..0821214138 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -50,7 +50,7 @@ typedef struct MirrorBlockJob { @@ -56,7 +57,7 @@ index 98fc66eabf..9d73875bd6 100644 BdrvDirtyBitmap *dirty_bitmap; BdrvDirtyBitmapIter *dbi; uint8_t *buf; -@@ -690,7 +692,8 @@ static int mirror_exit_common(Job *job) +@@ -697,7 +699,8 @@ static int mirror_exit_common(Job *job) bdrv_child_refresh_perms(mirror_top_bs, mirror_top_bs->backing, &error_abort); if (!abort && s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) { @@ -66,7 +67,7 @@ index 98fc66eabf..9d73875bd6 100644 BlockDriverState *unfiltered_target = bdrv_skip_filters(target_bs); if (bdrv_cow_bs(unfiltered_target) != backing) { -@@ -795,6 +798,16 @@ static void mirror_abort(Job *job) +@@ -802,6 +805,16 @@ static void mirror_abort(Job *job) assert(ret == 0); } @@ -83,7 +84,7 @@ index 98fc66eabf..9d73875bd6 100644 static void coroutine_fn mirror_throttle(MirrorBlockJob *s) { int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); -@@ -976,7 +989,8 @@ static int coroutine_fn mirror_run(Job *job, Error **errp) +@@ -983,7 +996,8 @@ static int coroutine_fn mirror_run(Job *job, Error **errp) mirror_free_init(s); s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); @@ -93,7 +94,7 @@ index 98fc66eabf..9d73875bd6 100644 ret = mirror_dirty_init(s); if (ret < 0 || job_is_cancelled(&s->common.job)) { goto immediate_exit; -@@ -1209,6 +1223,7 @@ static const BlockJobDriver mirror_job_driver = { +@@ -1216,6 +1230,7 @@ static const BlockJobDriver mirror_job_driver = { .run = mirror_run, .prepare = mirror_prepare, .abort = mirror_abort, @@ -101,7 +102,7 @@ index 98fc66eabf..9d73875bd6 100644 .pause = mirror_pause, .complete = mirror_complete, .cancel = mirror_cancel, -@@ -1225,6 +1240,7 @@ static const BlockJobDriver commit_active_job_driver = { +@@ -1232,6 +1247,7 @@ static const BlockJobDriver commit_active_job_driver = { .run = mirror_run, .prepare = mirror_prepare, .abort = mirror_abort, @@ -109,7 +110,7 @@ index 98fc66eabf..9d73875bd6 100644 .pause = mirror_pause, .complete = mirror_complete, }, -@@ -1587,7 +1603,10 @@ static BlockJob *mirror_start_job( +@@ -1594,7 +1610,10 @@ static BlockJob *mirror_start_job( BlockCompletionFunc *cb, void *opaque, const BlockJobDriver *driver, @@ -121,12 +122,11 @@ index 98fc66eabf..9d73875bd6 100644 bool auto_complete, const char *filter_node_name, bool is_mirror, MirrorCopyMode copy_mode, Error **errp) -@@ -1599,10 +1618,39 @@ static BlockJob *mirror_start_job( +@@ -1606,10 +1625,39 @@ static BlockJob *mirror_start_job( uint64_t target_perms, target_shared_perms; int ret; - if (granularity == 0) { -- granularity = bdrv_get_default_bitmap_granularity(target); + if (sync_mode == MIRROR_SYNC_MODE_INCREMENTAL) { + error_setg(errp, "Sync mode '%s' not supported", + MirrorSyncMode_str(sync_mode)); @@ -147,8 +147,8 @@ index 98fc66eabf..9d73875bd6 100644 + "sync mode '%s' is not compatible with bitmaps", + MirrorSyncMode_str(sync_mode)); + return NULL; - } - ++ } ++ + if (bitmap) { + if (granularity) { + error_setg(errp, "granularity (%d)" @@ -158,12 +158,13 @@ index 98fc66eabf..9d73875bd6 100644 + } + granularity = bdrv_dirty_bitmap_granularity(bitmap); + } else if (granularity == 0) { -+ granularity = bdrv_get_default_bitmap_granularity(target); -+ } + granularity = bdrv_get_default_bitmap_granularity(target); + } +- assert(is_power_of_2(granularity)); if (buf_size < 0) { -@@ -1740,7 +1788,9 @@ static BlockJob *mirror_start_job( +@@ -1747,7 +1795,9 @@ static BlockJob *mirror_start_job( s->replaces = g_strdup(replaces); s->on_source_error = on_source_error; s->on_target_error = on_target_error; @@ -174,7 +175,7 @@ index 98fc66eabf..9d73875bd6 100644 s->backing_mode = backing_mode; s->zero_target = zero_target; s->copy_mode = copy_mode; -@@ -1761,6 +1811,18 @@ static BlockJob *mirror_start_job( +@@ -1768,6 +1818,18 @@ static BlockJob *mirror_start_job( bdrv_disable_dirty_bitmap(s->dirty_bitmap); } @@ -193,7 +194,7 @@ index 98fc66eabf..9d73875bd6 100644 ret = block_job_add_bdrv(&s->common, "source", bs, 0, BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ, -@@ -1838,6 +1900,9 @@ fail: +@@ -1845,6 +1907,9 @@ fail: if (s->dirty_bitmap) { bdrv_release_dirty_bitmap(s->dirty_bitmap); } @@ -203,7 +204,7 @@ index 98fc66eabf..9d73875bd6 100644 job_early_fail(&s->common.job); } -@@ -1855,29 +1920,23 @@ void mirror_start(const char *job_id, BlockDriverState *bs, +@@ -1862,29 +1927,23 @@ void mirror_start(const char *job_id, BlockDriverState *bs, BlockDriverState *target, const char *replaces, int creation_flags, int64_t speed, uint32_t granularity, int64_t buf_size, @@ -238,7 +239,7 @@ index 98fc66eabf..9d73875bd6 100644 } BlockJob *commit_active_start(const char *job_id, BlockDriverState *bs, -@@ -1902,7 +1961,8 @@ BlockJob *commit_active_start(const char *job_id, BlockDriverState *bs, +@@ -1909,7 +1968,8 @@ BlockJob *commit_active_start(const char *job_id, BlockDriverState *bs, job_id, bs, creation_flags, base, NULL, speed, 0, 0, MIRROR_LEAVE_BACKING_CHAIN, false, on_error, on_error, true, cb, opaque, @@ -341,10 +342,10 @@ index 3d8ac368a1..03e99264dc 100644 has_granularity, granularity, has_buf_size, buf_size, diff --git a/include/block/block_int.h b/include/block/block_int.h -index f1a54db0f8..3e625a4261 100644 +index c31cbd034a..11442893d0 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h -@@ -1247,7 +1247,9 @@ void mirror_start(const char *job_id, BlockDriverState *bs, +@@ -1254,7 +1254,9 @@ void mirror_start(const char *job_id, BlockDriverState *bs, BlockDriverState *target, const char *replaces, int creation_flags, int64_t speed, uint32_t granularity, int64_t buf_size, diff --git a/debian/patches/bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch b/debian/patches/bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch index ceeb7a3..5dd0165 100644 --- a/debian/patches/bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch +++ b/debian/patches/bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch @@ -18,15 +18,16 @@ incremental backup modes; we can use this bitmap to later refresh a successfully created mirror. Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- block/mirror.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/block/mirror.c b/block/mirror.c -index 9d73875bd6..8148df1f80 100644 +index 0821214138..c688726fae 100644 --- a/block/mirror.c +++ b/block/mirror.c -@@ -667,8 +667,6 @@ static int mirror_exit_common(Job *job) +@@ -674,8 +674,6 @@ static int mirror_exit_common(Job *job) bdrv_unfreeze_backing_chain(mirror_top_bs, target_bs); } @@ -35,7 +36,7 @@ index 9d73875bd6..8148df1f80 100644 /* Make sure that the source BDS doesn't go away during bdrv_replace_node, * before we can call bdrv_drained_end */ bdrv_ref(src); -@@ -776,6 +774,18 @@ static int mirror_exit_common(Job *job) +@@ -783,6 +781,18 @@ static int mirror_exit_common(Job *job) blk_set_perm(bjob->blk, 0, BLK_PERM_ALL, &error_abort); blk_insert_bs(bjob->blk, mirror_top_bs, &error_abort); @@ -54,7 +55,7 @@ index 9d73875bd6..8148df1f80 100644 bs_opaque->job = NULL; bdrv_drained_end(src); -@@ -1628,10 +1638,6 @@ static BlockJob *mirror_start_job( +@@ -1635,10 +1645,6 @@ static BlockJob *mirror_start_job( " sync mode", MirrorSyncMode_str(sync_mode)); return NULL; @@ -65,7 +66,7 @@ index 9d73875bd6..8148df1f80 100644 } } else if (bitmap) { error_setg(errp, -@@ -1648,6 +1654,12 @@ static BlockJob *mirror_start_job( +@@ -1655,6 +1661,12 @@ static BlockJob *mirror_start_job( return NULL; } granularity = bdrv_dirty_bitmap_granularity(bitmap); diff --git a/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch b/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch index 9298a1e..9b1c40b 100644 --- a/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch +++ b/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch @@ -10,6 +10,7 @@ as one without the other does not make much sense with the current set of modes. Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- blockdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/patches/bitmap-mirror/0004-mirror-switch-to-bdrv_dirty_bitmap_merge_internal.patch b/debian/patches/bitmap-mirror/0004-mirror-switch-to-bdrv_dirty_bitmap_merge_internal.patch index 7369c2b..faced44 100644 --- a/debian/patches/bitmap-mirror/0004-mirror-switch-to-bdrv_dirty_bitmap_merge_internal.patch +++ b/debian/patches/bitmap-mirror/0004-mirror-switch-to-bdrv_dirty_bitmap_merge_internal.patch @@ -10,15 +10,16 @@ since sync_bitmap is busy at the point of merging, and we checked access beforehand. Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- block/mirror.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/block/mirror.c b/block/mirror.c -index 8148df1f80..46e3d0860b 100644 +index c688726fae..a7f829f766 100644 --- a/block/mirror.c +++ b/block/mirror.c -@@ -780,8 +780,8 @@ static int mirror_exit_common(Job *job) +@@ -787,8 +787,8 @@ static int mirror_exit_common(Job *job) job->ret == 0 && ret == 0)) { /* Success; synchronize copy back to sync. */ bdrv_clear_dirty_bitmap(s->sync_bitmap, NULL); @@ -29,7 +30,7 @@ index 8148df1f80..46e3d0860b 100644 } } bdrv_release_dirty_bitmap(s->dirty_bitmap); -@@ -1828,11 +1828,8 @@ static BlockJob *mirror_start_job( +@@ -1835,11 +1835,8 @@ static BlockJob *mirror_start_job( } if (s->sync_mode == MIRROR_SYNC_MODE_BITMAP) { diff --git a/debian/patches/bitmap-mirror/0005-iotests-add-test-for-bitmap-mirror.patch b/debian/patches/bitmap-mirror/0005-iotests-add-test-for-bitmap-mirror.patch index bb7eaae..025e6d6 100644 --- a/debian/patches/bitmap-mirror/0005-iotests-add-test-for-bitmap-mirror.patch +++ b/debian/patches/bitmap-mirror/0005-iotests-add-test-for-bitmap-mirror.patch @@ -20,6 +20,7 @@ intentionally keeping copyright and ownership of original test case to honor provenance. Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- tests/qemu-iotests/384 | 547 +++++++ tests/qemu-iotests/384.out | 2846 ++++++++++++++++++++++++++++++++++++ diff --git a/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch b/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch index bc72613..3edc237 100644 --- a/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch +++ b/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch @@ -11,6 +11,7 @@ mode was never available for drive-mirror, it makes the interface more uniform w.r.t. backup block jobs. Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- block/mirror.c | 28 +++------------ blockdev.c | 29 +++++++++++++++ @@ -18,10 +19,10 @@ Signed-off-by: Fabian Grünbichler 3 files changed, 70 insertions(+), 59 deletions(-) diff --git a/block/mirror.c b/block/mirror.c -index 46e3d0860b..33477ade1b 100644 +index a7f829f766..6a126d18c8 100644 --- a/block/mirror.c +++ b/block/mirror.c -@@ -1628,31 +1628,13 @@ static BlockJob *mirror_start_job( +@@ -1635,31 +1635,13 @@ static BlockJob *mirror_start_job( uint64_t target_perms, target_shared_perms; int ret; diff --git a/debian/patches/extra/0002-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch b/debian/patches/extra/0001-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch similarity index 99% rename from debian/patches/extra/0002-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch rename to debian/patches/extra/0001-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch index 53ba302..3bc5a4f 100644 --- a/debian/patches/extra/0002-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch +++ b/debian/patches/extra/0001-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch @@ -37,6 +37,7 @@ looping to open a connection, send the greeting, then exiting no longer crashes other, normally behaving clients with unrelated responses. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- include/monitor/monitor.h | 1 + monitor/monitor-internal.h | 7 +++++++ diff --git a/debian/patches/extra/0001-qemu-sockets-fix-unix-socket-path-copy-again.patch b/debian/patches/extra/0001-qemu-sockets-fix-unix-socket-path-copy-again.patch deleted file mode 100644 index d7adc45..0000000 --- a/debian/patches/extra/0001-qemu-sockets-fix-unix-socket-path-copy-again.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Tokarev -Date: Wed, 1 Sep 2021 16:16:24 +0300 -Subject: [PATCH] qemu-sockets: fix unix socket path copy (again) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit 4cfd970ec188558daa6214f26203fe553fb1e01f added an -assert which ensures the path within an address of a unix -socket returned from the kernel is at least one byte and -does not exceed sun_path buffer. Both of this constraints -are wrong: - -A unix socket can be unnamed, in this case the path is -completely empty (not even \0) - -And some implementations (notable linux) can add extra -trailing byte (\0) _after_ the sun_path buffer if we -passed buffer larger than it (and we do). - -So remove the assertion (since it causes real-life breakage) -but at the same time fix the usage of sun_path. Namely, -we should not access sun_path[0] if kernel did not return -it at all (this is the case for unnamed sockets), -and use the returned salen when copyig actual path as an -upper constraint for the amount of bytes to copy - this -will ensure we wont exceed the information provided by -the kernel, regardless whenever there is a trailing \0 -or not. This also helps with unnamed sockets. - -Note the case of abstract socket, the sun_path is actually -a blob and can contain \0 characters, - it should not be -passed to g_strndup and the like, it should be accessed by -memcpy-like functions. - -Fixes: 4cfd970ec188558daa6214f26203fe553fb1e01f -Fixes: http://bugs.debian.org/993145 -Signed-off-by: Michael Tokarev -Reviewed-by: Daniel P. Berrangé -Reviewed-by: Marc-André Lureau -CC: qemu-stable@nongnu.org ---- - util/qemu-sockets.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c -index f2f3676d1f..c5043999e9 100644 ---- a/util/qemu-sockets.c -+++ b/util/qemu-sockets.c -@@ -1345,25 +1345,22 @@ socket_sockaddr_to_address_unix(struct sockaddr_storage *sa, - SocketAddress *addr; - struct sockaddr_un *su = (struct sockaddr_un *)sa; - -- assert(salen >= sizeof(su->sun_family) + 1 && -- salen <= sizeof(struct sockaddr_un)); -- - addr = g_new0(SocketAddress, 1); - addr->type = SOCKET_ADDRESS_TYPE_UNIX; -+ salen -= offsetof(struct sockaddr_un, sun_path); - #ifdef CONFIG_LINUX -- if (!su->sun_path[0]) { -+ if (salen > 0 && !su->sun_path[0]) { - /* Linux abstract socket */ -- addr->u.q_unix.path = g_strndup(su->sun_path + 1, -- salen - sizeof(su->sun_family) - 1); -+ addr->u.q_unix.path = g_strndup(su->sun_path + 1, salen - 1); - addr->u.q_unix.has_abstract = true; - addr->u.q_unix.abstract = true; - addr->u.q_unix.has_tight = true; -- addr->u.q_unix.tight = salen < sizeof(*su); -+ addr->u.q_unix.tight = salen < sizeof(su->sun_path); - return addr; - } - #endif - -- addr->u.q_unix.path = g_strndup(su->sun_path, sizeof(su->sun_path)); -+ addr->u.q_unix.path = g_strndup(su->sun_path, salen); - return addr; - } - #endif /* WIN32 */ diff --git a/debian/patches/extra/0003-monitor-hmp-add-support-for-flag-argument-with-value.patch b/debian/patches/extra/0002-monitor-hmp-add-support-for-flag-argument-with-value.patch similarity index 97% rename from debian/patches/extra/0003-monitor-hmp-add-support-for-flag-argument-with-value.patch rename to debian/patches/extra/0002-monitor-hmp-add-support-for-flag-argument-with-value.patch index ca1fbaf..17df26c 100644 --- a/debian/patches/extra/0003-monitor-hmp-add-support-for-flag-argument-with-value.patch +++ b/debian/patches/extra/0002-monitor-hmp-add-support-for-flag-argument-with-value.patch @@ -12,6 +12,7 @@ omitted if the flag is not given. Reviewed-by: Eric Blake Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- monitor/hmp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/debian/patches/extra/0004-monitor-refactor-set-expire_password-and-allow-VNC-d.patch b/debian/patches/extra/0003-monitor-refactor-set-expire_password-and-allow-VNC-d.patch similarity index 96% rename from debian/patches/extra/0004-monitor-refactor-set-expire_password-and-allow-VNC-d.patch rename to debian/patches/extra/0003-monitor-refactor-set-expire_password-and-allow-VNC-d.patch index 8d8b20a..7f02cf6 100644 --- a/debian/patches/extra/0004-monitor-refactor-set-expire_password-and-allow-VNC-d.patch +++ b/debian/patches/extra/0003-monitor-refactor-set-expire_password-and-allow-VNC-d.patch @@ -23,12 +23,13 @@ variants of the commands with protocol-discriminated unions. Suggested-by: Eric Blake Suggested-by: Markus Armbruster Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- hmp-commands.hx | 29 ++++---- monitor/hmp-cmds.c | 57 +++++++++++++++- monitor/qmp-cmds.c | 62 ++++++----------- - qapi/ui.json | 163 ++++++++++++++++++++++++++++++++++++++------- - 4 files changed, 232 insertions(+), 79 deletions(-) + qapi/ui.json | 165 ++++++++++++++++++++++++++++++++++++++------- + 4 files changed, 233 insertions(+), 80 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8e45bce2cd..d78e4cfc47 100644 @@ -85,7 +86,7 @@ index 8e45bce2cd..d78e4cfc47 100644 ``now`` Invalidate password instantly. diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index e00255f7ee..047294e1ed 100644 +index a7e197a90b..f4ef58d257 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1451,10 +1451,41 @@ void hmp_set_password(Monitor *mon, const QDict *qdict) @@ -138,7 +139,8 @@ index e00255f7ee..047294e1ed 100644 + const char *display = qdict_get_try_str(qdict, "display"); Error *err = NULL; + DisplayProtocol proto; -+ + +- qmp_expire_password(protocol, whenstr, &err); + ExpirePasswordOptions opts = { + .time = g_strdup(whenstr), + .u.vnc.display = NULL, @@ -156,8 +158,7 @@ index e00255f7ee..047294e1ed 100644 + opts.u.vnc.has_display = !!display; + opts.u.vnc.display = g_strdup(display); + } - -- qmp_expire_password(protocol, whenstr, &err); ++ + qmp_expire_password(&opts, &err); + g_free(opts.time); + g_free(opts.u.vnc.display); @@ -179,7 +180,10 @@ index f7d64a6457..65882b5997 100644 - int disconnect_if_connected = 0; - int fail_if_connected = 0; - int rc; -- ++ bool disconnect_if_connected = false; ++ bool fail_if_connected = false; ++ int rc = 0; + - if (has_connected) { - if (strcmp(connected, "fail") == 0) { - fail_if_connected = 1; @@ -192,30 +196,27 @@ index f7d64a6457..65882b5997 100644 - return; - } - } -+ bool disconnect_if_connected = false; -+ bool fail_if_connected = false; -+ int rc = 0; - +- - if (strcmp(protocol, "spice") == 0) { + if (opts->protocol == DISPLAY_PROTOCOL_SPICE) { if (!qemu_using_spice(errp)) { return; } - rc = qemu_spice.set_passwd(password, fail_if_connected, -- disconnect_if_connected); -- } else if (strcmp(protocol, "vnc") == 0) { -- if (fail_if_connected || disconnect_if_connected) { -- /* vnc supports "connected=keep" only */ -- error_setg(errp, QERR_INVALID_PARAMETER, "connected"); -- return; + if (opts->u.spice.has_connected) { + fail_if_connected = + opts->u.spice.connected == SET_PASSWORD_ACTION_FAIL; + disconnect_if_connected = + opts->u.spice.connected == SET_PASSWORD_ACTION_DISCONNECT; - } ++ } + rc = qemu_spice.set_passwd(opts->password, fail_if_connected, -+ disconnect_if_connected); + disconnect_if_connected); +- } else if (strcmp(protocol, "vnc") == 0) { +- if (fail_if_connected || disconnect_if_connected) { +- /* vnc supports "connected=keep" only */ +- error_setg(errp, QERR_INVALID_PARAMETER, "connected"); +- return; +- } + } else if (opts->protocol == DISPLAY_PROTOCOL_VNC) { /* Note that setting an empty password will not disable login through * this interface. */ @@ -267,41 +268,44 @@ index f7d64a6457..65882b5997 100644 if (rc != 0) { diff --git a/qapi/ui.json b/qapi/ui.json -index fd9677d48e..0177cf4ee9 100644 +index fd9677d48e..cba8665b73 100644 --- a/qapi/ui.json +++ b/qapi/ui.json -@@ -10,20 +10,21 @@ +@@ -9,22 +9,23 @@ + { 'include': 'common.json' } { 'include': 'sockets.json' } - ## --# @set_password: ++## +# @DisplayProtocol: - # --# Sets the password of a remote display session. ++# +# Display protocols which support changing password options. - # --# @protocol: - 'vnc' to modify the VNC server password --# - 'spice' to modify the Spice server password ++# +# Since: 6.2 - # --# @password: the new password ++# +## +{ 'enum': 'DisplayProtocol', + 'data': [ { 'name': 'vnc', 'if': 'defined(CONFIG_VNC)' }, + { 'name': 'spice', 'if': 'defined(CONFIG_SPICE)' } ] } + -+## -+# @set_password: + ## + # @set_password: # + # Sets the password of a remote display session. + # +-# @protocol: - 'vnc' to modify the VNC server password +-# - 'spice' to modify the Spice server password +-# +-# @password: the new password +-# -# @connected: how to handle existing clients when changing the -# password. If nothing is specified, defaults to 'keep' -# 'fail' to fail the command if clients are connected -# 'disconnect' to disconnect existing clients -# 'keep' to maintain existing clients -+# Sets the password of a remote display session. - # +-# # Returns: - Nothing on success # - If Spice is not enabled, DeviceNotFound + # @@ -37,16 +38,123 @@ # <- { "return": {} } # @@ -406,7 +410,7 @@ index fd9677d48e..0177cf4ee9 100644 -# @protocol: the name of the remote display protocol 'vnc' or 'spice' +# Returns: - Nothing on success +# - If @protocol is 'spice' and Spice is not active, DeviceNotFound -+# + # +# Since: 0.14 +# +# Example: @@ -422,7 +426,7 @@ index fd9677d48e..0177cf4ee9 100644 +# @ExpirePasswordOptions: +# +# Data required to set password expiration on a display server protocol. - # ++# +# @protocol: - 'vnc' to modify the VNC server expiration +# - 'spice' to modify the Spice server expiration + diff --git a/debian/patches/extra/0007-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch b/debian/patches/extra/0004-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch similarity index 92% rename from debian/patches/extra/0007-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch rename to debian/patches/extra/0004-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch index f108313..74df3e1 100644 --- a/debian/patches/extra/0007-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch +++ b/debian/patches/extra/0004-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch @@ -1,7 +1,7 @@ -From 14889c02315b196f28b02832362dead64b015b6e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Fri, 10 Sep 2021 14:45:33 +0200 -Subject: [PATCH qemu] block/mirror: fix NULL pointer dereference in +Subject: [PATCH] block/mirror: fix NULL pointer dereference in mirror_wait_on_conflicts() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -37,15 +37,16 @@ Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz (cherry picked from commit 66fed30c9cd11854fc878a4eceb507e915d7c9cd) Signed-off-by: Fabian Grünbichler +Signed-off-by: Thomas Lamprecht --- block/mirror.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/block/mirror.c b/block/mirror.c -index 33477ade1b..6a126d18c8 100644 +index 98fc66eabf..85b781bc21 100644 --- a/block/mirror.c +++ b/block/mirror.c -@@ -162,18 +162,25 @@ static void coroutine_fn mirror_wait_on_conflicts(MirrorOp *self, +@@ -160,18 +160,25 @@ static void coroutine_fn mirror_wait_on_conflicts(MirrorOp *self, if (ranges_overlap(self_start_chunk, self_nb_chunks, op_start_chunk, op_nb_chunks)) { @@ -80,6 +81,3 @@ index 33477ade1b..6a126d18c8 100644 break; } } --- -2.30.2 - diff --git a/debian/patches/extra/0005-monitor-hmp-correctly-invert-password-argument-detec.patch b/debian/patches/extra/0005-monitor-hmp-correctly-invert-password-argument-detec.patch deleted file mode 100644 index 3d79a35..0000000 --- a/debian/patches/extra/0005-monitor-hmp-correctly-invert-password-argument-detec.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Stefan Reiter -Date: Wed, 25 Aug 2021 11:08:41 +0200 -Subject: [PATCH] monitor/hmp: correctly invert password argument detection - again -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit cfb5387a1d 'hmp: remove "change vnc TARGET" command' claims to -remove the HMP "change vnc" command, but doesn't actually do that. -Instead it rewires it to use 'qmp_change_vnc_password', and in the -process inverts the argument detection - ignoring the first issue, this -inversion is wrong, as this will now ask the user for a password if one -is already provided, and simply fail if none is given. - -Fixes: cfb5387a1d ("hmp: remove "change vnc TARGET" command") -Reviewed-by: Marc-André Lureau -Signed-off-by: Stefan Reiter ---- - monitor/hmp-cmds.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index 047294e1ed..f4ef58d257 100644 ---- a/monitor/hmp-cmds.c -+++ b/monitor/hmp-cmds.c -@@ -1549,7 +1549,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) - } - if (strcmp(target, "passwd") == 0 || - strcmp(target, "password") == 0) { -- if (arg) { -+ if (!arg) { - MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); - monitor_read_password(hmp_mon, hmp_change_read_arg, NULL); - return; diff --git a/debian/patches/extra/0006-qxl-fix-pre-save-logic.patch b/debian/patches/extra/0006-qxl-fix-pre-save-logic.patch deleted file mode 100644 index 398781a..0000000 --- a/debian/patches/extra/0006-qxl-fix-pre-save-logic.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Fri, 10 Sep 2021 11:42:03 +0200 -Subject: [PATCH] qxl: fix pre-save logic -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Oops. Logic is backwards. - -Fixes: 39b8a183e2f3 ("qxl: remove assert in qxl_pre_save.") -Resolves: https://gitlab.com/qemu-project/qemu/-/issues/610 -Resolves: https://bugzilla.redhat.com//show_bug.cgi?id=2002907 -Signed-off-by: Gerd Hoffmann -Reviewed-by: Daniel P. Berrangé -Reviewed-by: Marc-André Lureau -Message-Id: <20210910094203.3582378-1-kraxel@redhat.com> ---- - hw/display/qxl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/display/qxl.c b/hw/display/qxl.c -index 43482d4364..29c80b4289 100644 ---- a/hw/display/qxl.c -+++ b/hw/display/qxl.c -@@ -2252,7 +2252,7 @@ static int qxl_pre_save(void *opaque) - } else { - d->last_release_offset = (uint8_t *)d->last_release - ram_start; - } -- if (d->last_release_offset < d->vga.vram_size) { -+ if (d->last_release_offset >= d->vga.vram_size) { - return 1; - } - diff --git a/debian/patches/extra/0008-block-introduce-max_hw_iov-for-use-in-scsi-generic.patch b/debian/patches/extra/0008-block-introduce-max_hw_iov-for-use-in-scsi-generic.patch deleted file mode 100644 index 06bc693..0000000 --- a/debian/patches/extra/0008-block-introduce-max_hw_iov-for-use-in-scsi-generic.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 23 Sep 2021 09:04:36 -0400 -Subject: [PATCH] block: introduce max_hw_iov for use in scsi-generic - -Linux limits the size of iovecs to 1024 (UIO_MAXIOV in the kernel -sources, IOV_MAX in POSIX). Because of this, on some host adapters -requests with many iovecs are rejected with -EINVAL by the -io_submit() or readv()/writev() system calls. - -In fact, the same limit applies to SG_IO as well. To fix both the -EINVAL and the possible performance issues from using fewer iovecs -than allowed by Linux (some HBAs have max_segments as low as 128), -introduce a separate entry in BlockLimits to hold the max_segments -value from sysfs. This new limit is used only for SG_IO and clamped -to bs->bl.max_iov anyway, just like max_hw_transfer is clamped to -bs->bl.max_transfer. - -Reported-by: Halil Pasic -Cc: Hanna Reitz -Cc: Kevin Wolf -Cc: qemu-block@nongnu.org -Cc: qemu-stable@nongnu.org -Fixes: 18473467d5 ("file-posix: try BLKSECTGET on block devices too, do not round to power of 2", 2021-06-25) -Signed-off-by: Paolo Bonzini -Message-Id: <20210923130436.1187591-1-pbonzini@redhat.com> -Signed-off-by: Kevin Wolf ---- - block/block-backend.c | 6 ++++++ - block/file-posix.c | 2 +- - block/io.c | 1 + - hw/scsi/scsi-generic.c | 2 +- - include/block/block_int.h | 7 +++++++ - include/sysemu/block-backend.h | 1 + - 6 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/block/block-backend.c b/block/block-backend.c -index 6140d133e2..ba2b5ebb10 100644 ---- a/block/block-backend.c -+++ b/block/block-backend.c -@@ -1986,6 +1986,12 @@ uint32_t blk_get_max_transfer(BlockBackend *blk) - return ROUND_DOWN(max, blk_get_request_alignment(blk)); - } - -+int blk_get_max_hw_iov(BlockBackend *blk) -+{ -+ return MIN_NON_ZERO(blk->root->bs->bl.max_hw_iov, -+ blk->root->bs->bl.max_iov); -+} -+ - int blk_get_max_iov(BlockBackend *blk) - { - return blk->root->bs->bl.max_iov; -diff --git a/block/file-posix.c b/block/file-posix.c -index c62e42743d..53be0bdc1b 100644 ---- a/block/file-posix.c -+++ b/block/file-posix.c -@@ -1273,7 +1273,7 @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp) - - ret = hdev_get_max_segments(s->fd, &st); - if (ret > 0) { -- bs->bl.max_iov = ret; -+ bs->bl.max_hw_iov = ret; - } - } - } -diff --git a/block/io.c b/block/io.c -index 18d345a87a..bb0a254def 100644 ---- a/block/io.c -+++ b/block/io.c -@@ -136,6 +136,7 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src) - dst->min_mem_alignment = MAX(dst->min_mem_alignment, - src->min_mem_alignment); - dst->max_iov = MIN_NON_ZERO(dst->max_iov, src->max_iov); -+ dst->max_hw_iov = MIN_NON_ZERO(dst->max_hw_iov, src->max_hw_iov); - } - - typedef struct BdrvRefreshLimitsState { -diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c -index 665baf900e..0306ccc7b1 100644 ---- a/hw/scsi/scsi-generic.c -+++ b/hw/scsi/scsi-generic.c -@@ -180,7 +180,7 @@ static int scsi_handle_inquiry_reply(SCSIGenericReq *r, SCSIDevice *s, int len) - page = r->req.cmd.buf[2]; - if (page == 0xb0) { - uint64_t max_transfer = blk_get_max_hw_transfer(s->conf.blk); -- uint32_t max_iov = blk_get_max_iov(s->conf.blk); -+ uint32_t max_iov = blk_get_max_hw_iov(s->conf.blk); - - assert(max_transfer); - max_transfer = MIN_NON_ZERO(max_transfer, max_iov * qemu_real_host_page_size) -diff --git a/include/block/block_int.h b/include/block/block_int.h -index ffe86068d4..f4c75e8ba9 100644 ---- a/include/block/block_int.h -+++ b/include/block/block_int.h -@@ -718,6 +718,13 @@ typedef struct BlockLimits { - */ - uint64_t max_hw_transfer; - -+ /* Maximal number of scatter/gather elements allowed by the hardware. -+ * Applies whenever transfers to the device bypass the kernel I/O -+ * scheduler, for example with SG_IO. If larger than max_iov -+ * or if zero, blk_get_max_hw_iov will fall back to max_iov. -+ */ -+ int max_hw_iov; -+ - /* memory alignment, in bytes so that no bounce buffer is needed */ - size_t min_mem_alignment; - -diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h -index 29d4fdbf63..82bae55161 100644 ---- a/include/sysemu/block-backend.h -+++ b/include/sysemu/block-backend.h -@@ -211,6 +211,7 @@ uint32_t blk_get_request_alignment(BlockBackend *blk); - uint32_t blk_get_max_transfer(BlockBackend *blk); - uint64_t blk_get_max_hw_transfer(BlockBackend *blk); - int blk_get_max_iov(BlockBackend *blk); -+int blk_get_max_hw_iov(BlockBackend *blk); - void blk_set_guest_block_size(BlockBackend *blk, int align); - void *blk_try_blockalign(BlockBackend *blk, size_t size); - void *blk_blockalign(BlockBackend *blk, size_t size); --- -2.30.2 - diff --git a/debian/patches/pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch b/debian/patches/pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch index 07e4f2e..5d8cb96 100644 --- a/debian/patches/pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch +++ b/debian/patches/pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch @@ -14,7 +14,7 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c -index cb9bffe047..1bbeb9e658 100644 +index dd295cfc6d..3ac5177cbb 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -533,7 +533,7 @@ static QemuOptsList raw_runtime_opts = { diff --git a/debian/patches/pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch b/debian/patches/pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch index ff5e17d..34d875f 100644 --- a/debian/patches/pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch +++ b/debian/patches/pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch @@ -10,10 +10,10 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h -index 6c50d3ab4f..00289a798a 100644 +index 21b33fbe2e..32514193a9 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h -@@ -2006,9 +2006,9 @@ uint64_t cpu_get_tsc(CPUX86State *env); +@@ -2007,9 +2007,9 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define CPU_RESOLVING_TYPE TYPE_X86_CPU #ifdef TARGET_X86_64 diff --git a/debian/patches/pve/0010-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch b/debian/patches/pve/0010-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch index e12ed3f..e4a92ab 100644 --- a/debian/patches/pve/0010-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch +++ b/debian/patches/pve/0010-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch @@ -134,7 +134,11 @@ index 5dc1d0a2ca..f773182bd0 100644 - error_report_err(local_err); - ret = -1; - goto out; -- } ++ if (!blk1) { ++ ret = -1; ++ goto out; ++ } + } - if (!drv->create_opts) { - error_report("Format driver '%s' does not support image creation", - drv->format_name); @@ -146,16 +150,12 @@ index 5dc1d0a2ca..f773182bd0 100644 - proto_drv->format_name); - ret = -1; - goto out; -+ if (!blk1) { -+ ret = -1; -+ goto out; -+ } - } +- } - create_opts = qemu_opts_append(create_opts, drv->create_opts); - create_opts = qemu_opts_append(create_opts, proto_drv->create_opts); - -- opts = qemu_opts_create(create_opts, NULL, 0, &error_abort); - +- opts = qemu_opts_create(create_opts, NULL, 0, &error_abort); + - size = blk_getlength(blk1); - if (size < 0) { - error_report("Failed to get size for '%s'", in.filename); diff --git a/debian/patches/pve/0013-PVE-virtio-balloon-improve-query-balloon.patch b/debian/patches/pve/0013-PVE-virtio-balloon-improve-query-balloon.patch index f41e87c..caa50a1 100644 --- a/debian/patches/pve/0013-PVE-virtio-balloon-improve-query-balloon.patch +++ b/debian/patches/pve/0013-PVE-virtio-balloon-improve-query-balloon.patch @@ -14,10 +14,10 @@ Signed-off-by: Thomas Lamprecht 3 files changed, 81 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c -index 4b5d9e5e50..fddb5a4b82 100644 +index ae7867a8db..956e3f4e46 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c -@@ -807,8 +807,37 @@ static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f, +@@ -820,8 +820,37 @@ static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f, static void virtio_balloon_stat(void *opaque, BalloonInfo *info) { VirtIOBalloon *dev = opaque; @@ -58,7 +58,7 @@ index 4b5d9e5e50..fddb5a4b82 100644 static void virtio_balloon_to_target(void *opaque, ram_addr_t target) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index e00255f7ee..f528055cb6 100644 +index f4ef58d257..c8b97909e7 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -698,7 +698,35 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict) diff --git a/debian/patches/pve/0015-PVE-qapi-modify-spice-query.patch b/debian/patches/pve/0015-PVE-qapi-modify-spice-query.patch index 38478d7..32d06b3 100644 --- a/debian/patches/pve/0015-PVE-qapi-modify-spice-query.patch +++ b/debian/patches/pve/0015-PVE-qapi-modify-spice-query.patch @@ -12,10 +12,10 @@ Signed-off-by: Thomas Lamprecht 2 files changed, 8 insertions(+) diff --git a/qapi/ui.json b/qapi/ui.json -index fd9677d48e..4497bb9c1f 100644 +index cba8665b73..081115ea8a 100644 --- a/qapi/ui.json +++ b/qapi/ui.json -@@ -216,11 +216,14 @@ +@@ -333,11 +333,14 @@ # # @channels: a list of @SpiceChannel for each active spice channel # diff --git a/debian/patches/pve/0016-PVE-add-savevm-async-for-background-state-snapshots.patch b/debian/patches/pve/0016-PVE-add-savevm-async-for-background-state-snapshots.patch index 77cddc9..8b6ebcb 100644 --- a/debian/patches/pve/0016-PVE-add-savevm-async-for-background-state-snapshots.patch +++ b/debian/patches/pve/0016-PVE-add-savevm-async-for-background-state-snapshots.patch @@ -63,10 +63,10 @@ index 27206ac049..e6dd3be07a 100644 .name = "balloon", .args_type = "", diff --git a/hmp-commands.hx b/hmp-commands.hx -index 8e45bce2cd..96bd7e00bd 100644 +index d78e4cfc47..42203dbe92 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx -@@ -1743,3 +1743,36 @@ ERST +@@ -1744,3 +1744,36 @@ ERST .help = "start a round of guest dirty rate measurement", .cmd = hmp_calc_dirty_rate, }, @@ -754,10 +754,10 @@ index 0000000000..79a0cda906 + return ret; +} diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index f528055cb6..42a1eaf370 100644 +index c8b97909e7..64a84cf4ee 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c -@@ -1908,6 +1908,63 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) +@@ -1961,6 +1961,63 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) hmp_handle_error(mon, err); } diff --git a/debian/patches/pve/0017-PVE-add-optional-buffer-size-to-QEMUFile.patch b/debian/patches/pve/0017-PVE-add-optional-buffer-size-to-QEMUFile.patch index 928cf3e..0bbaed4 100644 --- a/debian/patches/pve/0017-PVE-add-optional-buffer-size-to-QEMUFile.patch +++ b/debian/patches/pve/0017-PVE-add-optional-buffer-size-to-QEMUFile.patch @@ -9,6 +9,7 @@ increase performance storing the state onto ceph. Signed-off-by: Wolfgang Bumiller [increase max IOV count in QEMUFile to actually write more data] Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- migration/qemu-file.c | 38 +++++++++++++++++++++++++------------- migration/qemu-file.h | 1 + diff --git a/debian/patches/pve/0021-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch b/debian/patches/pve/0021-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch index 75c6d86..afa0b0e 100644 --- a/debian/patches/pve/0021-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch +++ b/debian/patches/pve/0021-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch @@ -13,7 +13,7 @@ Signed-off-by: Thomas Lamprecht 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c -index 1bbeb9e658..f28c5a3e52 100644 +index 3ac5177cbb..907aa3f22e 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2443,6 +2443,7 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp) diff --git a/debian/patches/pve/0022-PVE-monitor-disable-oob-capability.patch b/debian/patches/pve/0022-PVE-monitor-disable-oob-capability.patch index 5171992..9abde33 100644 --- a/debian/patches/pve/0022-PVE-monitor-disable-oob-capability.patch +++ b/debian/patches/pve/0022-PVE-monitor-disable-oob-capability.patch @@ -18,10 +18,10 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitor/qmp.c b/monitor/qmp.c -index 092c527b6f..0ef7cebb78 100644 +index 6b8cfcf6d8..3ec67e32d3 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c -@@ -506,8 +506,7 @@ void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp) +@@ -519,8 +519,7 @@ void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp) qemu_chr_fe_set_echo(&mon->common.chr, true); /* Note: we run QMP monitor in I/O thread when @chr supports that */ diff --git a/debian/patches/pve/0023-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch b/debian/patches/pve/0023-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch index 7a22977..ff9f43c 100644 --- a/debian/patches/pve/0023-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch +++ b/debian/patches/pve/0023-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch @@ -26,10 +26,10 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.c -index 54e040587d..905fcdc03d 100644 +index 2cf2f321f9..e0f857820d 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c -@@ -106,7 +106,8 @@ GlobalProperty hw_compat_4_0[] = { +@@ -107,7 +107,8 @@ GlobalProperty hw_compat_4_0[] = { { "virtio-vga", "edid", "false" }, { "virtio-gpu-device", "edid", "false" }, { "virtio-device", "use-started", "false" }, diff --git a/debian/patches/pve/0024-PVE-Allow-version-code-in-machine-type.patch b/debian/patches/pve/0024-PVE-Allow-version-code-in-machine-type.patch index 0eb9682..e699c7d 100644 --- a/debian/patches/pve/0024-PVE-Allow-version-code-in-machine-type.patch +++ b/debian/patches/pve/0024-PVE-Allow-version-code-in-machine-type.patch @@ -10,12 +10,13 @@ Version is made available as 'pve-version' in query-machines (same as, and only if 'is-current'). Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- hw/core/machine-qmp-cmds.c | 6 ++++++ include/hw/boards.h | 2 ++ qapi/machine.json | 4 +++- - softmmu/vl.c | 23 +++++++++++++++++++++++ - 4 files changed, 34 insertions(+), 1 deletion(-) + softmmu/vl.c | 25 +++++++++++++++++++++++++ + 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 8f8d5d5276..370e66d9cc 100644 @@ -70,7 +71,7 @@ index cf120ac343..a6f483af4f 100644 ## # @query-machines: diff --git a/softmmu/vl.c b/softmmu/vl.c -index d87cf6e103..e5010236f3 100644 +index d87cf6e103..e9d40065bc 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1621,6 +1621,7 @@ static const QEMUOption *lookup_opt(int argc, char **argv, diff --git a/debian/patches/pve/0025-PVE-Backup-add-vma-backup-format-code.patch b/debian/patches/pve/0025-PVE-Backup-add-vma-backup-format-code.patch index 31cd97e..46436f4 100644 --- a/debian/patches/pve/0025-PVE-Backup-add-vma-backup-format-code.patch +++ b/debian/patches/pve/0025-PVE-Backup-add-vma-backup-format-code.patch @@ -3,6 +3,7 @@ From: Dietmar Maurer Date: Mon, 6 Apr 2020 12:16:57 +0200 Subject: [PATCH] PVE-Backup: add vma backup format code +Signed-off-by: Thomas Lamprecht --- block/meson.build | 2 + meson.build | 5 + @@ -30,7 +31,7 @@ index 7a0bc3df09..9ce9246194 100644 block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c')) diff --git a/meson.build b/meson.build -index b3e7ec0e92..b84f62f882 100644 +index b3e7ec0e92..cc46eabb42 100644 --- a/meson.build +++ b/meson.build @@ -1064,6 +1064,8 @@ keyutils = dependency('libkeyutils', required: false, diff --git a/debian/patches/pve/0026-PVE-Backup-add-backup-dump-block-driver.patch b/debian/patches/pve/0026-PVE-Backup-add-backup-dump-block-driver.patch index ddfee81..6da27d3 100644 --- a/debian/patches/pve/0026-PVE-Backup-add-backup-dump-block-driver.patch +++ b/debian/patches/pve/0026-PVE-Backup-add-backup-dump-block-driver.patch @@ -7,6 +7,8 @@ Subject: [PATCH] PVE-Backup: add backup-dump block driver - move BackupBlockJob declaration from block/backup.c to include/block/block_int.h - block/backup.c - backup-job-create: also consider source cluster size - job.c: make job_should_pause non-static + +Signed-off-by: Thomas Lamprecht --- block/backup-dump.c | 168 ++++++++++++++++++++++++++++++++++++++ block/backup.c | 32 +++----- @@ -253,7 +255,7 @@ index 9ce9246194..19bc2b7cbb 100644 'blkdebug.c', 'blklogwrites.c', diff --git a/include/block/block_int.h b/include/block/block_int.h -index 3e625a4261..4bd5fdb191 100644 +index 11442893d0..8f6135e6a5 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -26,6 +26,7 @@ diff --git a/debian/patches/pve/0027-PVE-Backup-proxmox-backup-patches-for-qemu.patch b/debian/patches/pve/0027-PVE-Backup-proxmox-backup-patches-for-qemu.patch index 909b673..30f6d2d 100644 --- a/debian/patches/pve/0027-PVE-Backup-proxmox-backup-patches-for-qemu.patch +++ b/debian/patches/pve/0027-PVE-Backup-proxmox-backup-patches-for-qemu.patch @@ -6,6 +6,7 @@ Subject: [PATCH] PVE-Backup: proxmox backup patches for qemu Signed-off-by: Dietmar Maurer [PVE-Backup: avoid coroutines to fix AIO freeze, cleanups] Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/meson.build | 5 + block/monitor/block-hmp-cmds.c | 33 ++ @@ -122,7 +123,7 @@ index e6dd3be07a..15ddecada1 100644 { .name = "usernet", diff --git a/hmp-commands.hx b/hmp-commands.hx -index 96bd7e00bd..b18063ce19 100644 +index 42203dbe92..7faba36b39 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -99,6 +99,35 @@ ERST @@ -162,7 +163,7 @@ index 96bd7e00bd..b18063ce19 100644 { diff --git a/include/block/block_int.h b/include/block/block_int.h -index 4bd5fdb191..10452dd50b 100644 +index 8f6135e6a5..4a572a2e34 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -66,7 +66,7 @@ @@ -196,7 +197,7 @@ index 1247d7362a..8d3df46c93 100644 void hmp_device_add(Monitor *mon, const QDict *qdict); void hmp_device_del(Monitor *mon, const QDict *qdict); diff --git a/meson.build b/meson.build -index b84f62f882..c05c926cc3 100644 +index cc46eabb42..7d7e474313 100644 --- a/meson.build +++ b/meson.build @@ -1065,6 +1065,7 @@ keyutils = dependency('libkeyutils', required: false, @@ -208,7 +209,7 @@ index b84f62f882..c05c926cc3 100644 # Malloc tests diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index 42a1eaf370..55033530fb 100644 +index 64a84cf4ee..7efcd2d641 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -195,6 +195,50 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict) diff --git a/debian/patches/pve/0028-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch b/debian/patches/pve/0028-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch index c5ae406..2002f4a 100644 --- a/debian/patches/pve/0028-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch +++ b/debian/patches/pve/0028-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch @@ -12,7 +12,7 @@ Signed-off-by: Thomas Lamprecht create mode 100644 pbs-restore.c diff --git a/meson.build b/meson.build -index c05c926cc3..69a0fe80ef 100644 +index 7d7e474313..dd1c5bdb4e 100644 --- a/meson.build +++ b/meson.build @@ -2749,6 +2749,10 @@ if have_tools diff --git a/debian/patches/pve/0029-PVE-Backup-Add-dirty-bitmap-tracking-for-incremental.patch b/debian/patches/pve/0029-PVE-Backup-Add-dirty-bitmap-tracking-for-incremental.patch index 90f383b..6755d9d 100644 --- a/debian/patches/pve/0029-PVE-Backup-Add-dirty-bitmap-tracking-for-incremental.patch +++ b/debian/patches/pve/0029-PVE-Backup-Add-dirty-bitmap-tracking-for-incremental.patch @@ -41,7 +41,7 @@ index 1e29681d30..3fca3ce3e9 100644 false, NULL, false, NULL, !!devlist, devlist, qdict_haskey(qdict, "speed"), speed, &error); diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index 55033530fb..27d35ab91b 100644 +index 7efcd2d641..b2b5f1298b 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -221,19 +221,42 @@ void hmp_info_backup(Monitor *mon, const QDict *qdict) diff --git a/debian/patches/pve/0030-PVE-various-PBS-fixes.patch b/debian/patches/pve/0030-PVE-various-PBS-fixes.patch index 50368ad..9ac0d4c 100644 --- a/debian/patches/pve/0030-PVE-various-PBS-fixes.patch +++ b/debian/patches/pve/0030-PVE-various-PBS-fixes.patch @@ -11,11 +11,12 @@ Signed-off-by: Stefan Reiter PVE: add zero block handling to PBS dump callback Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/monitor/block-hmp-cmds.c | 4 ++- - pve-backup.c | 57 +++++++++++++++++++++++++++------- + pve-backup.c | 59 ++++++++++++++++++++++++++-------- qapi/block-core.json | 6 ++++ - 3 files changed, 54 insertions(+), 13 deletions(-) + 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 3fca3ce3e9..69254396d5 100644 @@ -66,24 +67,17 @@ index 6cdbd40529..7527885251 100644 qemu_co_mutex_lock(&backup_state.dump_callback_mutex); // avoid deadlock if job is cancelled -@@ -147,17 +152,29 @@ pvebackup_co_dump_pbs_cb( +@@ -147,16 +152,28 @@ pvebackup_co_dump_pbs_cb( return -1; } - pbs_res = proxmox_backup_co_write_data(backup_state.pbs, di->dev_id, buf, start, size, &local_err); -- qemu_co_mutex_unlock(&backup_state.dump_callback_mutex); + uint64_t transferred = 0; + uint64_t reused = 0; + while (transferred < size) { + uint64_t left = size - transferred; + uint64_t to_transfer = left < di->block_size ? left : di->block_size; - -- if (pbs_res < 0) { -- pvebackup_propagate_error(local_err); -- return pbs_res; -- } else { -- size_t reused = (pbs_res == 0) ? size : 0; -- pvebackup_add_transfered_bytes(size, !buf ? size : 0, reused); ++ + pbs_res = proxmox_backup_co_write_data(backup_state.pbs, di->dev_id, + is_zero_block ? NULL : buf + transferred, start + transferred, + to_transfer, &local_err); @@ -96,14 +90,21 @@ index 6cdbd40529..7527885251 100644 + } + + reused += pbs_res == 0 ? to_transfer : 0; - } - -+ qemu_co_mutex_unlock(&backup_state.dump_callback_mutex); -+ pvebackup_add_transfered_bytes(size, is_zero_block ? size : 0, reused); ++ } + + qemu_co_mutex_unlock(&backup_state.dump_callback_mutex); +- +- if (pbs_res < 0) { +- pvebackup_propagate_error(local_err); +- return pbs_res; +- } else { +- size_t reused = (pbs_res == 0) ? size : 0; +- pvebackup_add_transfered_bytes(size, !buf ? size : 0, reused); +- } ++ pvebackup_add_transfered_bytes(size, is_zero_block ? size : 0, reused); + return size; } - @@ -178,6 +195,7 @@ pvebackup_co_dump_vma_cb( int ret = -1; diff --git a/debian/patches/pve/0031-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch b/debian/patches/pve/0031-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch index ce812ff..3b471ed 100644 --- a/debian/patches/pve/0031-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch +++ b/debian/patches/pve/0031-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch @@ -6,6 +6,7 @@ Subject: [PATCH] PVE: Add PBS block driver to map backup archives into VMs Signed-off-by: Stefan Reiter [error cleanups, file_open implementation] Signed-off-by: Dietmar Maurer +Signed-off-by: Thomas Lamprecht --- block/meson.build | 3 + block/pbs.c | 271 +++++++++++++++++++++++++++++++++++++++++++ @@ -307,7 +308,7 @@ index 0000000000..78dad0dcc4 + +block_init(bdrv_pbs_init); diff --git a/configure b/configure -index 9a79a004d7..7cb181b61a 100755 +index 6e308ed77f..869e97c72f 100755 --- a/configure +++ b/configure @@ -428,6 +428,7 @@ vdi=${default_feature:-yes} @@ -337,7 +338,7 @@ index 9a79a004d7..7cb181b61a 100755 crypto-afalg Linux AF_ALG crypto backend driver capstone capstone disassembler support debug-mutex mutex debugging support -@@ -4622,6 +4628,9 @@ fi +@@ -4624,6 +4630,9 @@ fi if test "$linux_aio" = "yes" ; then echo "CONFIG_LINUX_AIO=y" >> $config_host_mak fi @@ -348,7 +349,7 @@ index 9a79a004d7..7cb181b61a 100755 echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build -index 69a0fe80ef..3faec72a80 100644 +index dd1c5bdb4e..45c1f2de73 100644 --- a/meson.build +++ b/meson.build @@ -3111,6 +3111,7 @@ summary_info += {'lzfse support': liblzfse.found()} diff --git a/debian/patches/pve/0033-PVE-add-query-pbs-bitmap-info-QMP-call.patch b/debian/patches/pve/0033-PVE-add-query-pbs-bitmap-info-QMP-call.patch index 1a191da..133f4f9 100644 --- a/debian/patches/pve/0033-PVE-add-query-pbs-bitmap-info-QMP-call.patch +++ b/debian/patches/pve/0033-PVE-add-query-pbs-bitmap-info-QMP-call.patch @@ -7,6 +7,7 @@ Returns advanced information about dirty bitmaps used (or not used) for the latest PBS backup. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- monitor/hmp-cmds.c | 28 ++++++----- pve-backup.c | 117 ++++++++++++++++++++++++++++++++----------- @@ -14,7 +15,7 @@ Signed-off-by: Stefan Reiter 3 files changed, 159 insertions(+), 42 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c -index 27d35ab91b..4fe2bbb26d 100644 +index b2b5f1298b..7a449edafa 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -198,6 +198,7 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict) diff --git a/debian/patches/pve/0034-PVE-redirect-stderr-to-journal-when-daemonized.patch b/debian/patches/pve/0034-PVE-redirect-stderr-to-journal-when-daemonized.patch index 836febd..d85cc27 100644 --- a/debian/patches/pve/0034-PVE-redirect-stderr-to-journal-when-daemonized.patch +++ b/debian/patches/pve/0034-PVE-redirect-stderr-to-journal-when-daemonized.patch @@ -7,13 +7,14 @@ QEMU uses the logging for error messages usually, so LOG_ERR is most fitting. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- meson.build | 2 ++ os-posix.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build -index 3faec72a80..bae9ebe0c0 100644 +index 45c1f2de73..44071acbb7 100644 --- a/meson.build +++ b/meson.build @@ -1065,6 +1065,7 @@ keyutils = dependency('libkeyutils', required: false, diff --git a/debian/patches/pve/0035-PVE-Add-sequential-job-transaction-support.patch b/debian/patches/pve/0035-PVE-Add-sequential-job-transaction-support.patch index 4bb6f09..4e446cc 100644 --- a/debian/patches/pve/0035-PVE-Add-sequential-job-transaction-support.patch +++ b/debian/patches/pve/0035-PVE-Add-sequential-job-transaction-support.patch @@ -4,6 +4,7 @@ Date: Thu, 20 Aug 2020 14:31:59 +0200 Subject: [PATCH] PVE: Add sequential job transaction support Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- include/qemu/job.h | 12 ++++++++++++ job.c | 31 +++++++++++++++++++++++++++++++ diff --git a/debian/patches/pve/0036-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch b/debian/patches/pve/0036-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch index d7da832..c17a52f 100644 --- a/debian/patches/pve/0036-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch +++ b/debian/patches/pve/0036-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch @@ -11,9 +11,10 @@ To keep the rate-limiting and IO impact from before, we use a sequential transaction, so drives will still be backed up one after the other. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- - pve-backup.c | 167 +++++++++++++++------------------------------------ - 1 file changed, 49 insertions(+), 118 deletions(-) + pve-backup.c | 169 +++++++++++++++------------------------------------ + 1 file changed, 50 insertions(+), 119 deletions(-) diff --git a/pve-backup.c b/pve-backup.c index 22420db26a..2e628d68e4 100644 @@ -120,8 +121,22 @@ index 22420db26a..2e628d68e4 100644 proxmox_backup_abort(backup_state.pbs, "backup canceled"); } -- qemu_mutex_unlock(&backup_state.backup_mutex); -- ++ /* it's enough to cancel one job in the transaction, the rest will follow ++ * automatically */ ++ GList *bdi = g_list_first(backup_state.di_list); ++ BlockJob *cancel_job = bdi && bdi->data ? ++ ((PVEBackupDevInfo *)bdi->data)->job : ++ NULL; ++ ++ /* ref the job before releasing the mutex, just to be safe */ ++ if (cancel_job) { ++ job_ref(&cancel_job->job); ++ } ++ ++ /* job_cancel_sync may enter the job, so we need to release the ++ * backup_mutex to avoid deadlock */ + qemu_mutex_unlock(&backup_state.backup_mutex); + - for(;;) { - - BlockJob *next_job = NULL; @@ -132,29 +147,16 @@ index 22420db26a..2e628d68e4 100644 - while (l) { - PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data; - l = g_list_next(l); -+ /* it's enough to cancel one job in the transaction, the rest will follow -+ * automatically */ -+ GList *bdi = g_list_first(backup_state.di_list); -+ BlockJob *cancel_job = bdi && bdi->data ? -+ ((PVEBackupDevInfo *)bdi->data)->job : -+ NULL; - +- - BlockJob *job = lookup_active_block_job(di); - if (job != NULL) { - next_job = job; - break; - } - } -+ /* ref the job before releasing the mutex, just to be safe */ -+ if (cancel_job) { -+ job_ref(&cancel_job->job); -+ } - +- - qemu_mutex_unlock(&backup_state.backup_mutex); -+ /* job_cancel_sync may enter the job, so we need to release the -+ * backup_mutex to avoid deadlock */ -+ qemu_mutex_unlock(&backup_state.backup_mutex); - +- - if (next_job) { - AioContext *aio_context = next_job->job.aio_context; - aio_context_acquire(aio_context); diff --git a/debian/patches/pve/0037-PVE-Backup-Don-t-block-on-finishing-and-cleanup-crea.patch b/debian/patches/pve/0037-PVE-Backup-Don-t-block-on-finishing-and-cleanup-crea.patch index fa4f2ce..4ab8ac8 100644 --- a/debian/patches/pve/0037-PVE-Backup-Don-t-block-on-finishing-and-cleanup-crea.patch +++ b/debian/patches/pve/0037-PVE-Backup-Don-t-block-on-finishing-and-cleanup-crea.patch @@ -48,6 +48,7 @@ before. [0] https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg03515.html Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- pve-backup.c | 217 ++++++++++++++++++++++++++++--------------- qapi/block-core.json | 5 +- @@ -207,7 +208,7 @@ index 2e628d68e4..9c20ef3a5e 100644 - assert(!qemu_in_coroutine()); + PVEBackupDevInfo *di = opaque; + di->completed_ret = ret; -+ + + /* + * Schedule stream cleanup in async coroutine. close_image and finish might + * take a while, so we can't block on them here. This way it also doesn't @@ -232,7 +233,7 @@ index 2e628d68e4..9c20ef3a5e 100644 + aio_context_release(job_ctx); + aio_co_enter(data->ctx, data->co); +} - ++ +static void coroutine_fn pvebackup_co_cancel(void *opaque) +{ Error *cancel_err = NULL; @@ -308,13 +309,13 @@ index 2e628d68e4..9c20ef3a5e 100644 - if (!job || local_err != NULL) { - Error *create_job_err = NULL; - error_setg(&create_job_err, "backup_job_create failed: %s", -- local_err ? error_get_pretty(local_err) : "null"); + di->job = job; - -- pvebackup_propagate_error(create_job_err); ++ + if (!job || local_err) { + error_setg(errp, "backup_job_create failed: %s", -+ local_err ? error_get_pretty(local_err) : "null"); + local_err ? error_get_pretty(local_err) : "null"); +- +- pvebackup_propagate_error(create_job_err); break; } diff --git a/debian/patches/pve/0038-PVE-Migrate-dirty-bitmap-state-via-savevm.patch b/debian/patches/pve/0038-PVE-Migrate-dirty-bitmap-state-via-savevm.patch index aeacae3..b155c3d 100644 --- a/debian/patches/pve/0038-PVE-Migrate-dirty-bitmap-state-via-savevm.patch +++ b/debian/patches/pve/0038-PVE-Migrate-dirty-bitmap-state-via-savevm.patch @@ -12,6 +12,7 @@ Also add a flag to query-proxmox-support so qemu-server can determine if safe migration is possible and makes sense. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- include/migration/misc.h | 3 ++ migration/meson.build | 2 + diff --git a/debian/patches/pve/0039-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch b/debian/patches/pve/0039-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch index a2f7c41..2ea32e2 100644 --- a/debian/patches/pve/0039-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch +++ b/debian/patches/pve/0039-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch @@ -13,6 +13,7 @@ that are obviously marked as "busy", which would cause none at all to be transferred. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- migration/block-dirty-bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/pve/0040-PVE-fall-back-to-open-iscsi-initiatorname.patch b/debian/patches/pve/0040-PVE-fall-back-to-open-iscsi-initiatorname.patch index 4bb5c39..d324d7b 100644 --- a/debian/patches/pve/0040-PVE-fall-back-to-open-iscsi-initiatorname.patch +++ b/debian/patches/pve/0040-PVE-fall-back-to-open-iscsi-initiatorname.patch @@ -15,6 +15,7 @@ According to RFC 3720, an initiator name is at most 223 bytes long, so the 4 KiB buffer is big enough, even if many whitespaces are used. Signed-off-by: Fabian Ebner +Signed-off-by: Thomas Lamprecht --- block/iscsi.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/debian/patches/pve/0041-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch b/debian/patches/pve/0041-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch index eea2037..bbe964e 100644 --- a/debian/patches/pve/0041-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch +++ b/debian/patches/pve/0041-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch @@ -22,6 +22,7 @@ monitor for that coroutine ourselves, but let's just fix it the right way instead) Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/monitor/block-hmp-cmds.c | 4 +- hmp-commands.hx | 2 + @@ -53,7 +54,7 @@ index 69254396d5..b838586fc0 100644 Error *error = NULL; diff --git a/hmp-commands.hx b/hmp-commands.hx -index b18063ce19..02c8f83ca3 100644 +index 7faba36b39..dca4e58858 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -109,6 +109,7 @@ ERST diff --git a/debian/patches/pve/0042-PBS-add-master-key-support.patch b/debian/patches/pve/0042-PBS-add-master-key-support.patch index 2261362..7c30dd6 100644 --- a/debian/patches/pve/0042-PBS-add-master-key-support.patch +++ b/debian/patches/pve/0042-PBS-add-master-key-support.patch @@ -11,6 +11,7 @@ from the PVE side to avoid QMP calls with unsupported parameters. Signed-off-by: Fabian Grünbichler Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/monitor/block-hmp-cmds.c | 1 + pve-backup.c | 3 +++ diff --git a/debian/patches/pve/0043-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch b/debian/patches/pve/0043-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch index 9f2318a..b2fca41 100644 --- a/debian/patches/pve/0043-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch +++ b/debian/patches/pve/0043-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch @@ -11,6 +11,7 @@ Tracing shows the fast-path is taken almost all the time, though not 100% so the slow one is still necessary. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/pbs.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/debian/patches/pve/0044-PVE-block-stream-increase-chunk-size.patch b/debian/patches/pve/0044-PVE-block-stream-increase-chunk-size.patch index 680bc40..9bd47f7 100644 --- a/debian/patches/pve/0044-PVE-block-stream-increase-chunk-size.patch +++ b/debian/patches/pve/0044-PVE-block-stream-increase-chunk-size.patch @@ -4,6 +4,8 @@ Date: Tue, 2 Mar 2021 16:34:28 +0100 Subject: [PATCH] PVE: block/stream: increase chunk size Ceph favors bigger chunks, so increase to 4M. + +Signed-off-by: Thomas Lamprecht --- block/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/pve/0045-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch b/debian/patches/pve/0045-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch index 03c7fa5..ff3ce42 100644 --- a/debian/patches/pve/0045-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch +++ b/debian/patches/pve/0045-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch @@ -10,15 +10,17 @@ it wants to extend its passed vector. Simply check for NULL and do nothing, there's no reason to pad the target if it will be discarded anyway. + +Signed-off-by: Thomas Lamprecht --- block/io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/io.c b/block/io.c -index a19942718b..9fa8252258 100644 +index f38e7f81d8..28c3a712b6 100644 --- a/block/io.c +++ b/block/io.c -@@ -1763,6 +1763,10 @@ static int bdrv_pad_request(BlockDriverState *bs, +@@ -1764,6 +1764,10 @@ static int bdrv_pad_request(BlockDriverState *bs, { int ret; diff --git a/debian/patches/pve/0046-block-add-alloc-track-driver.patch b/debian/patches/pve/0046-block-add-alloc-track-driver.patch index 21a182c..15af532 100644 --- a/debian/patches/pve/0046-block-add-alloc-track-driver.patch +++ b/debian/patches/pve/0046-block-add-alloc-track-driver.patch @@ -23,6 +23,7 @@ If 'auto-remove' is set, alloc-track will automatically detach itself once the backing image is removed. It will be replaced by 'file'. Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- block/alloc-track.c | 345 ++++++++++++++++++++++++++++++++++++++++++++ block/meson.build | 1 + diff --git a/debian/patches/pve/0047-PVE-whitelist-invalid-QAPI-names-for-backwards-compa.patch b/debian/patches/pve/0047-PVE-whitelist-invalid-QAPI-names-for-backwards-compa.patch index 19f4326..ced1323 100644 --- a/debian/patches/pve/0047-PVE-whitelist-invalid-QAPI-names-for-backwards-compa.patch +++ b/debian/patches/pve/0047-PVE-whitelist-invalid-QAPI-names-for-backwards-compa.patch @@ -4,6 +4,7 @@ Date: Wed, 26 May 2021 15:26:30 +0200 Subject: [PATCH] PVE: whitelist 'invalid' QAPI names for backwards compat Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- qapi/pragma.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/patches/pve/0048-PVE-savevm-async-register-yank-before-migration_inco.patch b/debian/patches/pve/0048-PVE-savevm-async-register-yank-before-migration_inco.patch index af7fc97..1359424 100644 --- a/debian/patches/pve/0048-PVE-savevm-async-register-yank-before-migration_inco.patch +++ b/debian/patches/pve/0048-PVE-savevm-async-register-yank-before-migration_inco.patch @@ -5,6 +5,7 @@ Subject: [PATCH] PVE: savevm-async: register yank before migration_incoming_state_destroy Signed-off-by: Stefan Reiter +Signed-off-by: Thomas Lamprecht --- migration/savevm-async.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/patches/series b/debian/patches/series index d953c4f..f2a3518 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,11 +1,7 @@ -extra/0001-qemu-sockets-fix-unix-socket-path-copy-again.patch -extra/0002-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch -extra/0003-monitor-hmp-add-support-for-flag-argument-with-value.patch -extra/0004-monitor-refactor-set-expire_password-and-allow-VNC-d.patch -extra/0005-monitor-hmp-correctly-invert-password-argument-detec.patch -extra/0006-qxl-fix-pre-save-logic.patch -extra/0007-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch -extra/0008-block-introduce-max_hw_iov-for-use-in-scsi-generic.patch +extra/0001-monitor-qmp-fix-race-with-clients-disconnecting-earl.patch +extra/0002-monitor-hmp-add-support-for-flag-argument-with-value.patch +extra/0003-monitor-refactor-set-expire_password-and-allow-VNC-d.patch +extra/0004-block-mirror-fix-NULL-pointer-dereference-in-mirror_.patch bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch diff --git a/qemu b/qemu index f9baca5..54e1f5b 160000 --- a/qemu +++ b/qemu @@ -1 +1 @@ -Subproject commit f9baca549e44791be0dd98de15add3d8452a8af0 +Subproject commit 54e1f5be86dd11744e45da8be6afad01d01d59e7