[pve-devel] [PATCH qemu 1/4] Update and rebase to QEMU 4.1
Stefan Reiter
s.reiter at proxmox.com
Wed Nov 20 15:45:35 CET 2019
Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
I tested 4.1.0 seperately to 4.1.1 for a while, so I left the patches in the
order I did them (i.e. 4.1 rebase first, then rebase that to 4.1.1). Patches 1-3
could technically be squashed together into a single 4.1.1 rebase.
Tested with backups/restores, snapshots, migration, different guest OS,
different storage front- and backends. Been using 4.1.0 for a bit now, no issues
on my machine so far (except for the one mentioned in patch 4). 4.1.1 seems
stable as well, but not as much time spent with it.
...sume-monitor-when-clearing-its-queue.patch | 53 ++-----
...k-file-change-locking-default-to-off.patch | 6 +-
...he-CPU-model-to-kvm64-32-instead-of-.patch | 4 +-
...ui-spice-default-to-pve-certificates.patch | 4 +-
.../0005-PVE-Config-smm_available-false.patch | 4 +-
...erfs-no-default-logfile-if-daemonize.patch | 8 +-
...lock-rbd-disable-rbd_cache_writethro.patch | 4 +-
.../0008-PVE-Up-qmp-add-get_link_status.patch | 8 +-
...PVE-Up-glusterfs-allow-partial-reads.patch | 14 +-
...return-success-on-info-without-snaps.patch | 4 +-
...dd-add-osize-and-read-from-to-stdin-.patch | 18 +--
...E-Up-qemu-img-dd-add-isize-parameter.patch | 12 +-
...PVE-Up-qemu-img-dd-add-n-skip_create.patch | 10 +-
...virtio-balloon-improve-query-balloon.patch | 90 +++++------
.../0015-PVE-qapi-modify-query-machines.patch | 52 +++----
.../0016-PVE-qapi-modify-spice-query.patch | 4 +-
.../0017-PVE-internal-snapshot-async.patch | 112 +++++++-------
...add-the-zeroinit-block-driver-filter.patch | 11 +-
.../pve/0019-PVE-backup-modify-job-api.patch | 26 ++--
...-backup-introduce-vma-archive-format.patch | 123 +++++++--------
...-PVE-Deprecated-adding-old-vma-files.patch | 144 ++++++++----------
...-Add-dummy-id-command-line-parameter.patch | 10 +-
...t-target-i386-disable-LINT0-after-re.patch | 4 +-
...le-posix-make-locking-optiono-on-cre.patch | 20 +--
...0-PVE-monitor-disable-oob-capability.patch | 32 ++--
...ackup-related-code-inside-coroutines.patch | 46 +++---
...-CoMutex-to-protect-access-to-backup.patch | 46 +++---
...ob_create-pass-cluster-size-for-dump.patch | 30 ++--
...mp_cb-with-NULL-data-pointer-for-sma.patch | 16 +-
..._to_vma-into-pvebackup_co_add_config.patch | 10 +-
...up_co_dump_cb-do-not-call-job-cancel.patch | 4 +-
.../pve/0039-fix-backup-job-completion.patch | 6 +-
...te_cb-avoid-poll-loop-if-already-ins.patch | 6 +-
...consider-source-cluster-size-as-well.patch | 4 +-
qemu | 2 +-
35 files changed, 456 insertions(+), 491 deletions(-)
diff --git a/debian/patches/extra/0001-monitor-qmp-resume-monitor-when-clearing-its-queue.patch b/debian/patches/extra/0001-monitor-qmp-resume-monitor-when-clearing-its-queue.patch
index 968219d..d07c251 100644
--- a/debian/patches/extra/0001-monitor-qmp-resume-monitor-when-clearing-its-queue.patch
+++ b/debian/patches/extra/0001-monitor-qmp-resume-monitor-when-clearing-its-queue.patch
@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumiller at proxmox.com>
-Date: Wed, 2 Oct 2019 09:41:34 +0200
+Date: Wed, 2 Oct 2019 10:30:03 +0200
Subject: [PATCH] monitor/qmp: resume monitor when clearing its queue
When a monitor's queue is filled up in handle_qmp_command()
it gets suspended. It's the dispatcher bh's job currently to
-resume the monitor, which it does after processing an even
+resume the monitor, which it does after processing an event
from the queue. However, it is possible for a
CHR_EVENT_CLOSED event to be processed before before the bh
is scheduled, which will clear the queue without resuming
@@ -16,30 +16,21 @@ was filled up.
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
- monitor.c | 21 ++++++++++++++++-----
- 1 file changed, 16 insertions(+), 5 deletions(-)
+ monitor/qmp.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-diff --git a/monitor.c b/monitor.c
-index 4807bbe811..daadbcdede 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -356,12 +356,28 @@ static void qmp_request_free(QMPRequest *req)
- g_free(req);
- }
-
-+static bool qmp_oob_enabled(Monitor *mon)
-+{
-+ return mon->qmp.capab[QMP_CAPABILITY_OOB];
-+}
-+
+diff --git a/monitor/qmp.c b/monitor/qmp.c
+index e1b196217d..fb3e66c62a 100644
+--- a/monitor/qmp.c
++++ b/monitor/qmp.c
+@@ -70,9 +70,19 @@ static void qmp_request_free(QMPRequest *req)
/* Caller must hold mon->qmp.qmp_queue_lock */
- static void monitor_qmp_cleanup_req_queue_locked(Monitor *mon)
+ static void monitor_qmp_cleanup_req_queue_locked(MonitorQMP *mon)
{
-+ bool need_resume =
-+ (!qmp_oob_enabled(mon) && mon->qmp.qmp_requests->length > 0)
-+ || mon->qmp.qmp_requests->length == QMP_REQ_QUEUE_LEN_MAX;
- while (!g_queue_is_empty(mon->qmp.qmp_requests)) {
- qmp_request_free(g_queue_pop_head(mon->qmp.qmp_requests));
++ bool need_resume = (!qmp_oob_enabled(mon) && mon->qmp_requests->length > 0)
++ || mon->qmp_requests->length == QMP_REQ_QUEUE_LEN_MAX;
+ while (!g_queue_is_empty(mon->qmp_requests)) {
+ qmp_request_free(g_queue_pop_head(mon->qmp_requests));
}
+ if (need_resume) {
+ /*
@@ -47,20 +38,8 @@ index 4807bbe811..daadbcdede 100644
+ * queue gets cleared from a CH_EVENT_CLOSED event before the dispatch
+ * bh got scheduled.
+ */
-+ monitor_resume(mon);
++ monitor_resume(&mon->common);
+ }
}
- static void monitor_qmp_cleanup_queues(Monitor *mon)
-@@ -1157,11 +1173,6 @@ static void monitor_init_qmp_commands(void)
- qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG);
- }
-
--static bool qmp_oob_enabled(Monitor *mon)
--{
-- return mon->qmp.capab[QMP_CAPABILITY_OOB];
--}
--
- static void monitor_qmp_caps_reset(Monitor *mon)
- {
- memset(mon->qmp.capab_offered, 0, sizeof(mon->qmp.capab_offered));
+ static void monitor_qmp_cleanup_queues(MonitorQMP *mon)
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 329ad7c..06fdeee 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,10 +14,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
-index c185f34a2e..0613f59c7b 100644
+index 4479cc7ab4..760648b78c 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
-@@ -428,7 +428,7 @@ static QemuOptsList raw_runtime_opts = {
+@@ -430,7 +430,7 @@ static QemuOptsList raw_runtime_opts = {
{
.name = "locking",
.type = QEMU_OPT_STRING,
@@ -26,7 +26,7 @@ index c185f34a2e..0613f59c7b 100644
},
{
.name = "pr-manager",
-@@ -517,7 +517,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
+@@ -519,7 +519,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
s->use_lock = false;
break;
case ON_OFF_AUTO_AUTO:
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 608b25d..45decdf 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 <t.lamprecht at proxmox.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
-index 83fb522554..154a443071 100644
+index 8b3dc5533e..1fea162e02 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
-@@ -1720,9 +1720,9 @@ uint64_t cpu_get_tsc(CPUX86State *env);
+@@ -1725,9 +1725,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/0004-PVE-Config-ui-spice-default-to-pve-certificates.patch b/debian/patches/pve/0004-PVE-Config-ui-spice-default-to-pve-certificates.patch
index 5889a8a..8f76010 100644
--- a/debian/patches/pve/0004-PVE-Config-ui-spice-default-to-pve-certificates.patch
+++ b/debian/patches/pve/0004-PVE-Config-ui-spice-default-to-pve-certificates.patch
@@ -9,10 +9,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
-index 0632c74e9f..5593dfcb06 100644
+index 2ffc3335f0..c95bbd6c77 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
-@@ -667,32 +667,35 @@ void qemu_spice_init(void)
+@@ -668,32 +668,35 @@ void qemu_spice_init(void)
if (tls_port) {
x509_dir = qemu_opt_get(opts, "x509-dir");
diff --git a/debian/patches/pve/0005-PVE-Config-smm_available-false.patch b/debian/patches/pve/0005-PVE-Config-smm_available-false.patch
index 388648a..0ca5984 100644
--- a/debian/patches/pve/0005-PVE-Config-smm_available-false.patch
+++ b/debian/patches/pve/0005-PVE-Config-smm_available-false.patch
@@ -10,10 +10,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
-index d98b737b8f..62ab2158f2 100644
+index 549c437050..66576b533e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
-@@ -2533,7 +2533,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
+@@ -2715,7 +2715,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
if (tcg_enabled() || qtest_enabled()) {
smm_available = true;
} else if (kvm_enabled()) {
diff --git a/debian/patches/pve/0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch b/debian/patches/pve/0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
index 9cb329d..f3c098b 100644
--- a/debian/patches/pve/0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
+++ b/debian/patches/pve/0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
@@ -9,10 +9,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/block/gluster.c b/block/gluster.c
-index e664ca4462..70c59db107 100644
+index f64dc5b01e..061cab48c0 100644
--- a/block/gluster.c
+++ b/block/gluster.c
-@@ -41,7 +41,7 @@
+@@ -42,7 +42,7 @@
#define GLUSTER_DEBUG_DEFAULT 4
#define GLUSTER_DEBUG_MAX 9
#define GLUSTER_OPT_LOGFILE "logfile"
@@ -21,7 +21,7 @@ index e664ca4462..70c59db107 100644
/*
* Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer size
* is greater or equal to 1024 MiB, so we are limiting the transfer size to 512
-@@ -416,6 +416,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
+@@ -424,6 +424,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
int old_errno;
SocketAddressList *server;
unsigned long long port;
@@ -29,7 +29,7 @@ index e664ca4462..70c59db107 100644
glfs = glfs_find_preopened(gconf->volume);
if (glfs) {
-@@ -458,9 +459,15 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
+@@ -466,9 +467,15 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
}
}
diff --git a/debian/patches/pve/0007-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch b/debian/patches/pve/0007-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch
index fc1f900..ca452d8 100644
--- a/debian/patches/pve/0007-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch
+++ b/debian/patches/pve/0007-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch
@@ -18,10 +18,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 2 insertions(+)
diff --git a/block/rbd.c b/block/rbd.c
-index 0c549c9935..7f7a5d4c35 100644
+index 59757b3120..d00c9d2d12 100644
--- a/block/rbd.c
+++ b/block/rbd.c
-@@ -634,6 +634,8 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
+@@ -636,6 +636,8 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
rados_conf_set(*cluster, "rbd_cache", "false");
}
diff --git a/debian/patches/pve/0008-PVE-Up-qmp-add-get_link_status.patch b/debian/patches/pve/0008-PVE-Up-qmp-add-get_link_status.patch
index a8bc4fa..ab31e94 100644
--- a/debian/patches/pve/0008-PVE-Up-qmp-add-get_link_status.patch
+++ b/debian/patches/pve/0008-PVE-Up-qmp-add-get_link_status.patch
@@ -11,10 +11,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
3 files changed, 43 insertions(+)
diff --git a/net/net.c b/net/net.c
-index f3a3c5444c..1023cff921 100644
+index 7d4098254f..c6d5e66bfc 100644
--- a/net/net.c
+++ b/net/net.c
-@@ -1346,6 +1346,33 @@ void hmp_info_network(Monitor *mon, const QDict *qdict)
+@@ -1347,6 +1347,33 @@ void hmp_info_network(Monitor *mon, const QDict *qdict)
}
}
@@ -49,7 +49,7 @@ index f3a3c5444c..1023cff921 100644
{
NetClientState *nc;
diff --git a/qapi/net.json b/qapi/net.json
-index 5f7bff1637..5991d1e5b8 100644
+index 728990f4fb..d53c66320b 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -34,6 +34,21 @@
@@ -75,7 +75,7 @@ index 5f7bff1637..5991d1e5b8 100644
# @netdev_add:
#
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
-index 4bd1223637..d8facba0a2 100644
+index 38af54d6b3..d6a4177935 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -61,6 +61,7 @@
diff --git a/debian/patches/pve/0009-PVE-Up-glusterfs-allow-partial-reads.patch b/debian/patches/pve/0009-PVE-Up-glusterfs-allow-partial-reads.patch
index a48dc42..4da3e7f 100644
--- a/debian/patches/pve/0009-PVE-Up-glusterfs-allow-partial-reads.patch
+++ b/debian/patches/pve/0009-PVE-Up-glusterfs-allow-partial-reads.patch
@@ -16,10 +16,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/block/gluster.c b/block/gluster.c
-index 70c59db107..e8e2739b53 100644
+index 061cab48c0..0ed1ec5856 100644
--- a/block/gluster.c
+++ b/block/gluster.c
-@@ -56,6 +56,7 @@ typedef struct GlusterAIOCB {
+@@ -57,6 +57,7 @@ typedef struct GlusterAIOCB {
int ret;
Coroutine *coroutine;
AioContext *aio_context;
@@ -27,7 +27,7 @@ index 70c59db107..e8e2739b53 100644
} GlusterAIOCB;
typedef struct BDRVGlusterState {
-@@ -755,8 +756,10 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret,
+@@ -763,8 +764,10 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret,
acb->ret = 0; /* Success */
} else if (ret < 0) {
acb->ret = -errno; /* Read/Write failed */
@@ -39,7 +39,7 @@ index 70c59db107..e8e2739b53 100644
}
aio_co_schedule(acb->aio_context, acb->coroutine);
-@@ -1017,6 +1020,7 @@ static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs,
+@@ -1035,6 +1038,7 @@ static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs,
acb.ret = 0;
acb.coroutine = qemu_coroutine_self();
acb.aio_context = bdrv_get_aio_context(bs);
@@ -47,7 +47,7 @@ index 70c59db107..e8e2739b53 100644
ret = glfs_zerofill_async(s->fd, offset, size, gluster_finish_aiocb, &acb);
if (ret < 0) {
-@@ -1197,9 +1201,11 @@ static coroutine_fn int qemu_gluster_co_rw(BlockDriverState *bs,
+@@ -1215,9 +1219,11 @@ static coroutine_fn int qemu_gluster_co_rw(BlockDriverState *bs,
acb.aio_context = bdrv_get_aio_context(bs);
if (write) {
@@ -59,7 +59,7 @@ index 70c59db107..e8e2739b53 100644
ret = glfs_preadv_async(s->fd, qiov->iov, qiov->niov, offset, 0,
gluster_finish_aiocb, &acb);
}
-@@ -1261,6 +1267,7 @@ static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
+@@ -1279,6 +1285,7 @@ static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
acb.ret = 0;
acb.coroutine = qemu_coroutine_self();
acb.aio_context = bdrv_get_aio_context(bs);
@@ -67,7 +67,7 @@ index 70c59db107..e8e2739b53 100644
ret = glfs_fsync_async(s->fd, gluster_finish_aiocb, &acb);
if (ret < 0) {
-@@ -1307,6 +1314,7 @@ static coroutine_fn int qemu_gluster_co_pdiscard(BlockDriverState *bs,
+@@ -1325,6 +1332,7 @@ static coroutine_fn int qemu_gluster_co_pdiscard(BlockDriverState *bs,
acb.ret = 0;
acb.coroutine = qemu_coroutine_self();
acb.aio_context = bdrv_get_aio_context(bs);
diff --git a/debian/patches/pve/0010-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch b/debian/patches/pve/0010-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch
index d4c4e2f..cabac20 100644
--- a/debian/patches/pve/0010-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch
+++ b/debian/patches/pve/0010-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch
@@ -9,10 +9,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
-index aa6f81f1ea..4546198471 100644
+index 79983772de..c64f260876 100644
--- a/qemu-img.c
+++ b/qemu-img.c
-@@ -2717,7 +2717,8 @@ static int img_info(int argc, char **argv)
+@@ -2773,7 +2773,8 @@ static int img_info(int argc, char **argv)
list = collect_image_info_list(image_opts, filename, fmt, chain,
force_share);
if (!list) {
diff --git a/debian/patches/pve/0011-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch b/debian/patches/pve/0011-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch
index 87037da..0c5a9c0 100644
--- a/debian/patches/pve/0011-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch
+++ b/debian/patches/pve/0011-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch
@@ -37,7 +37,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
2 files changed, 122 insertions(+), 74 deletions(-)
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
-index 4b47f7495d..db1df8f60b 100644
+index 1c93e6d185..8094abb3ee 100644
--- a/qemu-img-cmds.hx
+++ b/qemu-img-cmds.hx
@@ -56,9 +56,9 @@ STEXI
@@ -53,10 +53,10 @@ index 4b47f7495d..db1df8f60b 100644
DEF("info", img_info,
diff --git a/qemu-img.c b/qemu-img.c
-index 4546198471..6e1a3b8933 100644
+index c64f260876..8129677d7a 100644
--- a/qemu-img.c
+++ b/qemu-img.c
-@@ -4313,10 +4313,12 @@ out:
+@@ -4413,10 +4413,12 @@ out:
#define C_IF 04
#define C_OF 010
#define C_SKIP 020
@@ -69,7 +69,7 @@ index 4546198471..6e1a3b8933 100644
};
struct DdIo {
-@@ -4395,6 +4397,20 @@ static int img_dd_skip(const char *arg,
+@@ -4495,6 +4497,20 @@ static int img_dd_skip(const char *arg,
return 0;
}
@@ -90,7 +90,7 @@ index 4546198471..6e1a3b8933 100644
static int img_dd(int argc, char **argv)
{
int ret = 0;
-@@ -4435,6 +4451,7 @@ static int img_dd(int argc, char **argv)
+@@ -4535,6 +4551,7 @@ static int img_dd(int argc, char **argv)
{ "if", img_dd_if, C_IF },
{ "of", img_dd_of, C_OF },
{ "skip", img_dd_skip, C_SKIP },
@@ -98,7 +98,7 @@ index 4546198471..6e1a3b8933 100644
{ NULL, NULL, 0 }
};
const struct option long_options[] = {
-@@ -4513,8 +4530,13 @@ static int img_dd(int argc, char **argv)
+@@ -4613,8 +4630,13 @@ static int img_dd(int argc, char **argv)
arg = NULL;
}
@@ -114,7 +114,7 @@ index 4546198471..6e1a3b8933 100644
ret = -1;
goto out;
}
-@@ -4526,85 +4548,101 @@ static int img_dd(int argc, char **argv)
+@@ -4626,85 +4648,101 @@ static int img_dd(int argc, char **argv)
goto out;
}
@@ -280,7 +280,7 @@ index 4546198471..6e1a3b8933 100644
}
if (dd.flags & C_SKIP && (in.offset > INT64_MAX / in.bsz ||
-@@ -4622,11 +4660,17 @@ static int img_dd(int argc, char **argv)
+@@ -4722,11 +4760,17 @@ static int img_dd(int argc, char **argv)
for (out_pos = 0; in_pos < size; block_count++) {
int in_ret, out_ret;
@@ -302,7 +302,7 @@ index 4546198471..6e1a3b8933 100644
}
if (in_ret < 0) {
error_report("error while reading from input image file: %s",
-@@ -4636,9 +4680,13 @@ static int img_dd(int argc, char **argv)
+@@ -4736,9 +4780,13 @@ static int img_dd(int argc, char **argv)
}
in_pos += in_ret;
diff --git a/debian/patches/pve/0012-PVE-Up-qemu-img-dd-add-isize-parameter.patch b/debian/patches/pve/0012-PVE-Up-qemu-img-dd-add-isize-parameter.patch
index 1532c20..dfd592f 100644
--- a/debian/patches/pve/0012-PVE-Up-qemu-img-dd-add-isize-parameter.patch
+++ b/debian/patches/pve/0012-PVE-Up-qemu-img-dd-add-isize-parameter.patch
@@ -15,10 +15,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
-index 6e1a3b8933..6a76897c01 100644
+index 8129677d7a..1b7f211368 100644
--- a/qemu-img.c
+++ b/qemu-img.c
-@@ -4314,11 +4314,13 @@ out:
+@@ -4414,11 +4414,13 @@ out:
#define C_OF 010
#define C_SKIP 020
#define C_OSIZE 040
@@ -32,7 +32,7 @@ index 6e1a3b8933..6a76897c01 100644
};
struct DdIo {
-@@ -4411,6 +4413,20 @@ static int img_dd_osize(const char *arg,
+@@ -4511,6 +4513,20 @@ static int img_dd_osize(const char *arg,
return 0;
}
@@ -53,7 +53,7 @@ index 6e1a3b8933..6a76897c01 100644
static int img_dd(int argc, char **argv)
{
int ret = 0;
-@@ -4425,12 +4441,14 @@ static int img_dd(int argc, char **argv)
+@@ -4525,12 +4541,14 @@ static int img_dd(int argc, char **argv)
int c, i;
const char *out_fmt = "raw";
const char *fmt = NULL;
@@ -69,7 +69,7 @@ index 6e1a3b8933..6a76897c01 100644
};
struct DdIo in = {
.bsz = 512, /* Block size is by default 512 bytes */
-@@ -4452,6 +4470,7 @@ static int img_dd(int argc, char **argv)
+@@ -4552,6 +4570,7 @@ static int img_dd(int argc, char **argv)
{ "of", img_dd_of, C_OF },
{ "skip", img_dd_skip, C_SKIP },
{ "osize", img_dd_osize, C_OSIZE },
@@ -77,7 +77,7 @@ index 6e1a3b8933..6a76897c01 100644
{ NULL, NULL, 0 }
};
const struct option long_options[] = {
-@@ -4658,14 +4677,18 @@ static int img_dd(int argc, char **argv)
+@@ -4758,14 +4777,18 @@ static int img_dd(int argc, char **argv)
in.buf = g_new(uint8_t, in.bsz);
diff --git a/debian/patches/pve/0013-PVE-Up-qemu-img-dd-add-n-skip_create.patch b/debian/patches/pve/0013-PVE-Up-qemu-img-dd-add-n-skip_create.patch
index 09633bf..0fc237d 100644
--- a/debian/patches/pve/0013-PVE-Up-qemu-img-dd-add-n-skip_create.patch
+++ b/debian/patches/pve/0013-PVE-Up-qemu-img-dd-add-n-skip_create.patch
@@ -9,10 +9,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
-index 6a76897c01..506ae959af 100644
+index 1b7f211368..e14d2370c4 100644
--- a/qemu-img.c
+++ b/qemu-img.c
-@@ -4443,7 +4443,7 @@ static int img_dd(int argc, char **argv)
+@@ -4543,7 +4543,7 @@ static int img_dd(int argc, char **argv)
const char *fmt = NULL;
int64_t size = 0, readsize = 0;
int64_t block_count = 0, out_pos, in_pos;
@@ -21,7 +21,7 @@ index 6a76897c01..506ae959af 100644
struct DdInfo dd = {
.flags = 0,
.count = 0,
-@@ -4481,7 +4481,7 @@ static int img_dd(int argc, char **argv)
+@@ -4581,7 +4581,7 @@ static int img_dd(int argc, char **argv)
{ 0, 0, 0, 0 }
};
@@ -30,7 +30,7 @@ index 6a76897c01..506ae959af 100644
if (c == EOF) {
break;
}
-@@ -4501,6 +4501,9 @@ static int img_dd(int argc, char **argv)
+@@ -4601,6 +4601,9 @@ static int img_dd(int argc, char **argv)
case 'h':
help();
break;
@@ -40,7 +40,7 @@ index 6a76897c01..506ae959af 100644
case 'U':
force_share = true;
break;
-@@ -4641,13 +4644,15 @@ static int img_dd(int argc, char **argv)
+@@ -4741,13 +4744,15 @@ static int img_dd(int argc, char **argv)
size - in.bsz * in.offset, &error_abort);
}
diff --git a/debian/patches/pve/0014-PVE-virtio-balloon-improve-query-balloon.patch b/debian/patches/pve/0014-PVE-virtio-balloon-improve-query-balloon.patch
index 8f6470a..baf8764 100644
--- a/debian/patches/pve/0014-PVE-virtio-balloon-improve-query-balloon.patch
+++ b/debian/patches/pve/0014-PVE-virtio-balloon-improve-query-balloon.patch
@@ -8,54 +8,13 @@ command.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
- hmp.c | 30 +++++++++++++++++++++++++++++-
hw/virtio/virtio-balloon.c | 33 +++++++++++++++++++++++++++++++--
+ monitor/hmp-cmds.c | 30 +++++++++++++++++++++++++++++-
qapi/misc.json | 22 +++++++++++++++++++++-
3 files changed, 81 insertions(+), 4 deletions(-)
-diff --git a/hmp.c b/hmp.c
-index 8eec768088..25fe18cbcf 100644
---- a/hmp.c
-+++ b/hmp.c
-@@ -863,7 +863,35 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
- return;
- }
-
-- monitor_printf(mon, "balloon: actual=%" PRId64 "\n", info->actual >> 20);
-+ monitor_printf(mon, "balloon: actual=%" PRId64, info->actual >> 20);
-+ monitor_printf(mon, " max_mem=%" PRId64, info->max_mem >> 20);
-+ if (info->has_total_mem) {
-+ monitor_printf(mon, " total_mem=%" PRId64, info->total_mem >> 20);
-+ }
-+ if (info->has_free_mem) {
-+ monitor_printf(mon, " free_mem=%" PRId64, info->free_mem >> 20);
-+ }
-+
-+ if (info->has_mem_swapped_in) {
-+ monitor_printf(mon, " mem_swapped_in=%" PRId64, info->mem_swapped_in);
-+ }
-+ if (info->has_mem_swapped_out) {
-+ monitor_printf(mon, " mem_swapped_out=%" PRId64, info->mem_swapped_out);
-+ }
-+ if (info->has_major_page_faults) {
-+ monitor_printf(mon, " major_page_faults=%" PRId64,
-+ info->major_page_faults);
-+ }
-+ if (info->has_minor_page_faults) {
-+ monitor_printf(mon, " minor_page_faults=%" PRId64,
-+ info->minor_page_faults);
-+ }
-+ if (info->has_last_update) {
-+ monitor_printf(mon, " last_update=%" PRId64,
-+ info->last_update);
-+ }
-+
-+ monitor_printf(mon, "\n");
-
- qapi_free_BalloonInfo(info);
- }
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
-index adde97fe4b..e7f91a3cec 100644
+index 25de154307..7c09716035 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -712,8 +712,37 @@ static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f,
@@ -98,11 +57,52 @@ index adde97fe4b..e7f91a3cec 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 5ca3ebe942..1b32c59329 100644
+--- a/monitor/hmp-cmds.c
++++ b/monitor/hmp-cmds.c
+@@ -870,7 +870,35 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
+ return;
+ }
+
+- monitor_printf(mon, "balloon: actual=%" PRId64 "\n", info->actual >> 20);
++ monitor_printf(mon, "balloon: actual=%" PRId64, info->actual >> 20);
++ monitor_printf(mon, " max_mem=%" PRId64, info->max_mem >> 20);
++ if (info->has_total_mem) {
++ monitor_printf(mon, " total_mem=%" PRId64, info->total_mem >> 20);
++ }
++ if (info->has_free_mem) {
++ monitor_printf(mon, " free_mem=%" PRId64, info->free_mem >> 20);
++ }
++
++ if (info->has_mem_swapped_in) {
++ monitor_printf(mon, " mem_swapped_in=%" PRId64, info->mem_swapped_in);
++ }
++ if (info->has_mem_swapped_out) {
++ monitor_printf(mon, " mem_swapped_out=%" PRId64, info->mem_swapped_out);
++ }
++ if (info->has_major_page_faults) {
++ monitor_printf(mon, " major_page_faults=%" PRId64,
++ info->major_page_faults);
++ }
++ if (info->has_minor_page_faults) {
++ monitor_printf(mon, " minor_page_faults=%" PRId64,
++ info->minor_page_faults);
++ }
++ if (info->has_last_update) {
++ monitor_printf(mon, " last_update=%" PRId64,
++ info->last_update);
++ }
++
++ monitor_printf(mon, "\n");
+
+ qapi_free_BalloonInfo(info);
+ }
diff --git a/qapi/misc.json b/qapi/misc.json
-index 8b3ca4fdd3..c98bb4b559 100644
+index a7fba7230c..2445c950cc 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
-@@ -682,10 +682,30 @@
+@@ -408,10 +408,30 @@
#
# @actual: the number of bytes the balloon currently contains
#
diff --git a/debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch b/debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
index d040879..6f75ce6 100644
--- a/debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
+++ b/debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
@@ -7,15 +7,31 @@ provide '*is-current' in MachineInfo struct
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
- qapi/misc.json | 4 +++-
- vl.c | 5 +++++
+ hw/core/machine-qmp-cmds.c | 5 +++++
+ qapi/machine.json | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
-diff --git a/qapi/misc.json b/qapi/misc.json
-index c98bb4b559..4a0e26720e 100644
---- a/qapi/misc.json
-+++ b/qapi/misc.json
-@@ -2033,6 +2033,8 @@
+diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
+index 5bd95b8ab0..fd68f9baf8 100644
+--- a/hw/core/machine-qmp-cmds.c
++++ b/hw/core/machine-qmp-cmds.c
+@@ -229,6 +229,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
+ info->numa_mem_supported = mc->numa_mem_supported;
+ info->deprecated = !!mc->deprecation_reason;
+
++ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
++ info->has_is_current = true;
++ info->is_current = true;
++ }
++
+ entry = g_malloc0(sizeof(*entry));
+ entry->value = info;
+ entry->next = mach_list;
+diff --git a/qapi/machine.json b/qapi/machine.json
+index 6db8a7e2ec..7b82c5f7f5 100644
+--- a/qapi/machine.json
++++ b/qapi/machine.json
+@@ -313,6 +313,8 @@
#
# @is-default: whether the machine is default
#
@@ -24,28 +40,12 @@ index c98bb4b559..4a0e26720e 100644
# @cpu-max: maximum number of CPUs supported by the machine type
# (since 1.5.0)
#
-@@ -2042,7 +2044,7 @@
+@@ -329,7 +331,7 @@
##
{ 'struct': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
- '*is-default': 'bool', 'cpu-max': 'int',
+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
- 'hotpluggable-cpus': 'bool'} }
+ 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
+ 'deprecated': 'bool' } }
- ##
-diff --git a/vl.c b/vl.c
-index c3dee09c9b..98efed1a79 100644
---- a/vl.c
-+++ b/vl.c
-@@ -1531,6 +1531,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
- info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
- info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
-
-+ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
-+ info->has_is_current = true;
-+ info->is_current = true;
-+ }
-+
- entry = g_malloc0(sizeof(*entry));
- entry->value = info;
- entry->next = mach_list;
diff --git a/debian/patches/pve/0016-PVE-qapi-modify-spice-query.patch b/debian/patches/pve/0016-PVE-qapi-modify-spice-query.patch
index d5938ff..71a3c90 100644
--- a/debian/patches/pve/0016-PVE-qapi-modify-spice-query.patch
+++ b/debian/patches/pve/0016-PVE-qapi-modify-spice-query.patch
@@ -31,10 +31,10 @@ index 59e412139a..bcd781a1b9 100644
'if': 'defined(CONFIG_SPICE)' }
diff --git a/ui/spice-core.c b/ui/spice-core.c
-index 5593dfcb06..bd80c18210 100644
+index c95bbd6c77..ccba92a6ed 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
-@@ -538,6 +538,11 @@ SpiceInfo *qmp_query_spice(Error **errp)
+@@ -539,6 +539,11 @@ SpiceInfo *qmp_query_spice(Error **errp)
micro = SPICE_SERVER_VERSION & 0xff;
info->compiled_version = g_strdup_printf("%d.%d.%d", major, minor, micro);
diff --git a/debian/patches/pve/0017-PVE-internal-snapshot-async.patch b/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
index e941912..93fef3b 100644
--- a/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
+++ b/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
@@ -8,9 +8,9 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Makefile.objs | 1 +
hmp-commands-info.hx | 13 +
hmp-commands.hx | 32 +++
- hmp.c | 57 +++++
- hmp.h | 5 +
include/migration/snapshot.h | 1 +
+ include/monitor/hmp.h | 5 +
+ monitor/hmp-cmds.c | 57 +++++
qapi/migration.json | 34 +++
qapi/misc.json | 32 +++
qemu-options.hx | 13 +
@@ -20,13 +20,13 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
create mode 100644 savevm-async.c
diff --git a/Makefile.objs b/Makefile.objs
-index cf065de5ed..559486973a 100644
+index 6a143dcd57..21dd93b58c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
-@@ -46,6 +46,7 @@ ifeq ($(CONFIG_SOFTMMU),y)
- common-obj-y = blockdev.o blockdev-nbd.o block/
- common-obj-y += bootdevice.o iothread.o
+@@ -48,6 +48,7 @@ common-obj-y += bootdevice.o iothread.o
+ common-obj-y += dump/
common-obj-y += job-qmp.o
+ common-obj-y += monitor/
+common-obj-y += savevm-async.o
common-obj-y += net/
common-obj-y += qdev-monitor.o device-hotplug.o
@@ -56,10 +56,10 @@ index c59444c461..444bd8e43d 100644
{
diff --git a/hmp-commands.hx b/hmp-commands.hx
-index 9b4035965c..284e97973a 100644
+index bfa5681dd2..e075d413c0 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
-@@ -1926,3 +1926,35 @@ ETEXI
+@@ -1944,3 +1944,35 @@ ETEXI
STEXI
@end table
ETEXI
@@ -95,11 +95,45 @@ index 9b4035965c..284e97973a 100644
+ .help = "Resume VM after snaphot.",
+ .cmd = hmp_savevm_end,
+ },
-diff --git a/hmp.c b/hmp.c
-index 25fe18cbcf..16243bba50 100644
---- a/hmp.c
-+++ b/hmp.c
-@@ -2722,6 +2722,63 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
+diff --git a/include/migration/snapshot.h b/include/migration/snapshot.h
+index c85b6ec75b..4411b7121d 100644
+--- a/include/migration/snapshot.h
++++ b/include/migration/snapshot.h
+@@ -17,5 +17,6 @@
+
+ int save_snapshot(const char *name, Error **errp);
+ int load_snapshot(const char *name, Error **errp);
++int load_snapshot_from_blockdev(const char *filename, Error **errp);
+
+ #endif
+diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
+index a0e9511440..c6ee8295f0 100644
+--- a/include/monitor/hmp.h
++++ b/include/monitor/hmp.h
+@@ -25,6 +25,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict);
+ void hmp_info_uuid(Monitor *mon, const QDict *qdict);
+ void hmp_info_chardev(Monitor *mon, const QDict *qdict);
+ void hmp_info_mice(Monitor *mon, const QDict *qdict);
++void hmp_info_savevm(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
+@@ -102,6 +103,10 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict);
+ void hmp_netdev_del(Monitor *mon, const QDict *qdict);
+ void hmp_getfd(Monitor *mon, const QDict *qdict);
+ void hmp_closefd(Monitor *mon, const QDict *qdict);
++void hmp_savevm_start(Monitor *mon, const QDict *qdict);
++void hmp_snapshot_drive(Monitor *mon, const QDict *qdict);
++void hmp_delete_drive_snapshot(Monitor *mon, const QDict *qdict);
++void hmp_savevm_end(Monitor *mon, const QDict *qdict);
+ void hmp_sendkey(Monitor *mon, const QDict *qdict);
+ void hmp_screendump(Monitor *mon, const QDict *qdict);
+ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict);
+diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
+index 1b32c59329..39a8020367 100644
+--- a/monitor/hmp-cmds.c
++++ b/monitor/hmp-cmds.c
+@@ -2640,6 +2640,63 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
hmp_handle_error(mon, &err);
}
@@ -163,40 +197,6 @@ index 25fe18cbcf..16243bba50 100644
void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
{
IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
-diff --git a/hmp.h b/hmp.h
-index 43617f2646..bcb90c478f 100644
---- a/hmp.h
-+++ b/hmp.h
-@@ -24,6 +24,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict);
- void hmp_info_uuid(Monitor *mon, const QDict *qdict);
- void hmp_info_chardev(Monitor *mon, const QDict *qdict);
- void hmp_info_mice(Monitor *mon, const QDict *qdict);
-+void hmp_info_savevm(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
-@@ -101,6 +102,10 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict);
- void hmp_netdev_del(Monitor *mon, const QDict *qdict);
- void hmp_getfd(Monitor *mon, const QDict *qdict);
- void hmp_closefd(Monitor *mon, const QDict *qdict);
-+void hmp_savevm_start(Monitor *mon, const QDict *qdict);
-+void hmp_snapshot_drive(Monitor *mon, const QDict *qdict);
-+void hmp_delete_drive_snapshot(Monitor *mon, const QDict *qdict);
-+void hmp_savevm_end(Monitor *mon, const QDict *qdict);
- void hmp_sendkey(Monitor *mon, const QDict *qdict);
- void hmp_screendump(Monitor *mon, const QDict *qdict);
- void hmp_nbd_server_start(Monitor *mon, const QDict *qdict);
-diff --git a/include/migration/snapshot.h b/include/migration/snapshot.h
-index c85b6ec75b..4411b7121d 100644
---- a/include/migration/snapshot.h
-+++ b/include/migration/snapshot.h
-@@ -17,5 +17,6 @@
-
- int save_snapshot(const char *name, Error **errp);
- int load_snapshot(const char *name, Error **errp);
-+int load_snapshot_from_blockdev(const char *filename, Error **errp);
-
- #endif
diff --git a/qapi/migration.json b/qapi/migration.json
index 9cfbaf8c6c..e206355d56 100644
--- a/qapi/migration.json
@@ -243,10 +243,10 @@ index 9cfbaf8c6c..e206355d56 100644
# @query-migrate:
#
diff --git a/qapi/misc.json b/qapi/misc.json
-index 4a0e26720e..49dfda0b28 100644
+index 2445c950cc..31029e3132 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
-@@ -2358,6 +2358,38 @@
+@@ -1384,6 +1384,38 @@
##
{ 'command': 'query-target', 'returns': 'TargetInfo' }
@@ -286,10 +286,10 @@ index 4a0e26720e..49dfda0b28 100644
# @AcpiTableOptions:
#
diff --git a/qemu-options.hx b/qemu-options.hx
-index 08749a3391..880c63dab2 100644
+index 9621e934c0..34994daafd 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
-@@ -3680,6 +3680,19 @@ STEXI
+@@ -3731,6 +3731,19 @@ STEXI
Start right away with a saved state (@code{loadvm} in monitor)
ETEXI
@@ -776,18 +776,18 @@ index 0000000000..2149010bb8
+ return ret;
+}
diff --git a/vl.c b/vl.c
-index 98efed1a79..68ca370e19 100644
+index b426b32134..1c5536e5bb 100644
--- a/vl.c
+++ b/vl.c
-@@ -3005,6 +3005,7 @@ int main(int argc, char **argv, char **envp)
+@@ -2869,6 +2869,7 @@ int main(int argc, char **argv, char **envp)
int optind;
const char *optarg;
const char *loadvm = NULL;
+ const char *loadstate = NULL;
MachineClass *machine_class;
- const char *cpu_model;
+ const char *cpu_option;
const char *vga_model = NULL;
-@@ -3572,6 +3573,9 @@ int main(int argc, char **argv, char **envp)
+@@ -3445,6 +3446,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
@@ -797,7 +797,7 @@ index 98efed1a79..68ca370e19 100644
case QEMU_OPTION_full_screen:
dpy.has_full_screen = true;
dpy.full_screen = true;
-@@ -4579,6 +4583,12 @@ int main(int argc, char **argv, char **envp)
+@@ -4444,6 +4448,12 @@ int main(int argc, char **argv, char **envp)
autostart = 0;
exit(1);
}
diff --git a/debian/patches/pve/0018-PVE-block-add-the-zeroinit-block-driver-filter.patch b/debian/patches/pve/0018-PVE-block-add-the-zeroinit-block-driver-filter.patch
index 002b420..5adbafe 100644
--- a/debian/patches/pve/0018-PVE-block-add-the-zeroinit-block-driver-filter.patch
+++ b/debian/patches/pve/0018-PVE-block-add-the-zeroinit-block-driver-filter.patch
@@ -6,12 +6,12 @@ Subject: [PATCH] PVE: block: add the zeroinit block driver filter
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
block/Makefile.objs | 1 +
- block/zeroinit.c | 203 ++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 204 insertions(+)
+ block/zeroinit.c | 204 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 205 insertions(+)
create mode 100644 block/zeroinit.c
diff --git a/block/Makefile.objs b/block/Makefile.objs
-index 7a81892a52..03b5763bfa 100644
+index 35f3bca4d9..6022242c3f 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -11,6 +11,7 @@ block-obj-$(CONFIG_QED) += qed.o qed-l2-cache.o qed-table.o qed-cluster.o
@@ -24,10 +24,10 @@ index 7a81892a52..03b5763bfa 100644
block-obj-y += blklogwrites.o
diff --git a/block/zeroinit.c b/block/zeroinit.c
new file mode 100644
-index 0000000000..64c49ad0e0
+index 0000000000..e78511d36c
--- /dev/null
+++ b/block/zeroinit.c
-@@ -0,0 +1,203 @@
+@@ -0,0 +1,204 @@
+/*
+ * Filter to fake a zero-initialized block device.
+ *
@@ -45,6 +45,7 @@ index 0000000000..64c49ad0e0
+#include "qapi/qmp/qstring.h"
+#include "qemu/cutils.h"
+#include "qemu/option.h"
++#include "qemu/module.h"
+
+typedef struct {
+ bool has_zero_init;
diff --git a/debian/patches/pve/0019-PVE-backup-modify-job-api.patch b/debian/patches/pve/0019-PVE-backup-modify-job-api.patch
index 1cdae69..b527994 100644
--- a/debian/patches/pve/0019-PVE-backup-modify-job-api.patch
+++ b/debian/patches/pve/0019-PVE-backup-modify-job-api.patch
@@ -18,10 +18,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
5 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/backup.c b/block/backup.c
-index 381659d5ef..9ee43981e8 100644
+index b26c22c4b8..812783d3cb 100644
--- a/block/backup.c
+++ b/block/backup.c
-@@ -560,6 +560,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -550,6 +550,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_target_error,
int creation_flags,
BlockCompletionFunc *cb, void *opaque,
@@ -29,7 +29,7 @@ index 381659d5ef..9ee43981e8 100644
JobTxn *txn, Error **errp)
{
int64_t len;
-@@ -677,6 +678,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -668,6 +669,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
&error_abort);
job->len = len;
@@ -38,10 +38,10 @@ index 381659d5ef..9ee43981e8 100644
return &job->common;
diff --git a/block/replication.c b/block/replication.c
-index 3d4dedddfc..0a265db1b5 100644
+index 23b2993d74..e70a6cf2bd 100644
--- a/block/replication.c
+++ b/block/replication.c
-@@ -543,7 +543,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
+@@ -546,7 +546,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
0, MIRROR_SYNC_MODE_NONE, NULL, false,
BLOCKDEV_ON_ERROR_REPORT,
BLOCKDEV_ON_ERROR_REPORT, JOB_INTERNAL,
@@ -51,19 +51,19 @@ index 3d4dedddfc..0a265db1b5 100644
error_propagate(errp, local_err);
backup_job_cleanup(bs);
diff --git a/blockdev.c b/blockdev.c
-index d358169995..a3542db57a 100644
+index 4d141e9a1f..a7c97b1585 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3546,7 +3546,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
+@@ -3574,7 +3574,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
- job_flags, NULL, NULL, txn, &local_err);
+ job_flags, NULL, NULL, 0, txn, &local_err);
- bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
-@@ -3656,7 +3656,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
+ goto unref;
+@@ -3679,7 +3679,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
@@ -73,10 +73,10 @@ index d358169995..a3542db57a 100644
error_propagate(errp, local_err);
}
diff --git a/include/block/block_int.h b/include/block/block_int.h
-index 01e855a066..b409e02be8 100644
+index 3aa1e832a8..9f4fbad5a6 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
-@@ -1157,6 +1157,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -1169,6 +1169,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_target_error,
int creation_flags,
BlockCompletionFunc *cb, void *opaque,
@@ -85,10 +85,10 @@ index 01e855a066..b409e02be8 100644
void hmp_drive_add_node(Monitor *mon, const char *optstr);
diff --git a/job.c b/job.c
-index da8e4b7bf2..86161bd9f3 100644
+index 28dd48f8a5..7a21e83780 100644
--- a/job.c
+++ b/job.c
-@@ -899,7 +899,7 @@ void job_start(Job *job)
+@@ -898,7 +898,7 @@ void job_start(Job *job)
job->co = qemu_coroutine_create(job_co_entry, job);
job->pause_count--;
job->busy = true;
diff --git a/debian/patches/pve/0020-PVE-backup-introduce-vma-archive-format.patch b/debian/patches/pve/0020-PVE-backup-introduce-vma-archive-format.patch
index a2ba6e0..6bb45cc 100644
--- a/debian/patches/pve/0020-PVE-backup-introduce-vma-archive-format.patch
+++ b/debian/patches/pve/0020-PVE-backup-introduce-vma-archive-format.patch
@@ -6,26 +6,26 @@ Subject: [PATCH] PVE: backup: introduce vma archive format
TODO: Move to a libvma block backend.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
- MAINTAINERS | 6 +
- block/Makefile.objs | 3 +
- block/vma.c | 503 ++++++++++++++++++++++++++++++++++++++++
- blockdev.c | 536 +++++++++++++++++++++++++++++++++++++++++++
- configure | 29 +++
- hmp-commands-info.hx | 13 ++
- hmp-commands.hx | 31 +++
- hmp.c | 63 +++++
- hmp.h | 3 +
- qapi/block-core.json | 109 ++++++++-
- qapi/common.json | 13 ++
- qapi/misc.json | 13 --
- 12 files changed, 1308 insertions(+), 14 deletions(-)
+ MAINTAINERS | 6 +
+ block/Makefile.objs | 3 +
+ block/vma.c | 503 +++++++++++++++++++++++++++++++++++++++
+ blockdev.c | 536 ++++++++++++++++++++++++++++++++++++++++++
+ configure | 30 +++
+ hmp-commands-info.hx | 13 +
+ hmp-commands.hx | 31 +++
+ include/monitor/hmp.h | 3 +
+ monitor/hmp-cmds.c | 63 +++++
+ qapi/block-core.json | 109 ++++++++-
+ qapi/common.json | 13 +
+ qapi/misc.json | 13 -
+ 12 files changed, 1309 insertions(+), 14 deletions(-)
create mode 100644 block/vma.c
diff --git a/MAINTAINERS b/MAINTAINERS
-index 56139ac8ab..5588f5c91e 100644
+index d6de200453..de09d099f6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -2499,6 +2499,12 @@ L: qemu-block at nongnu.org
+@@ -2563,6 +2563,12 @@ L: qemu-block at nongnu.org
S: Supported
F: block/vvfat.c
@@ -39,13 +39,13 @@ index 56139ac8ab..5588f5c91e 100644
M: Stefan Hajnoczi <stefanha at redhat.com>
L: qemu-block at nongnu.org
diff --git a/block/Makefile.objs b/block/Makefile.objs
-index 03b5763bfa..00fa730d7b 100644
+index 6022242c3f..86b10d8ea7 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -33,6 +33,7 @@ block-obj-$(CONFIG_RBD) += rbd.o
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
block-obj-$(CONFIG_VXHS) += vxhs.o
- block-obj-$(CONFIG_LIBSSH2) += ssh.o
+ block-obj-$(CONFIG_LIBSSH) += ssh.o
+block-obj-$(CONFIG_VMA) += vma.o
block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
@@ -566,7 +566,7 @@ index 0000000000..b911b198dc
+
+block_init(bdrv_vma_init);
diff --git a/blockdev.c b/blockdev.c
-index a3542db57a..5d524b9a74 100644
+index a7c97b1585..7047475a3c 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -31,11 +31,13 @@
@@ -583,7 +583,7 @@ index a3542db57a..5d524b9a74 100644
#include "block/throttle-groups.h"
#include "monitor/monitor.h"
#include "qemu/error-report.h"
-@@ -44,6 +46,7 @@
+@@ -45,6 +47,7 @@
#include "qapi/qapi-commands-block.h"
#include "qapi/qapi-commands-transaction.h"
#include "qapi/qapi-visit-block-core.h"
@@ -591,7 +591,7 @@ index a3542db57a..5d524b9a74 100644
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
-@@ -3148,6 +3151,539 @@ out:
+@@ -3168,6 +3171,539 @@ out:
aio_context_release(aio_context);
}
@@ -1132,18 +1132,19 @@ index a3542db57a..5d524b9a74 100644
bool has_base, const char *base,
bool has_base_node, const char *base_node,
diff --git a/configure b/configure
-index 1c563a7027..d164677950 100755
+index 714e7fb6a1..5e16d8e562 100755
--- a/configure
+++ b/configure
-@@ -491,6 +491,7 @@ docker="no"
+@@ -499,6 +499,8 @@ docker="no"
debug_mutex="no"
libpmem=""
default_devices="yes"
++libudev="no"
+vma=""
# cross compilers defaults, can be overridden with --cross-cc-ARCH
cross_cc_aarch64="aarch64-linux-gnu-gcc"
-@@ -1518,6 +1519,10 @@ for opt do
+@@ -1543,6 +1545,10 @@ for opt do
;;
--disable-libpmem) libpmem=no
;;
@@ -1154,7 +1155,7 @@ index 1c563a7027..d164677950 100755
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
-@@ -1818,6 +1823,7 @@ disabled with --disable-FEATURE, default is enabled if available:
+@@ -1842,6 +1848,7 @@ disabled with --disable-FEATURE, default is enabled if available:
capstone capstone disassembler support
debug-mutex mutex debugging support
libpmem libpmem support
@@ -1162,7 +1163,7 @@ index 1c563a7027..d164677950 100755
NOTE: The object files are built at the place where configure is launched
EOF
-@@ -4378,6 +4384,22 @@ EOF
+@@ -4402,6 +4409,22 @@ EOF
fi
fi
@@ -1185,7 +1186,7 @@ index 1c563a7027..d164677950 100755
##########################################
# signalfd probe
signalfd="no"
-@@ -6438,6 +6460,7 @@ echo "docker $docker"
+@@ -6481,6 +6504,7 @@ echo "docker $docker"
echo "libpmem support $libpmem"
echo "libudev $libudev"
echo "default devices $default_devices"
@@ -1193,7 +1194,7 @@ index 1c563a7027..d164677950 100755
if test "$supported_cpu" = "no"; then
echo
-@@ -6931,6 +6954,12 @@ if test "$usb_redir" = "yes" ; then
+@@ -6983,6 +7007,12 @@ if test "$usb_redir" = "yes" ; then
echo "USB_REDIR_LIBS=$usb_redir_libs" >> $config_host_mak
fi
@@ -1231,7 +1232,7 @@ index 444bd8e43d..21106bcbe6 100644
#if defined(CONFIG_SLIRP)
diff --git a/hmp-commands.hx b/hmp-commands.hx
-index 284e97973a..d723552bee 100644
+index e075d413c0..5bdfdeaf57 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -105,6 +105,37 @@ STEXI
@@ -1272,11 +1273,32 @@ index 284e97973a..d723552bee 100644
ETEXI
{
-diff --git a/hmp.c b/hmp.c
-index 16243bba50..113671ad2a 100644
---- a/hmp.c
-+++ b/hmp.c
-@@ -167,6 +167,44 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict)
+diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
+index c6ee8295f0..0f2f96c4af 100644
+--- a/include/monitor/hmp.h
++++ b/include/monitor/hmp.h
+@@ -30,6 +30,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
+ void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
++void hmp_info_backup(Monitor *mon, const QDict *qdict);
+ void hmp_info_cpus(Monitor *mon, const QDict *qdict);
+ void hmp_info_block(Monitor *mon, const QDict *qdict);
+ void hmp_info_blockstats(Monitor *mon, const QDict *qdict);
+@@ -90,6 +91,8 @@ void hmp_eject(Monitor *mon, const QDict *qdict);
+ void hmp_change(Monitor *mon, const QDict *qdict);
+ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict);
+ void hmp_block_stream(Monitor *mon, const QDict *qdict);
++void hmp_backup(Monitor *mon, const QDict *qdict);
++void hmp_backup_cancel(Monitor *mon, const QDict *qdict);
+ void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict);
+ void hmp_block_job_cancel(Monitor *mon, const QDict *qdict);
+ void hmp_block_job_pause(Monitor *mon, const QDict *qdict);
+diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
+index 39a8020367..bc9ca346f7 100644
+--- a/monitor/hmp-cmds.c
++++ b/monitor/hmp-cmds.c
+@@ -196,6 +196,44 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict)
qapi_free_MouseInfoList(mice_list);
}
@@ -1321,7 +1343,7 @@ index 16243bba50..113671ad2a 100644
static char *SocketAddress_to_str(SocketAddress *addr)
{
switch (addr->type) {
-@@ -2059,6 +2097,31 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
+@@ -2078,6 +2116,31 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
hmp_handle_error(mon, &error);
}
@@ -1353,29 +1375,8 @@ index 16243bba50..113671ad2a 100644
void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict)
{
Error *error = NULL;
-diff --git a/hmp.h b/hmp.h
-index bcb90c478f..043b74edee 100644
---- a/hmp.h
-+++ b/hmp.h
-@@ -29,6 +29,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
- void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
-+void hmp_info_backup(Monitor *mon, const QDict *qdict);
- void hmp_info_cpus(Monitor *mon, const QDict *qdict);
- void hmp_info_block(Monitor *mon, const QDict *qdict);
- void hmp_info_blockstats(Monitor *mon, const QDict *qdict);
-@@ -89,6 +90,8 @@ void hmp_eject(Monitor *mon, const QDict *qdict);
- void hmp_change(Monitor *mon, const QDict *qdict);
- void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict);
- void hmp_block_stream(Monitor *mon, const QDict *qdict);
-+void hmp_backup(Monitor *mon, const QDict *qdict);
-+void hmp_backup_cancel(Monitor *mon, const QDict *qdict);
- void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict);
- void hmp_block_job_cancel(Monitor *mon, const QDict *qdict);
- void hmp_block_job_pause(Monitor *mon, const QDict *qdict);
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index 7ccbfff9d0..6f97460806 100644
+index 0d43d4f37c..97cb7ec41c 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -796,6 +796,97 @@
@@ -1476,7 +1477,7 @@ index 7ccbfff9d0..6f97460806 100644
##
# @BlockDeviceTimedStats:
#
-@@ -2819,7 +2910,7 @@
+@@ -2835,7 +2926,7 @@
'qcow2', 'qed', 'quorum', 'raw', 'rbd',
{ 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
'sheepdog',
@@ -1485,7 +1486,7 @@ index 7ccbfff9d0..6f97460806 100644
##
# @BlockdevOptionsFile:
-@@ -3836,6 +3927,21 @@
+@@ -3898,6 +3989,21 @@
'server': 'InetSocketAddressBase',
'*tls-creds': 'str' } }
@@ -1507,7 +1508,7 @@ index 7ccbfff9d0..6f97460806 100644
##
# @BlockdevOptionsThrottle:
#
-@@ -3931,6 +4037,7 @@
+@@ -3993,6 +4099,7 @@
'throttle': 'BlockdevOptionsThrottle',
'vdi': 'BlockdevOptionsGenericFormat',
'vhdx': 'BlockdevOptionsGenericFormat',
@@ -1537,10 +1538,10 @@ index 99d313ef3b..bae0650c51 100644
+##
+{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
diff --git a/qapi/misc.json b/qapi/misc.json
-index 49dfda0b28..376f26002a 100644
+index 31029e3132..335035c04d 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
-@@ -274,19 +274,6 @@
+@@ -270,19 +270,6 @@
##
{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
diff --git a/debian/patches/pve/0021-PVE-Deprecated-adding-old-vma-files.patch b/debian/patches/pve/0021-PVE-Deprecated-adding-old-vma-files.patch
index 3fba22e..b157215 100644
--- a/debian/patches/pve/0021-PVE-Deprecated-adding-old-vma-files.patch
+++ b/debian/patches/pve/0021-PVE-Deprecated-adding-old-vma-files.patch
@@ -8,7 +8,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
Makefile | 3 +-
Makefile.objs | 1 +
- block/backup.c | 93 +++--
+ block/backup.c | 87 ++--
block/replication.c | 1 +
blockdev.c | 208 +++++----
include/block/block_int.h | 4 +
@@ -17,26 +17,26 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
vma-writer.c | 771 ++++++++++++++++++++++++++++++++++
vma.c | 756 +++++++++++++++++++++++++++++++++
vma.h | 150 +++++++
- 11 files changed, 2739 insertions(+), 108 deletions(-)
+ 11 files changed, 2734 insertions(+), 107 deletions(-)
create mode 100644 vma-reader.c
create mode 100644 vma-writer.c
create mode 100644 vma.c
create mode 100644 vma.h
diff --git a/Makefile b/Makefile
-index d4c5750256..a14995fdb3 100644
+index 85862fb81a..421e7b486c 100644
--- a/Makefile
+++ b/Makefile
-@@ -419,7 +419,7 @@ dummy := $(call unnest-vars,, \
+@@ -436,7 +436,7 @@ dummy := $(call unnest-vars,, \
include $(SRC_PATH)/tests/Makefile.include
--all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules
-+all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) vma$(EXESUF) $(HELPERS-y) recurse-all modules
+-all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules $(vhost-user-json-y)
++all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) vma$(EXESUF) $(HELPERS-y) recurse-all modules $(vhost-user-json-y)
qemu-version.h: FORCE
$(call quiet-command, \
-@@ -509,6 +509,7 @@ qemu-img.o: qemu-img-cmds.h
+@@ -544,6 +544,7 @@ qemu-img.o: qemu-img-cmds.h
qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
@@ -45,7 +45,7 @@ index d4c5750256..a14995fdb3 100644
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
diff --git a/Makefile.objs b/Makefile.objs
-index 559486973a..9477a23ca2 100644
+index 21dd93b58c..87c6033bc1 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -18,6 +18,7 @@ block-obj-y += block.o blockjob.o job.o
@@ -57,7 +57,7 @@ index 559486973a..9477a23ca2 100644
block-obj-m = block/
diff --git a/block/backup.c b/block/backup.c
-index 9ee43981e8..5240f71bb5 100644
+index 812783d3cb..05569de5d4 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -41,6 +41,7 @@ typedef struct BackupBlockJob {
@@ -68,33 +68,33 @@ index 9ee43981e8..5240f71bb5 100644
BlockdevOnError on_source_error;
BlockdevOnError on_target_error;
CoRwlock flush_rwlock;
-@@ -131,12 +132,20 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
+@@ -129,12 +130,20 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
}
- if (qemu_iovec_is_zero(&qiov)) {
+ if (buffer_is_zero(*bounce_buffer, nbytes)) {
- ret = blk_co_pwrite_zeroes(job->target, start,
-- qiov.size, write_flags | BDRV_REQ_MAY_UNMAP);
+- nbytes, write_flags | BDRV_REQ_MAY_UNMAP);
+ if (job->dump_cb) {
-+ ret = job->dump_cb(job->common.job.opaque, job->target, start, qiov.size, NULL);
++ ret = job->dump_cb(job->common.job.opaque, job->target, start, nbytes, NULL);
+ } else {
+ ret = blk_co_pwrite_zeroes(job->target, start,
-+ qiov.size, write_flags | BDRV_REQ_MAY_UNMAP);
++ nbytes, write_flags | BDRV_REQ_MAY_UNMAP);
+ }
} else {
-- ret = blk_co_pwritev(job->target, start,
-- qiov.size, &qiov, write_flags |
-- (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0));
+- ret = blk_co_pwrite(job->target, start,
+- nbytes, *bounce_buffer, write_flags |
+- (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0));
+ if (job->dump_cb) {
-+ ret = job->dump_cb(job->common.job.opaque, job->target, start, qiov.size, *bounce_buffer);
++ ret = job->dump_cb(job->common.job.opaque, job->target, start, nbytes, *bounce_buffer);
+ } else {
-+ ret = blk_co_pwritev(job->target, start,
-+ qiov.size, &qiov, write_flags |
-+ (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0));
++ ret = blk_co_pwrite(job->target, start,
++ nbytes, *bounce_buffer, write_flags |
++ (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0));
+ }
}
if (ret < 0) {
trace_backup_do_cow_write_fail(job, start, ret);
-@@ -220,8 +229,12 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job,
+@@ -218,8 +227,11 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job,
trace_backup_do_cow_process(job, start);
if (job->use_copy_range) {
@@ -103,13 +103,12 @@ index 9ee43981e8..5240f71bb5 100644
+ if (job->dump_cb) {
+ ret = - 1;
+ } else {
-+ ret = backup_cow_with_offload(job, start, dirty_end,
-+ is_write_notifier);
++ ret = backup_cow_with_offload(job, start, dirty_end, is_write_notifier);
+ }
if (ret < 0) {
job->use_copy_range = false;
}
-@@ -306,7 +319,9 @@ static void backup_abort(Job *job)
+@@ -304,7 +316,9 @@ static void backup_abort(Job *job)
static void backup_clean(Job *job)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
@@ -120,18 +119,7 @@ index 9ee43981e8..5240f71bb5 100644
blk_unref(s->target);
s->target = NULL;
-@@ -320,7 +335,9 @@ static void backup_attached_aio_context(BlockJob *job, AioContext *aio_context)
- {
- BackupBlockJob *s = container_of(job, BackupBlockJob, common);
-
-- blk_set_aio_context(s->target, aio_context);
-+ if (s->target) {
-+ blk_set_aio_context(s->target, aio_context);
-+ }
- }
-
- void backup_do_checkpoint(BlockJob *job, Error **errp)
-@@ -359,9 +376,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
+@@ -350,9 +364,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
if (read) {
return block_job_error_action(&job->common, job->on_source_error,
true, error);
@@ -144,7 +132,7 @@ index 9ee43981e8..5240f71bb5 100644
}
}
-@@ -559,6 +578,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -549,6 +565,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
int creation_flags,
@@ -152,7 +140,7 @@ index 9ee43981e8..5240f71bb5 100644
BlockCompletionFunc *cb, void *opaque,
int pause_count,
JobTxn *txn, Error **errp)
-@@ -570,7 +590,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -560,7 +577,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
HBitmap *copy_bitmap = NULL;
assert(bs);
@@ -161,7 +149,7 @@ index 9ee43981e8..5240f71bb5 100644
if (bs == target) {
error_setg(errp, "Source and target cannot be the same");
-@@ -583,23 +603,23 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -573,13 +590,13 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
return NULL;
}
@@ -177,10 +165,7 @@ index 9ee43981e8..5240f71bb5 100644
error_setg(errp, "Compression is not supported for this drive %s",
bdrv_get_device_name(target));
return NULL;
- }
-
-- if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
-+ if (target && bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
+@@ -589,7 +606,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
return NULL;
}
@@ -189,7 +174,7 @@ index 9ee43981e8..5240f71bb5 100644
return NULL;
}
-@@ -629,7 +649,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -619,7 +636,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
goto error;
}
@@ -198,12 +183,13 @@ index 9ee43981e8..5240f71bb5 100644
if (cluster_size < 0) {
goto error;
}
-@@ -646,15 +666,18 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -636,16 +653,19 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
goto error;
}
- /* The target must match the source in size, so no resize here either */
-- job->target = blk_new(BLK_PERM_WRITE,
+- job->target = blk_new(job->common.job.aio_context,
+- BLK_PERM_WRITE,
- BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE |
- BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD);
- ret = blk_insert_bs(job->target, target, errp);
@@ -211,7 +197,8 @@ index 9ee43981e8..5240f71bb5 100644
- goto error;
+ if (target) {
+ /* The target must match the source in size, so no resize here either */
-+ job->target = blk_new(BLK_PERM_WRITE,
++ job->target = blk_new(job->common.job.aio_context,
++ BLK_PERM_WRITE,
+ BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE |
+ BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD);
+ ret = blk_insert_bs(job->target, target, errp);
@@ -224,7 +211,7 @@ index 9ee43981e8..5240f71bb5 100644
job->on_source_error = on_source_error;
job->on_target_error = on_target_error;
job->sync_mode = sync_mode;
-@@ -667,16 +690,20 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -658,16 +678,19 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
job->cluster_size = cluster_size;
job->copy_bitmap = copy_bitmap;
copy_bitmap = NULL;
@@ -238,9 +225,9 @@ index 9ee43981e8..5240f71bb5 100644
- /* Required permissions are already taken with target's blk_new() */
- block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
- &error_abort);
++ job->use_copy_range = target && !compress; /* compression isn't supported for it */
+
+ if (target) {
-+ job->use_copy_range = !compress; /* compression isn't supported for it */
+ job->copy_range_size = MIN_NON_ZERO(blk_get_max_transfer(job->common.blk),
+ blk_get_max_transfer(job->target));
+ job->copy_range_size = MAX(job->cluster_size,
@@ -251,15 +238,14 @@ index 9ee43981e8..5240f71bb5 100644
+ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
+ &error_abort);
+ }
-+
job->len = len;
job->common.job.pause_count += pause_count;
diff --git a/block/replication.c b/block/replication.c
-index 0a265db1b5..e85c62ba9c 100644
+index e70a6cf2bd..f060755713 100644
--- a/block/replication.c
+++ b/block/replication.c
-@@ -543,6 +543,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
+@@ -546,6 +546,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
0, MIRROR_SYNC_MODE_NONE, NULL, false,
BLOCKDEV_ON_ERROR_REPORT,
BLOCKDEV_ON_ERROR_REPORT, JOB_INTERNAL,
@@ -268,7 +254,7 @@ index 0a265db1b5..e85c62ba9c 100644
if (local_err) {
error_propagate(errp, local_err);
diff --git a/blockdev.c b/blockdev.c
-index 5d524b9a74..2466a02cbd 100644
+index 7047475a3c..cee7952bbb 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -31,7 +31,6 @@
@@ -279,7 +265,7 @@ index 5d524b9a74..2466a02cbd 100644
#include "sysemu/block-backend.h"
#include "sysemu/blockdev.h"
#include "hw/block/block.h"
-@@ -63,6 +62,7 @@
+@@ -64,6 +63,7 @@
#include "qemu/cutils.h"
#include "qemu/help_option.h"
#include "qemu/throttle-options.h"
@@ -287,7 +273,7 @@ index 5d524b9a74..2466a02cbd 100644
static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =
QTAILQ_HEAD_INITIALIZER(monitor_bdrv_states);
-@@ -3156,15 +3156,14 @@ out:
+@@ -3176,15 +3176,14 @@ out:
static struct PVEBackupState {
Error *error;
bool cancel;
@@ -305,7 +291,7 @@ index 5d524b9a74..2466a02cbd 100644
size_t total;
size_t transferred;
size_t zero_bytes;
-@@ -3183,6 +3182,71 @@ typedef struct PVEBackupDevInfo {
+@@ -3203,6 +3202,71 @@ typedef struct PVEBackupDevInfo {
static void pvebackup_run_next_job(void);
@@ -377,7 +363,7 @@ index 5d524b9a74..2466a02cbd 100644
static void pvebackup_cleanup(void)
{
qemu_mutex_lock(&backup_state.backup_mutex);
-@@ -3194,9 +3258,11 @@ static void pvebackup_cleanup(void)
+@@ -3214,9 +3278,11 @@ static void pvebackup_cleanup(void)
backup_state.end_time = time(NULL);
@@ -392,7 +378,7 @@ index 5d524b9a74..2466a02cbd 100644
}
g_list_free(backup_state.di_list);
-@@ -3204,6 +3270,13 @@ static void pvebackup_cleanup(void)
+@@ -3224,6 +3290,13 @@ static void pvebackup_cleanup(void)
qemu_mutex_unlock(&backup_state.backup_mutex);
}
@@ -406,7 +392,7 @@ index 5d524b9a74..2466a02cbd 100644
static void pvebackup_complete_cb(void *opaque, int ret)
{
// This always runs in the main loop
-@@ -3220,9 +3293,9 @@ static void pvebackup_complete_cb(void *opaque, int ret)
+@@ -3240,9 +3313,9 @@ static void pvebackup_complete_cb(void *opaque, int ret)
di->bs = NULL;
di->target = NULL;
@@ -419,7 +405,7 @@ index 5d524b9a74..2466a02cbd 100644
}
// remove self from job queue
-@@ -3250,14 +3323,9 @@ static void pvebackup_cancel(void *opaque)
+@@ -3270,14 +3343,9 @@ static void pvebackup_cancel(void *opaque)
error_setg(&backup_state.error, "backup cancelled");
}
@@ -436,7 +422,7 @@ index 5d524b9a74..2466a02cbd 100644
}
GList *l = backup_state.di_list;
-@@ -3288,18 +3356,14 @@ void qmp_backup_cancel(Error **errp)
+@@ -3308,18 +3376,14 @@ void qmp_backup_cancel(Error **errp)
Coroutine *co = qemu_coroutine_create(pvebackup_cancel, NULL);
qemu_coroutine_enter(co);
@@ -458,7 +444,7 @@ index 5d524b9a74..2466a02cbd 100644
Error **errp)
{
char *cdata = NULL;
-@@ -3313,7 +3377,12 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3333,7 +3397,12 @@ static int config_to_vma(const char *file, BackupFormat format,
char *basename = g_path_get_basename(file);
if (format == BACKUP_FORMAT_VMA) {
@@ -472,7 +458,7 @@ index 5d524b9a74..2466a02cbd 100644
} else if (format == BACKUP_FORMAT_DIR) {
char config_path[PATH_MAX];
snprintf(config_path, PATH_MAX, "%s/%s", backup_dir, basename);
-@@ -3330,28 +3399,30 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3350,28 +3419,30 @@ static int config_to_vma(const char *file, BackupFormat format,
return 0;
}
@@ -512,7 +498,7 @@ index 5d524b9a74..2466a02cbd 100644
}
qemu_mutex_unlock(&backup_state.backup_mutex);
-@@ -3362,7 +3433,7 @@ static void pvebackup_run_next_job(void)
+@@ -3382,7 +3453,7 @@ static void pvebackup_run_next_job(void)
UuidInfo *qmp_backup(const char *backup_file, bool has_format,
BackupFormat format,
bool has_config_file, const char *config_file,
@@ -521,7 +507,7 @@ index 5d524b9a74..2466a02cbd 100644
bool has_devlist, const char *devlist,
bool has_speed, int64_t speed, Error **errp)
{
-@@ -3370,7 +3441,8 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3390,7 +3461,8 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
BlockDriverState *bs = NULL;
const char *backup_dir = NULL;
Error *local_err = NULL;
@@ -531,7 +517,7 @@ index 5d524b9a74..2466a02cbd 100644
gchar **devs = NULL;
GList *di_list = NULL;
GList *l;
-@@ -3382,7 +3454,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3402,7 +3474,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
backup_state.backup_mutex_initialized = true;
}
@@ -540,7 +526,7 @@ index 5d524b9a74..2466a02cbd 100644
error_set(errp, ERROR_CLASS_GENERIC_ERROR,
"previous backup not finished");
return NULL;
-@@ -3457,40 +3529,28 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3477,40 +3549,28 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
total += size;
}
@@ -589,7 +575,7 @@ index 5d524b9a74..2466a02cbd 100644
goto err;
}
}
-@@ -3531,14 +3591,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3551,14 +3611,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
/* add configuration file to archive */
if (has_config_file) {
@@ -606,7 +592,7 @@ index 5d524b9a74..2466a02cbd 100644
goto err;
}
}
-@@ -3561,12 +3621,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3581,12 +3641,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
}
backup_state.backup_file = g_strdup(backup_file);
@@ -623,7 +609,7 @@ index 5d524b9a74..2466a02cbd 100644
backup_state.total = total;
backup_state.transferred = 0;
-@@ -3577,21 +3638,21 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3597,21 +3658,21 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
while (l) {
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
@@ -651,7 +637,7 @@ index 5d524b9a74..2466a02cbd 100644
}
qemu_mutex_unlock(&backup_state.backup_mutex);
-@@ -3627,9 +3688,10 @@ err:
+@@ -3647,9 +3708,10 @@ err:
g_strfreev(devs);
}
@@ -665,16 +651,16 @@ index 5d524b9a74..2466a02cbd 100644
}
if (backup_dir) {
-@@ -4082,7 +4144,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
+@@ -4110,7 +4172,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
- job_flags, NULL, NULL, 0, txn, &local_err);
+ job_flags, NULL, NULL, NULL, 0, txn, &local_err);
- bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
-@@ -4192,7 +4254,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
+ goto unref;
+@@ -4215,7 +4277,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
@@ -684,7 +670,7 @@ index 5d524b9a74..2466a02cbd 100644
error_propagate(errp, local_err);
}
diff --git a/include/block/block_int.h b/include/block/block_int.h
-index b409e02be8..fd1828cd70 100644
+index 9f4fbad5a6..73a55a7351 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -61,6 +61,9 @@
@@ -697,7 +683,7 @@ index b409e02be8..fd1828cd70 100644
enum BdrvTrackedRequestType {
BDRV_TRACKED_READ,
BDRV_TRACKED_WRITE,
-@@ -1156,6 +1159,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -1168,6 +1171,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
int creation_flags,
@@ -706,10 +692,10 @@ index b409e02be8..fd1828cd70 100644
int pause_count,
JobTxn *txn, Error **errp);
diff --git a/job.c b/job.c
-index 86161bd9f3..114640688a 100644
+index 7a21e83780..9d27999678 100644
--- a/job.c
+++ b/job.c
-@@ -249,7 +249,8 @@ static bool job_started(Job *job)
+@@ -248,7 +248,8 @@ static bool job_started(Job *job)
return job->co;
}
diff --git a/debian/patches/pve/0025-PVE-Add-dummy-id-command-line-parameter.patch b/debian/patches/pve/0025-PVE-Add-dummy-id-command-line-parameter.patch
index c449d75..94ec6fb 100644
--- a/debian/patches/pve/0025-PVE-Add-dummy-id-command-line-parameter.patch
+++ b/debian/patches/pve/0025-PVE-Add-dummy-id-command-line-parameter.patch
@@ -14,10 +14,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
2 files changed, 11 insertions(+)
diff --git a/qemu-options.hx b/qemu-options.hx
-index 880c63dab2..6c98b2b510 100644
+index 34994daafd..6db02fe903 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
-@@ -801,6 +801,9 @@ STEXI
+@@ -802,6 +802,9 @@ STEXI
@table @option
ETEXI
@@ -28,10 +28,10 @@ index 880c63dab2..6c98b2b510 100644
"-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
diff --git a/vl.c b/vl.c
-index 68ca370e19..bb2cdb8ea9 100644
+index 1c5536e5bb..7ffcd271f1 100644
--- a/vl.c
+++ b/vl.c
-@@ -2993,6 +2993,7 @@ static void user_register_global_props(void)
+@@ -2857,6 +2857,7 @@ static void user_register_global_props(void)
int main(int argc, char **argv, char **envp)
{
int i;
@@ -39,7 +39,7 @@ index 68ca370e19..bb2cdb8ea9 100644
int snapshot, linux_boot;
const char *initrd_filename;
const char *kernel_filename, *kernel_cmdline;
-@@ -3681,6 +3682,13 @@ int main(int argc, char **argv, char **envp)
+@@ -3570,6 +3571,13 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
break;
diff --git a/debian/patches/pve/0026-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch b/debian/patches/pve/0026-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch
index 73b90dc..727e13b 100644
--- a/debian/patches/pve/0026-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch
+++ b/debian/patches/pve/0026-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch
@@ -11,10 +11,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
1 file changed, 9 insertions(+)
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
-index 78903ea909..cdfbec5e47 100644
+index e764a2bb03..f66ea72d78 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
-@@ -257,6 +257,15 @@ static void apic_reset_common(DeviceState *dev)
+@@ -258,6 +258,15 @@ static void apic_reset_common(DeviceState *dev)
info->vapic_base_update(s);
apic_init_reset(dev);
diff --git a/debian/patches/pve/0027-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch b/debian/patches/pve/0027-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch
index 92defde..08af25a 100644
--- a/debian/patches/pve/0027-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch
+++ b/debian/patches/pve/0027-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch
@@ -13,10 +13,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
2 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
-index 0613f59c7b..ef5c1bf487 100644
+index 760648b78c..e40386384e 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
-@@ -2223,6 +2223,7 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
+@@ -2240,6 +2240,7 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
int fd;
uint64_t perm, shared;
int result = 0;
@@ -24,7 +24,7 @@ index 0613f59c7b..ef5c1bf487 100644
/* Validate options and set default values */
assert(options->driver == BLOCKDEV_DRIVER_FILE);
-@@ -2256,19 +2257,22 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
+@@ -2273,19 +2274,22 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
perm = BLK_PERM_WRITE | BLK_PERM_RESIZE;
shared = BLK_PERM_ALL & ~BLK_PERM_RESIZE;
@@ -59,7 +59,7 @@ index 0613f59c7b..ef5c1bf487 100644
}
/* Clear the file by truncating it to 0 */
-@@ -2301,13 +2305,15 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
+@@ -2318,13 +2322,15 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
}
out_unlock:
@@ -82,7 +82,7 @@ index 0613f59c7b..ef5c1bf487 100644
}
out_close:
-@@ -2328,6 +2334,7 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
+@@ -2345,6 +2351,7 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
PreallocMode prealloc;
char *buf = NULL;
Error *local_err = NULL;
@@ -90,7 +90,7 @@ index 0613f59c7b..ef5c1bf487 100644
/* Skip file: protocol prefix */
strstart(filename, "file:", &filename);
-@@ -2345,6 +2352,18 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
+@@ -2362,6 +2369,18 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
return -EINVAL;
}
@@ -109,7 +109,7 @@ index 0613f59c7b..ef5c1bf487 100644
options = (BlockdevCreateOptions) {
.driver = BLOCKDEV_DRIVER_FILE,
.u.file = {
-@@ -2354,6 +2373,8 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
+@@ -2371,6 +2390,8 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
.preallocation = prealloc,
.has_nocow = true,
.nocow = nocow,
@@ -118,7 +118,7 @@ index 0613f59c7b..ef5c1bf487 100644
},
};
return raw_co_create(&options, errp);
-@@ -2789,7 +2810,7 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
+@@ -2812,7 +2833,7 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
}
/* Copy locks to the new fd */
@@ -128,10 +128,10 @@ index 0613f59c7b..ef5c1bf487 100644
false, errp);
if (ret < 0) {
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index 6f97460806..0e9c239485 100644
+index 97cb7ec41c..f432d4f3ec 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
-@@ -4219,7 +4219,8 @@
+@@ -4284,7 +4284,8 @@
'data': { 'filename': 'str',
'size': 'size',
'*preallocation': 'PreallocMode',
diff --git a/debian/patches/pve/0030-PVE-monitor-disable-oob-capability.patch b/debian/patches/pve/0030-PVE-monitor-disable-oob-capability.patch
index 8fd1ec1..0da42e7 100644
--- a/debian/patches/pve/0030-PVE-monitor-disable-oob-capability.patch
+++ b/debian/patches/pve/0030-PVE-monitor-disable-oob-capability.patch
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller at proxmox.com>
-Date: Tue, 25 Jun 2019 11:17:58 +0200
+From: Stefan Reiter <s.reiter at proxmox.com>
+Date: Thu, 14 Nov 2019 14:38:02 +0100
Subject: [PATCH] PVE: monitor: disable oob capability
A bisect revealed that commit 8258292e18c3
@@ -14,22 +14,20 @@ disable oob, so we can get a functioning qemu out...
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
- monitor.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
+ monitor/qmp.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
-diff --git a/monitor.c b/monitor.c
-index daadbcdede..0f79a7dfa4 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -4616,10 +4616,7 @@ void monitor_init(Chardev *chr, int flags)
- bool use_readline = flags & MONITOR_USE_READLINE;
+diff --git a/monitor/qmp.c b/monitor/qmp.c
+index fb3e66c62a..ad6703dc52 100644
+--- a/monitor/qmp.c
++++ b/monitor/qmp.c
+@@ -379,8 +379,7 @@ void monitor_init_qmp(Chardev *chr, bool pretty)
+ MonitorQMP *mon = g_new0(MonitorQMP, 1);
/* Note: we run QMP monitor in I/O thread when @chr supports that */
-- monitor_data_init(mon, false,
-- (flags & MONITOR_USE_CONTROL)
-- && qemu_chr_has_feature(chr,
-- QEMU_CHAR_FEATURE_GCONTEXT));
-+ monitor_data_init(mon, false, false);
+- monitor_data_init(&mon->common, true, false,
+- qemu_chr_has_feature(chr, QEMU_CHAR_FEATURE_GCONTEXT));
++ monitor_data_init(&mon->common, true, false, false);
+
+ mon->pretty = pretty;
- qemu_chr_fe_init(&mon->chr, chr, &error_abort);
- mon->flags = flags;
diff --git a/debian/patches/pve/0032-qmp_backup-run-backup-related-code-inside-coroutines.patch b/debian/patches/pve/0032-qmp_backup-run-backup-related-code-inside-coroutines.patch
index 7a3f1d5..95ee63f 100644
--- a/debian/patches/pve/0032-qmp_backup-run-backup-related-code-inside-coroutines.patch
+++ b/debian/patches/pve/0032-qmp_backup-run-backup-related-code-inside-coroutines.patch
@@ -11,10 +11,10 @@ Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
1 file changed, 180 insertions(+), 70 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index 2466a02cbd..85031de942 100644
+index cee7952bbb..cec0f770e8 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3153,6 +3153,34 @@ out:
+@@ -3173,6 +3173,34 @@ out:
/* PVE backup related function */
@@ -49,7 +49,7 @@ index 2466a02cbd..85031de942 100644
static struct PVEBackupState {
Error *error;
bool cancel;
-@@ -3180,12 +3208,14 @@ typedef struct PVEBackupDevInfo {
+@@ -3200,12 +3228,14 @@ typedef struct PVEBackupDevInfo {
BlockDriverState *target;
} PVEBackupDevInfo;
@@ -66,7 +66,7 @@ index 2466a02cbd..85031de942 100644
const uint64_t size = bytes;
const unsigned char *buf = pbuf;
PVEBackupDevInfo *di = opaque;
-@@ -3247,8 +3277,10 @@ static int pvebackup_dump_cb(void *opaque, BlockBackend *target,
+@@ -3267,8 +3297,10 @@ static int pvebackup_dump_cb(void *opaque, BlockBackend *target,
return size;
}
@@ -78,7 +78,7 @@ index 2466a02cbd..85031de942 100644
qemu_mutex_lock(&backup_state.backup_mutex);
// Avoid race between block jobs and backup-cancel command:
if (!backup_state.vmaw) {
-@@ -3270,18 +3302,19 @@ static void pvebackup_cleanup(void)
+@@ -3290,18 +3322,19 @@ static void pvebackup_cleanup(void)
qemu_mutex_unlock(&backup_state.backup_mutex);
}
@@ -107,7 +107,7 @@ index 2466a02cbd..85031de942 100644
di->completed = true;
-@@ -3294,8 +3327,7 @@ static void pvebackup_complete_cb(void *opaque, int ret)
+@@ -3314,8 +3347,7 @@ static void pvebackup_complete_cb(void *opaque, int ret)
di->target = NULL;
if (backup_state.vmaw) {
@@ -117,7 +117,7 @@ index 2466a02cbd..85031de942 100644
}
// remove self from job queue
-@@ -3305,12 +3337,25 @@ static void pvebackup_complete_cb(void *opaque, int ret)
+@@ -3325,12 +3357,25 @@ static void pvebackup_complete_cb(void *opaque, int ret)
qemu_mutex_unlock(&backup_state.backup_mutex);
if (!backup_state.cancel) {
@@ -145,7 +145,7 @@ index 2466a02cbd..85031de942 100644
backup_state.cancel = true;
qemu_mutex_lock(&backup_state.backup_mutex);
// Avoid race between block jobs and backup-cancel command:
-@@ -3345,21 +3390,16 @@ static void pvebackup_cancel(void *opaque)
+@@ -3365,21 +3410,16 @@ static void pvebackup_cancel(void *opaque)
}
}
@@ -170,7 +170,7 @@ index 2466a02cbd..85031de942 100644
}
static int config_to_vma(const char *file, BackupFormat format,
-@@ -3400,8 +3440,11 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3420,8 +3460,11 @@ static int config_to_vma(const char *file, BackupFormat format,
}
bool job_should_pause(Job *job);
@@ -183,7 +183,7 @@ index 2466a02cbd..85031de942 100644
qemu_mutex_lock(&backup_state.backup_mutex);
GList *l = backup_state.di_list;
-@@ -3427,16 +3470,33 @@ static void pvebackup_run_next_job(void)
+@@ -3447,16 +3490,33 @@ static void pvebackup_run_next_job(void)
qemu_mutex_unlock(&backup_state.backup_mutex);
// no more jobs, run the cleanup
@@ -224,7 +224,7 @@ index 2466a02cbd..85031de942 100644
BlockBackend *blk;
BlockDriverState *bs = NULL;
const char *backup_dir = NULL;
-@@ -3455,16 +3515,16 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3475,16 +3535,16 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
}
if (backup_state.di_list) {
@@ -246,7 +246,7 @@ index 2466a02cbd..85031de942 100644
gchar **d = devs;
while (d && *d) {
-@@ -3472,18 +3532,18 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3492,18 +3552,18 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
if (blk) {
bs = blk_bs(blk);
if (bdrv_is_read_only(bs)) {
@@ -268,7 +268,7 @@ index 2466a02cbd..85031de942 100644
"Device '%s' not found", *d);
goto err;
}
-@@ -3506,7 +3566,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3526,7 +3586,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
}
if (!di_list) {
@@ -277,7 +277,7 @@ index 2466a02cbd..85031de942 100644
goto err;
}
-@@ -3516,13 +3576,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3536,13 +3596,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
while (l) {
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
@@ -293,7 +293,7 @@ index 2466a02cbd..85031de942 100644
goto err;
}
di->size = size;
-@@ -3532,10 +3592,10 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3552,10 +3612,10 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
uuid_generate(uuid);
if (format == BACKUP_FORMAT_VMA) {
@@ -306,7 +306,7 @@ index 2466a02cbd..85031de942 100644
}
goto err;
}
-@@ -3549,18 +3609,18 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3569,18 +3629,18 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
const char *devname = bdrv_get_device_name(di->bs);
di->dev_id = vma_writer_register_stream(vmaw, devname, di->size);
if (di->dev_id <= 0) {
@@ -330,7 +330,7 @@ index 2466a02cbd..85031de942 100644
l = di_list;
while (l) {
-@@ -3574,31 +3634,31 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3594,31 +3654,31 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
bdrv_img_create(di->targetfile, "raw", NULL, NULL, NULL,
di->size, flags, false, &local_err);
if (local_err) {
@@ -369,7 +369,7 @@ index 2466a02cbd..85031de942 100644
goto err;
}
}
-@@ -3611,7 +3671,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3631,7 +3691,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
backup_state.error = NULL;
}
@@ -378,7 +378,7 @@ index 2466a02cbd..85031de942 100644
backup_state.start_time = time(NULL);
backup_state.end_time = 0;
-@@ -3619,7 +3679,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3639,7 +3699,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
if (backup_state.backup_file) {
g_free(backup_state.backup_file);
}
@@ -387,7 +387,7 @@ index 2466a02cbd..85031de942 100644
backup_state.vmaw = vmaw;
-@@ -3638,14 +3698,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3658,14 +3718,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
while (l) {
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
@@ -405,7 +405,7 @@ index 2466a02cbd..85031de942 100644
} else {
job_start(&job->job);
}
-@@ -3658,13 +3717,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3678,13 +3737,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
qemu_mutex_unlock(&backup_state.backup_mutex);
if (!backup_state.error) {
@@ -422,7 +422,7 @@ index 2466a02cbd..85031de942 100644
err:
-@@ -3691,23 +3751,61 @@ err:
+@@ -3711,23 +3771,61 @@ err:
if (vmaw) {
Error *err = NULL;
vma_writer_close(vmaw, &err);
@@ -488,7 +488,7 @@ index 2466a02cbd..85031de942 100644
}
info->has_status = true;
-@@ -3743,7 +3841,19 @@ BackupStatus *qmp_query_backup(Error **errp)
+@@ -3763,7 +3861,19 @@ BackupStatus *qmp_query_backup(Error **errp)
info->has_transferred = true;
info->transferred = backup_state.transferred;
diff --git a/debian/patches/pve/0033-qmp_backup-use-a-CoMutex-to-protect-access-to-backup.patch b/debian/patches/pve/0033-qmp_backup-use-a-CoMutex-to-protect-access-to-backup.patch
index f297762..6a08930 100644
--- a/debian/patches/pve/0033-qmp_backup-use-a-CoMutex-to-protect-access-to-backup.patch
+++ b/debian/patches/pve/0033-qmp_backup-use-a-CoMutex-to-protect-access-to-backup.patch
@@ -14,10 +14,10 @@ Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
1 file changed, 52 insertions(+), 22 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index 85031de942..7e9241cf42 100644
+index cec0f770e8..29196c18d8 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3195,7 +3195,7 @@ static struct PVEBackupState {
+@@ -3215,7 +3215,7 @@ static struct PVEBackupState {
size_t total;
size_t transferred;
size_t zero_bytes;
@@ -26,7 +26,7 @@ index 85031de942..7e9241cf42 100644
bool backup_mutex_initialized;
} backup_state;
-@@ -3220,7 +3220,10 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
+@@ -3240,7 +3240,10 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
const unsigned char *buf = pbuf;
PVEBackupDevInfo *di = opaque;
@@ -37,7 +37,7 @@ index 85031de942..7e9241cf42 100644
return size; // return success
}
-@@ -3231,6 +3234,7 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
+@@ -3251,6 +3254,7 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
"got unaligned write inside backup dump "
"callback (sector %ld)", start);
}
@@ -45,7 +45,7 @@ index 85031de942..7e9241cf42 100644
return -1; // not aligned to cluster size
}
-@@ -3272,6 +3276,8 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
+@@ -3292,6 +3296,8 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
backup_state.transferred += size;
}
@@ -54,7 +54,7 @@ index 85031de942..7e9241cf42 100644
// Note: always return success, because we want that writes succeed anyways.
return size;
-@@ -3281,10 +3287,9 @@ static void coroutine_fn pvebackup_co_cleanup(void)
+@@ -3301,10 +3307,9 @@ static void coroutine_fn pvebackup_co_cleanup(void)
{
assert(qemu_in_coroutine());
@@ -67,7 +67,7 @@ index 85031de942..7e9241cf42 100644
return;
}
-@@ -3299,7 +3304,7 @@ static void coroutine_fn pvebackup_co_cleanup(void)
+@@ -3319,7 +3324,7 @@ static void coroutine_fn pvebackup_co_cleanup(void)
g_list_free(backup_state.di_list);
backup_state.di_list = NULL;
@@ -76,7 +76,7 @@ index 85031de942..7e9241cf42 100644
}
typedef struct PVEBackupCompeteCallbackData {
-@@ -3313,6 +3318,8 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
+@@ -3333,6 +3338,8 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
PVEBackupCompeteCallbackData *cb_data = opaque;
@@ -85,7 +85,7 @@ index 85031de942..7e9241cf42 100644
PVEBackupDevInfo *di = cb_data->di;
int ret = cb_data->result;
-@@ -3331,12 +3338,14 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
+@@ -3351,12 +3358,14 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
}
// remove self from job queue
@@ -103,7 +103,7 @@ index 85031de942..7e9241cf42 100644
pvebackup_co_run_next_job();
}
}
-@@ -3356,11 +3365,13 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
+@@ -3376,11 +3385,13 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
{
assert(qemu_in_coroutine());
@@ -119,7 +119,7 @@ index 85031de942..7e9241cf42 100644
return;
}
-@@ -3373,6 +3384,7 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
+@@ -3393,6 +3404,7 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
vma_writer_set_error(backup_state.vmaw, "backup cancelled");
}
@@ -127,7 +127,7 @@ index 85031de942..7e9241cf42 100644
GList *l = backup_state.di_list;
while (l) {
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
-@@ -3383,6 +3395,7 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
+@@ -3403,6 +3415,7 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
AioContext *aio_context = blk_get_aio_context(job->blk);
aio_context_acquire(aio_context);
if (!di->completed) {
@@ -135,7 +135,7 @@ index 85031de942..7e9241cf42 100644
job_cancel(&job->job, false);
}
aio_context_release(aio_context);
-@@ -3391,7 +3404,8 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
+@@ -3411,7 +3424,8 @@ static void coroutine_fn pvebackup_co_cancel(void *opaque)
}
qemu_co_mutex_unlock(&backup_state.backup_mutex);
@@ -145,7 +145,7 @@ index 85031de942..7e9241cf42 100644
}
void qmp_backup_cancel(Error **errp)
-@@ -3445,7 +3459,7 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
+@@ -3465,7 +3479,7 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
{
assert(qemu_in_coroutine());
@@ -154,7 +154,7 @@ index 85031de942..7e9241cf42 100644
GList *l = backup_state.di_list;
while (l) {
-@@ -3454,11 +3468,13 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
+@@ -3474,11 +3488,13 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
if (!di->completed && di->bs && di->bs->job) {
BlockJob *job = di->bs->job;
AioContext *aio_context = blk_get_aio_context(job->blk);
@@ -171,7 +171,7 @@ index 85031de942..7e9241cf42 100644
} else {
job_resume(&job->job);
}
-@@ -3467,7 +3483,7 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
+@@ -3487,7 +3503,7 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
return;
}
}
@@ -180,7 +180,7 @@ index 85031de942..7e9241cf42 100644
// no more jobs, run the cleanup
pvebackup_co_cleanup();
-@@ -3510,11 +3526,14 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3530,11 +3546,14 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
BlockJob *job;
if (!backup_state.backup_mutex_initialized) {
@@ -196,7 +196,7 @@ index 85031de942..7e9241cf42 100644
error_set(task->errp, ERROR_CLASS_GENERIC_ERROR,
"previous backup not finished");
return;
-@@ -3686,7 +3705,6 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3706,7 +3725,6 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
uuid_copy(backup_state.uuid, uuid);
uuid_unparse_lower(uuid, backup_state.uuid_str);
@@ -204,7 +204,7 @@ index 85031de942..7e9241cf42 100644
backup_state.di_list = di_list;
backup_state.total = total;
-@@ -3704,20 +3722,21 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3724,20 +3742,21 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
1, NULL, &local_err);
if (!job || local_err != NULL) {
error_setg(&backup_state.error, "backup_job_create failed");
@@ -230,7 +230,7 @@ index 85031de942..7e9241cf42 100644
}
uuid_info = g_malloc0(sizeof(*uuid_info));
-@@ -3758,6 +3777,8 @@ err:
+@@ -3778,6 +3797,8 @@ err:
rmdir(backup_dir);
}
@@ -239,7 +239,7 @@ index 85031de942..7e9241cf42 100644
task->result = NULL;
return;
}
-@@ -3785,6 +3806,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3805,6 +3826,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
};
block_on_coroutine_fn(pvebackup_co_start, &task);
@@ -247,7 +247,7 @@ index 85031de942..7e9241cf42 100644
return task.result;
}
-@@ -3802,9 +3824,15 @@ static void coroutine_fn pvebackup_co_query(void *opaque)
+@@ -3822,9 +3844,15 @@ static void coroutine_fn pvebackup_co_query(void *opaque)
BackupStatus *info = g_malloc0(sizeof(*info));
@@ -263,7 +263,7 @@ index 85031de942..7e9241cf42 100644
return;
}
-@@ -3842,6 +3870,8 @@ static void coroutine_fn pvebackup_co_query(void *opaque)
+@@ -3862,6 +3890,8 @@ static void coroutine_fn pvebackup_co_query(void *opaque)
info->transferred = backup_state.transferred;
task->result = info;
diff --git a/debian/patches/pve/0035-backup_job_create-pass-cluster-size-for-dump.patch b/debian/patches/pve/0035-backup_job_create-pass-cluster-size-for-dump.patch
index 7e2550c..1503416 100644
--- a/debian/patches/pve/0035-backup_job_create-pass-cluster-size-for-dump.patch
+++ b/debian/patches/pve/0035-backup_job_create-pass-cluster-size-for-dump.patch
@@ -12,10 +12,10 @@ Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/block/backup.c b/block/backup.c
-index 5240f71bb5..2ccec79db6 100644
+index 05569de5d4..a3f0d2c9a5 100644
--- a/block/backup.c
+++ b/block/backup.c
-@@ -579,6 +579,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -566,6 +566,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_target_error,
int creation_flags,
BackupDumpFunc *dump_cb,
@@ -23,7 +23,7 @@ index 5240f71bb5..2ccec79db6 100644
BlockCompletionFunc *cb, void *opaque,
int pause_count,
JobTxn *txn, Error **errp)
-@@ -649,7 +650,12 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -636,7 +637,12 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
goto error;
}
@@ -38,10 +38,10 @@ index 5240f71bb5..2ccec79db6 100644
goto error;
}
diff --git a/block/replication.c b/block/replication.c
-index e85c62ba9c..a2ad512251 100644
+index f060755713..b9465c3587 100644
--- a/block/replication.c
+++ b/block/replication.c
-@@ -543,7 +543,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
+@@ -546,7 +546,7 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
0, MIRROR_SYNC_MODE_NONE, NULL, false,
BLOCKDEV_ON_ERROR_REPORT,
BLOCKDEV_ON_ERROR_REPORT, JOB_INTERNAL,
@@ -51,10 +51,10 @@ index e85c62ba9c..a2ad512251 100644
if (local_err) {
error_propagate(errp, local_err);
diff --git a/blockdev.c b/blockdev.c
-index 7e9241cf42..6d16043131 100644
+index 29196c18d8..a95beb823e 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3524,6 +3524,7 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3544,6 +3544,7 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
GList *l;
UuidInfo *uuid_info;
BlockJob *job;
@@ -62,7 +62,7 @@ index 7e9241cf42..6d16043131 100644
if (!backup_state.backup_mutex_initialized) {
qemu_co_mutex_init(&backup_state.backup_mutex);
-@@ -3611,6 +3612,7 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3631,6 +3632,7 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
uuid_generate(uuid);
if (format == BACKUP_FORMAT_VMA) {
@@ -70,7 +70,7 @@ index 7e9241cf42..6d16043131 100644
vmaw = vma_writer_create(task->backup_file, uuid, &local_err);
if (!vmaw) {
if (local_err) {
-@@ -3718,8 +3720,8 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3738,8 +3740,8 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
l = g_list_next(l);
job = backup_job_create(NULL, di->bs, di->target, backup_state.speed, MIRROR_SYNC_MODE_FULL, NULL,
false, BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
@@ -81,16 +81,16 @@ index 7e9241cf42..6d16043131 100644
if (!job || local_err != NULL) {
error_setg(&backup_state.error, "backup_job_create failed");
break;
-@@ -4284,7 +4286,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
+@@ -4312,7 +4314,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
- job_flags, NULL, NULL, NULL, 0, txn, &local_err);
+ job_flags, NULL, 0, NULL, NULL, 0, txn, &local_err);
- bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
-@@ -4394,7 +4396,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
+ goto unref;
+@@ -4417,7 +4419,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->compress,
backup->on_source_error, backup->on_target_error,
@@ -100,10 +100,10 @@ index 7e9241cf42..6d16043131 100644
error_propagate(errp, local_err);
}
diff --git a/include/block/block_int.h b/include/block/block_int.h
-index fd1828cd70..0ac312b359 100644
+index 73a55a7351..13dfee215d 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
-@@ -1144,6 +1144,9 @@ void mirror_start(const char *job_id, BlockDriverState *bs,
+@@ -1156,6 +1156,9 @@ void mirror_start(const char *job_id, BlockDriverState *bs,
* @on_target_error: The action to take upon error writing to the target.
* @creation_flags: Flags that control the behavior of the Job lifetime.
* See @BlockJobCreateFlags
@@ -113,7 +113,7 @@ index fd1828cd70..0ac312b359 100644
* @cb: Completion function for the job.
* @opaque: Opaque pointer value passed to @cb.
* @txn: Transaction that this job is part of (may be NULL).
-@@ -1160,6 +1163,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -1172,6 +1175,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_target_error,
int creation_flags,
BackupDumpFunc *dump_cb,
diff --git a/debian/patches/pve/0036-avoid-calling-dump_cb-with-NULL-data-pointer-for-sma.patch b/debian/patches/pve/0036-avoid-calling-dump_cb-with-NULL-data-pointer-for-sma.patch
index 7fae71f..4771fdd 100644
--- a/debian/patches/pve/0036-avoid-calling-dump_cb-with-NULL-data-pointer-for-sma.patch
+++ b/debian/patches/pve/0036-avoid-calling-dump_cb-with-NULL-data-pointer-for-sma.patch
@@ -12,20 +12,20 @@ Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/backup.c b/block/backup.c
-index 2ccec79db6..cc20d77b9f 100644
+index a3f0d2c9a5..3e99d23e98 100644
--- a/block/backup.c
+++ b/block/backup.c
-@@ -133,7 +133,12 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
+@@ -131,7 +131,12 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
- if (qemu_iovec_is_zero(&qiov)) {
+ if (buffer_is_zero(*bounce_buffer, nbytes)) {
if (job->dump_cb) {
-- ret = job->dump_cb(job->common.job.opaque, job->target, start, qiov.size, NULL);
-+ if (qiov.size == job->cluster_size) {
+- ret = job->dump_cb(job->common.job.opaque, job->target, start, nbytes, NULL);
++ if (nbytes == job->cluster_size) {
+ // Note: pass NULL to indicate that we want to write [0u8; cluster_size]
-+ ret = job->dump_cb(job->common.job.opaque, job->target, start, qiov.size, NULL);
++ ret = job->dump_cb(job->common.job.opaque, job->target, start, nbytes, NULL);
+ } else {
-+ ret = job->dump_cb(job->common.job.opaque, job->target, start, qiov.size, *bounce_buffer);
++ ret = job->dump_cb(job->common.job.opaque, job->target, start, nbytes, *bounce_buffer);
+ }
} else {
ret = blk_co_pwrite_zeroes(job->target, start,
- qiov.size, write_flags | BDRV_REQ_MAY_UNMAP);
+ nbytes, write_flags | BDRV_REQ_MAY_UNMAP);
diff --git a/debian/patches/pve/0037-rename-config_to_vma-into-pvebackup_co_add_config.patch b/debian/patches/pve/0037-rename-config_to_vma-into-pvebackup_co_add_config.patch
index f2ad858..e7d277d 100644
--- a/debian/patches/pve/0037-rename-config_to_vma-into-pvebackup_co_add_config.patch
+++ b/debian/patches/pve/0037-rename-config_to_vma-into-pvebackup_co_add_config.patch
@@ -14,10 +14,10 @@ Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index 6d16043131..786921da0a 100644
+index a95beb823e..530b76c82f 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3416,10 +3416,16 @@ void qmp_backup_cancel(Error **errp)
+@@ -3436,10 +3436,16 @@ void qmp_backup_cancel(Error **errp)
block_on_coroutine_fn(pvebackup_co_cancel, NULL);
}
@@ -37,7 +37,7 @@ index 6d16043131..786921da0a 100644
char *cdata = NULL;
gsize clen = 0;
GError *err = NULL;
-@@ -3429,28 +3435,30 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3449,28 +3455,30 @@ static int config_to_vma(const char *file, BackupFormat format,
}
char *basename = g_path_get_basename(file);
@@ -77,7 +77,7 @@ index 6d16043131..786921da0a 100644
}
bool job_should_pause(Job *job);
-@@ -3526,6 +3534,9 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3546,6 +3554,9 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
BlockJob *job;
int dump_cb_block_size = -1;
@@ -87,7 +87,7 @@ index 6d16043131..786921da0a 100644
if (!backup_state.backup_mutex_initialized) {
qemu_co_mutex_init(&backup_state.backup_mutex);
backup_state.backup_mutex_initialized = true;
-@@ -3670,16 +3681,17 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
+@@ -3690,16 +3701,17 @@ static void coroutine_fn pvebackup_co_start(void *opaque)
goto err;
}
diff --git a/debian/patches/pve/0038-pvebackup_co_dump_cb-do-not-call-job-cancel.patch b/debian/patches/pve/0038-pvebackup_co_dump_cb-do-not-call-job-cancel.patch
index 1ff243f..84282e2 100644
--- a/debian/patches/pve/0038-pvebackup_co_dump_cb-do-not-call-job-cancel.patch
+++ b/debian/patches/pve/0038-pvebackup_co_dump_cb-do-not-call-job-cancel.patch
@@ -9,10 +9,10 @@ The backup loop will automatically abort if we return an error.
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index 786921da0a..a36c4ce23d 100644
+index 530b76c82f..568f71fdb4 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3254,10 +3254,8 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
+@@ -3274,10 +3274,8 @@ static int coroutine_fn pvebackup_co_dump_cb(void *opaque, BlockBackend *target,
if (!backup_state.error) {
vma_writer_error_propagate(backup_state.vmaw, &backup_state.error);
}
diff --git a/debian/patches/pve/0039-fix-backup-job-completion.patch b/debian/patches/pve/0039-fix-backup-job-completion.patch
index f99201a..8b4a9ce 100644
--- a/debian/patches/pve/0039-fix-backup-job-completion.patch
+++ b/debian/patches/pve/0039-fix-backup-job-completion.patch
@@ -12,10 +12,10 @@ jobs in the list.
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index a36c4ce23d..421240fbb8 100644
+index 568f71fdb4..66f2711185 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3339,12 +3339,14 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
+@@ -3359,12 +3359,14 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
backup_state.di_list = g_list_remove(backup_state.di_list, di);
g_free(di);
@@ -32,7 +32,7 @@ index a36c4ce23d..421240fbb8 100644
}
}
-@@ -3490,9 +3492,6 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
+@@ -3510,9 +3512,6 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
}
}
qemu_co_mutex_unlock(&backup_state.backup_mutex);
diff --git a/debian/patches/pve/0040-pvebackup_complete_cb-avoid-poll-loop-if-already-ins.patch b/debian/patches/pve/0040-pvebackup_complete_cb-avoid-poll-loop-if-already-ins.patch
index 7bd11a5..9650476 100644
--- a/debian/patches/pve/0040-pvebackup_complete_cb-avoid-poll-loop-if-already-ins.patch
+++ b/debian/patches/pve/0040-pvebackup_complete_cb-avoid-poll-loop-if-already-ins.patch
@@ -9,10 +9,10 @@ Subject: [PATCH] pvebackup_complete_cb: avoid poll loop if already inside
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
-index 421240fbb8..e889bd13d5 100644
+index 66f2711185..083ada6c8e 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3169,6 +3169,8 @@ static void coroutine_fn block_on_coroutine_wrapper(void *opaque)
+@@ -3189,6 +3189,8 @@ static void coroutine_fn block_on_coroutine_wrapper(void *opaque)
static void block_on_coroutine_fn(CoroutineEntry *entry, void *entry_arg)
{
@@ -21,7 +21,7 @@ index 421240fbb8..e889bd13d5 100644
AioContext *ctx = qemu_get_current_aio_context();
BlockOnCoroutineWrapper wrapper = {
.finished = false,
-@@ -3352,13 +3354,17 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
+@@ -3372,13 +3374,17 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
static void pvebackup_complete_cb(void *opaque, int ret)
{
diff --git a/debian/patches/pve/0041-PVE-backup-consider-source-cluster-size-as-well.patch b/debian/patches/pve/0041-PVE-backup-consider-source-cluster-size-as-well.patch
index b1da126..3c85307 100644
--- a/debian/patches/pve/0041-PVE-backup-consider-source-cluster-size-as-well.patch
+++ b/debian/patches/pve/0041-PVE-backup-consider-source-cluster-size-as-well.patch
@@ -9,10 +9,10 @@ Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/block/backup.c b/block/backup.c
-index cc20d77b9f..cdf815816f 100644
+index 3e99d23e98..dbdc0a76ca 100644
--- a/block/backup.c
+++ b/block/backup.c
-@@ -655,11 +655,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -642,11 +642,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
goto error;
}
diff --git a/qemu b/qemu
index 23967e5..9e06029 160000
--- a/qemu
+++ b/qemu
@@ -1 +1 @@
-Subproject commit 23967e5b2a6c6d04b8db766a8a149f3631a7b899
+Subproject commit 9e06029aea3b2eca1d5261352e695edc1e7d7b8b
--
2.20.1
More information about the pve-devel
mailing list