--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Wed, 2 Oct 2019 09:41:34 +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
+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
+the monitor, thereby preventing the dispatcher from reaching
+the resume() call.
+Fix this by resuming the monitor when clearing a queue which
+was filled up.
+
+Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+---
+ monitor.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+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];
++}
++
+ /* Caller must hold mon->qmp.qmp_queue_lock */
+ static void monitor_qmp_cleanup_req_queue_locked(Monitor *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));
+ }
++ if (need_resume) {
++ /*
++ * Pairs with the monitor_suspend() in handle_qmp_command() in case the
++ * queue gets cleared from a CH_EVENT_CLOSED event before the dispatch
++ * bh got scheduled.
++ */
++ monitor_resume(mon);
++ }
+ }
+
+ 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));
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Thu, 16 May 2019 20:53:20 +0200
-Subject: [PATCH] target/i386: add MDS-NO feature
-
-Microarchitectural Data Sampling is a hardware vulnerability which allows
-unprivileged speculative access to data which is available in various CPU
-internal buffers.
-
-Some Intel processors use the ARCH_CAP_MDS_NO bit in the
-IA32_ARCH_CAPABILITIES
-MSR to report that they are not vulnerable, make it available to guests.
-
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-Message-Id: <20190516185320.28340-1-pbonzini@redhat.com>
-Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- target/i386/cpu.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/target/i386/cpu.c b/target/i386/cpu.c
-index d6bb57d210..ee4b8b47e2 100644
---- a/target/i386/cpu.c
-+++ b/target/i386/cpu.c
-@@ -1183,7 +1183,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
- .type = MSR_FEATURE_WORD,
- .feat_names = {
- "rdctl-no", "ibrs-all", "rsba", "skip-l1dfl-vmentry",
-- "ssb-no", NULL, NULL, NULL,
-+ "ssb-no", "mds-no", NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
---
-2.20.1
-
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Wed, 15 May 2019 15:10:10 +0100
-Subject: [PATCH] target/i386: define md-clear bit
-
-md-clear is a new CPUID bit which is set when microcode provides the
-mechanism to invoke a flush of various exploitable CPU buffers by invoking
-the VERW instruction.
-
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-Message-Id: <20190515141011.5315-2-berrange@redhat.com>
-Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- target/i386/cpu.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/target/i386/cpu.c b/target/i386/cpu.c
-index ee4b8b47e2..331a364a1b 100644
---- a/target/i386/cpu.c
-+++ b/target/i386/cpu.c
-@@ -1076,7 +1076,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
- .feat_names = {
- NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
- NULL, NULL, NULL, NULL,
-- NULL, NULL, NULL, NULL,
-+ NULL, NULL, "md-clear", NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
---
-2.20.1
-
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Stefan Hajnoczi <stefanha@redhat.com>
-Date: Wed, 10 Jul 2019 16:14:40 +0200
-Subject: [PATCH] virtio-balloon: fix QEMU 4.0 config size migration
- incompatibility
-
-The virtio-balloon config size changed in QEMU 4.0 even for existing
-machine types. Migration from QEMU 3.1 to 4.0 can fail in some
-circumstances with the following error:
-
- qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x10 read: a1 device: 1 cmask: ff wmask: c0 w1cmask:0
-
-This happens because the virtio-balloon config size affects the VIRTIO
-Legacy I/O Memory PCI BAR size.
-
-Introduce a qdev property called "qemu-4-0-config-size" and enable it
-only for the QEMU 4.0 machine types. This way <4.0 machine types use
-the old size, 4.0 uses the larger size, and >4.0 machine types use the
-appropriate size depending on enabled virtio-balloon features.
-
-Live migration to and from old QEMUs to QEMU 4.1 works again as long as
-a versioned machine type is specified (do not use just "pc"!).
-
-Originally-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
----
- hw/core/machine.c | 1 +
- hw/virtio/virtio-balloon.c | 28 +++++++++++++++++++++++++---
- include/hw/virtio/virtio-balloon.h | 2 ++
- 3 files changed, 28 insertions(+), 3 deletions(-)
-
-diff --git a/hw/core/machine.c b/hw/core/machine.c
-index 743fef2898..f25c91875f 100644
---- a/hw/core/machine.c
-+++ b/hw/core/machine.c
-@@ -36,6 +36,7 @@ GlobalProperty hw_compat_3_1[] = {
- { "usb-kbd", "serial", "42" },
- { "virtio-blk-device", "discard", "false" },
- { "virtio-blk-device", "write-zeroes", "false" },
-+ { "virtio-balloon-device", "qemu-4-0-config-size", "false" },
- };
- const size_t hw_compat_3_1_len = G_N_ELEMENTS(hw_compat_3_1);
-
-diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
-index d96e4aa96f..c8788ea18d 100644
---- a/hw/virtio/virtio-balloon.c
-+++ b/hw/virtio/virtio-balloon.c
-@@ -615,6 +615,22 @@ virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
- return 0;
- }
-
-+static size_t virtio_balloon_config_size(VirtIOBalloon *s)
-+{
-+ uint64_t features = s->host_features;
-+
-+ if (s->qemu_4_0_config_size) {
-+ return sizeof(struct virtio_balloon_config);
-+ }
-+ if (virtio_has_feature(features, VIRTIO_BALLOON_F_PAGE_POISON)) {
-+ return sizeof(struct virtio_balloon_config);
-+ }
-+ if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
-+ return offsetof(struct virtio_balloon_config, poison_val);
-+ }
-+ return offsetof(struct virtio_balloon_config, free_page_report_cmd_id);
-+}
-+
- static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
- {
- VirtIOBalloon *dev = VIRTIO_BALLOON(vdev);
-@@ -635,7 +651,7 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
- }
-
- trace_virtio_balloon_get_config(config.num_pages, config.actual);
-- memcpy(config_data, &config, sizeof(struct virtio_balloon_config));
-+ memcpy(config_data, &config, virtio_balloon_config_size(dev));
- }
-
- static int build_dimm_list(Object *obj, void *opaque)
-@@ -679,7 +695,7 @@ static void virtio_balloon_set_config(VirtIODevice *vdev,
- uint32_t oldactual = dev->actual;
- ram_addr_t vm_ram_size = get_current_ram_size();
-
-- memcpy(&config, config_data, sizeof(struct virtio_balloon_config));
-+ memcpy(&config, config_data, virtio_balloon_config_size(dev));
- dev->actual = le32_to_cpu(config.actual);
- if (dev->actual != oldactual) {
- qapi_event_send_balloon_change(vm_ram_size -
-@@ -795,7 +811,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
- int ret;
-
- virtio_init(vdev, "virtio-balloon", VIRTIO_ID_BALLOON,
-- sizeof(struct virtio_balloon_config));
-+ virtio_balloon_config_size(s));
-
- ret = qemu_add_balloon_handler(virtio_balloon_to_target,
- virtio_balloon_stat, s);
-@@ -926,6 +942,12 @@ static Property virtio_balloon_properties[] = {
- VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false),
- DEFINE_PROP_BIT("free-page-hint", VirtIOBalloon, host_features,
- VIRTIO_BALLOON_F_FREE_PAGE_HINT, false),
-+ /* QEMU 4.0 accidentally changed the config size even when free-page-hint
-+ * is disabled, resulting in QEMU 3.1 migration incompatibility. This
-+ * property retains this quirk for QEMU 4.1 machine types.
-+ */
-+ DEFINE_PROP_BOOL("qemu-4-0-config-size", VirtIOBalloon,
-+ qemu_4_0_config_size, false),
- DEFINE_PROP_LINK("iothread", VirtIOBalloon, iothread, TYPE_IOTHREAD,
- IOThread *),
- DEFINE_PROP_END_OF_LIST(),
-diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
-index 1afafb12f6..5a99293a45 100644
---- a/include/hw/virtio/virtio-balloon.h
-+++ b/include/hw/virtio/virtio-balloon.h
-@@ -71,6 +71,8 @@ typedef struct VirtIOBalloon {
- int64_t stats_poll_interval;
- uint32_t host_features;
- PartiallyBalloonedPage *pbp;
-+
-+ bool qemu_4_0_config_size;
- } VirtIOBalloon;
-
- #endif
---
-2.20.1
-
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date: Sun, 28 Jul 2019 19:11:24 +0200
-Subject: [PATCH] Fix heap overflow in ip_reass on big packet input
-
-When the first fragment does not fit in the preallocated buffer, q will
-already be pointing to the ext buffer, so we mustn't try to update it.
-
-Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
----
- slirp/src/ip_input.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/slirp/src/ip_input.c b/slirp/src/ip_input.c
-index a714fecd58..0ccb78317f 100644
---- a/slirp/src/ip_input.c
-+++ b/slirp/src/ip_input.c
-@@ -331,6 +331,8 @@ insert:
- q = fp->frag_link.next;
- m = dtom(slirp, q);
-
-+ int was_ext = m->m_flags & M_EXT;
-+
- q = (struct ipasfrag *) q->ipf_next;
- while (q != (struct ipasfrag*)&fp->frag_link) {
- struct mbuf *t = dtom(slirp, q);
-@@ -353,7 +355,7 @@ insert:
- * the old buffer (in the mbuf), so we must point ip
- * into the new buffer.
- */
-- if (m->m_flags & M_EXT) {
-+ if (!was_ext && m->m_flags & M_EXT) {
- int delta = (char *)q - m->m_dat;
- q = (struct ipasfrag *)(m->m_ext + delta);
- }
---
-2.20.1
-
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Wed, 2 Oct 2019 09:41:34 +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
-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
-the monitor, thereby preventing the dispatcher from reaching
-the resume() call.
-Fix this by resuming the monitor when clearing a queue which
-was filled up.
-
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
----
- monitor.c | 21 ++++++++++++++++-----
- 1 file changed, 16 insertions(+), 5 deletions(-)
-
-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];
-+}
-+
- /* Caller must hold mon->qmp.qmp_queue_lock */
- static void monitor_qmp_cleanup_req_queue_locked(Monitor *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));
- }
-+ if (need_resume) {
-+ /*
-+ * Pairs with the monitor_suspend() in handle_qmp_command() in case the
-+ * queue gets cleared from a CH_EVENT_CLOSED event before the dispatch
-+ * bh got scheduled.
-+ */
-+ monitor_resume(mon);
-+ }
- }
-
- 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));
---
-2.20.1
-
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
-index 1cf4ee49eb..89f014f39a 100644
+index c185f34a2e..0613f59c7b 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -428,7 +428,7 @@ static QemuOptsList raw_runtime_opts = {
break;
default:
abort();
---
-2.20.1
-
#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
#define DEFAULT_BRIDGE_INTERFACE "br0"
---
-2.20.1
-
#endif
#define cpu_signal_handler cpu_x86_signal_handler
---
-2.20.1
-
}
x509_key_password = qemu_opt_get(opts, "x509-key-password");
---
-2.20.1
-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
-index f2c15bf1f2..652eb72b2b 100644
+index d98b737b8f..62ab2158f2 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
-@@ -2530,7 +2530,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
+@@ -2533,7 +2533,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
if (tcg_enabled() || qtest_enabled()) {
smm_available = true;
} else if (kvm_enabled()) {
}
if (smm_available) {
---
-2.20.1
-
}
ret = glfs_init(glfs);
---
-2.20.1
-
r = rados_connect(*cluster);
if (r < 0) {
error_setg_errno(errp, -r, "error connecting");
---
-2.20.1
-
'ringbuf-read' ],
'name-case-whitelist': [
'ACPISlotType', # DIMM, visible through query-acpi-ospm-status
---
-2.20.1
-
ret = glfs_discard_async(s->fd, offset, size, gluster_finish_aiocb, &acb);
if (ret < 0) {
---
-2.20.1
-
}
switch (output_format) {
---
-2.20.1
-
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
qemu-img-cmds.hx | 4 +-
- qemu-img.c | 194 +++++++++++++++++++++++++++++------------------
- 2 files changed, 123 insertions(+), 75 deletions(-)
+ qemu-img.c | 192 +++++++++++++++++++++++++++++------------------
+ 2 files changed, 122 insertions(+), 74 deletions(-)
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
index 4b47f7495d..db1df8f60b 100644
- drv = bdrv_find_format(out_fmt);
- if (!drv) {
- error_report("Unknown file format");
-- ret = -1;
-- goto out;
-- }
-- proto_drv = bdrv_find_protocol(out.filename, true, &local_err);
--
-- if (!proto_drv) {
-- error_report_err(local_err);
-- ret = -1;
-- goto out;
-- }
-- if (!drv->create_opts) {
-- error_report("Format driver '%s' does not support image creation",
-- drv->format_name);
-- ret = -1;
-- goto out;
-- }
-- if (!proto_drv->create_opts) {
-- error_report("Protocol driver '%s' does not support image creation",
-- proto_drv->format_name);
-- ret = -1;
-- goto out;
-- }
-- create_opts = qemu_opts_append(create_opts, drv->create_opts);
-- create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
--
-- opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
--
-- size = blk_getlength(blk1);
-- if (size < 0) {
-- error_report("Failed to get size for '%s'", in.filename);
+ if (dd.flags & C_OSIZE) {
+ size = dd.osize;
+ } else if (dd.flags & C_IF) {
ret = -1;
goto out;
}
+- proto_drv = bdrv_find_protocol(out.filename, true, &local_err);
-- if (dd.flags & C_COUNT && dd.count <= INT64_MAX / in.bsz &&
+- if (!proto_drv) {
+- error_report_err(local_err);
+- ret = -1;
+- goto out;
+- }
+- if (!drv->create_opts) {
+- error_report("Format driver '%s' does not support image creation",
+- drv->format_name);
+- ret = -1;
+- goto out;
+- }
+- if (!proto_drv->create_opts) {
+- error_report("Protocol driver '%s' does not support image creation",
+- proto_drv->format_name);
+- ret = -1;
+- goto out;
+ if (!(dd.flags & C_OSIZE) && dd.flags & C_COUNT && dd.count <= INT64_MAX / in.bsz &&
- dd.count * in.bsz < size) {
- size = dd.count * in.bsz;
++ dd.count * in.bsz < size) {
++ size = dd.count * in.bsz;
}
+- create_opts = qemu_opts_append(create_opts, drv->create_opts);
+- create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
-- /* Overflow means the specified offset is beyond input image's size */
-- if (dd.flags & C_SKIP && (in.offset > INT64_MAX / in.bsz ||
-- size < in.bsz * in.offset)) {
-- qemu_opt_set_number(opts, BLOCK_OPT_SIZE, 0, &error_abort);
-- } else {
-- qemu_opt_set_number(opts, BLOCK_OPT_SIZE,
-- size - in.bsz * in.offset, &error_abort);
-- }
+- opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
+ if (dd.flags & C_OF) {
+ drv = bdrv_find_format(out_fmt);
+ if (!drv) {
+ }
+ proto_drv = bdrv_find_protocol(out.filename, true, &local_err);
-- ret = bdrv_create(drv, out.filename, opts, &local_err);
-- if (ret < 0) {
-- error_reportf_err(local_err,
-- "%s: error while creating output image: ",
-- out.filename);
+- size = blk_getlength(blk1);
+- if (size < 0) {
+- error_report("Failed to get size for '%s'", in.filename);
- ret = -1;
- goto out;
- }
+ create_opts = qemu_opts_append(create_opts, drv->create_opts);
+ create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
-- /* TODO, we can't honour --image-opts for the target,
-- * since it needs to be given in a format compatible
-- * with the bdrv_create() call above which does not
-- * support image-opts style.
-- */
-- blk2 = img_open_file(out.filename, NULL, out_fmt, BDRV_O_RDWR,
-- false, false, false);
+- if (dd.flags & C_COUNT && dd.count <= INT64_MAX / in.bsz &&
+- dd.count * in.bsz < size) {
+- size = dd.count * in.bsz;
+- }
+ opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
-- if (!blk2) {
-- ret = -1;
-- goto out;
+- /* Overflow means the specified offset is beyond input image's size */
+- if (dd.flags & C_SKIP && (in.offset > INT64_MAX / in.bsz ||
+- size < in.bsz * in.offset)) {
+- qemu_opt_set_number(opts, BLOCK_OPT_SIZE, 0, &error_abort);
+- } else {
+- qemu_opt_set_number(opts, BLOCK_OPT_SIZE,
+- size - in.bsz * in.offset, &error_abort);
+- }
+ /* Overflow means the specified offset is beyond input image's size */
+ if (dd.flags & C_OSIZE) {
+ qemu_opt_set_number(opts, BLOCK_OPT_SIZE, size, &error_abort);
+ qemu_opt_set_number(opts, BLOCK_OPT_SIZE,
+ size - in.bsz * in.offset, &error_abort);
+ }
-+
+
+- ret = bdrv_create(drv, out.filename, opts, &local_err);
+- if (ret < 0) {
+- error_reportf_err(local_err,
+- "%s: error while creating output image: ",
+- out.filename);
+- ret = -1;
+- goto out;
+- }
+ ret = bdrv_create(drv, out.filename, opts, &local_err);
+ if (ret < 0) {
+ error_reportf_err(local_err,
+ ret = -1;
+ goto out;
+ }
-+
+
+- /* TODO, we can't honour --image-opts for the target,
+- * since it needs to be given in a format compatible
+- * with the bdrv_create() call above which does not
+- * support image-opts style.
+- */
+- blk2 = img_open_file(out.filename, NULL, out_fmt, BDRV_O_RDWR,
+- false, false, false);
+ /* TODO, we can't honour --image-opts for the target,
+ * since it needs to be given in a format compatible
+ * with the bdrv_create() call above which does not
+ */
+ blk2 = img_open_file(out.filename, NULL, out_fmt, BDRV_O_RDWR,
+ false, false, false);
-+
+
+- if (!blk2) {
+- ret = -1;
+- goto out;
+ if (!blk2) {
+ ret = -1;
+ goto out;
error_report("error while writing to output image file: %s",
strerror(-out_ret));
ret = -1;
---
-2.20.1
-
/* early EOF is considered an error */
error_report("Input ended unexpectedly");
ret = -1;
---
-2.20.1
-
}
/* TODO, we can't honour --image-opts for the target,
---
-2.20.1
-
qapi_free_BalloonInfo(info);
}
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
-index 2112874055..d96e4aa96f 100644
+index adde97fe4b..e7f91a3cec 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
-@@ -701,8 +701,37 @@ static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f,
+@@ -712,8 +712,37 @@ static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f,
static void virtio_balloon_stat(void *opaque, BalloonInfo *info)
{
VirtIOBalloon *dev = opaque;
##
# @query-balloon:
---
-2.20.1
-
##
diff --git a/vl.c b/vl.c
-index c696ad2a13..5c4b1a281e 100644
+index c3dee09c9b..98efed1a79 100644
--- a/vl.c
+++ b/vl.c
@@ -1531,6 +1531,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
entry = g_malloc0(sizeof(*entry));
entry->value = info;
entry->next = mach_list;
---
-2.20.1
-
if (port) {
info->has_port = true;
info->port = port;
---
-2.20.1
-
+ return ret;
+}
diff --git a/vl.c b/vl.c
-index 5c4b1a281e..577e9b0f40 100644
+index 98efed1a79..68ca370e19 100644
--- a/vl.c
+++ b/vl.c
-@@ -3006,6 +3006,7 @@ int main(int argc, char **argv, char **envp)
+@@ -3005,6 +3005,7 @@ int main(int argc, char **argv, char **envp)
int optind;
const char *optarg;
const char *loadvm = NULL;
MachineClass *machine_class;
const char *cpu_model;
const char *vga_model = NULL;
-@@ -3573,6 +3574,9 @@ int main(int argc, char **argv, char **envp)
+@@ -3572,6 +3573,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
case QEMU_OPTION_full_screen:
dpy.has_full_screen = true;
dpy.full_screen = true;
-@@ -4580,6 +4584,12 @@ int main(int argc, char **argv, char **envp)
+@@ -4579,6 +4583,12 @@ int main(int argc, char **argv, char **envp)
autostart = 0;
exit(1);
}
}
if (replay_mode != REPLAY_MODE_NONE) {
replay_vmstate_init();
---
-2.20.1
-
+}
+
+block_init(bdrv_zeroinit_init);
---
-2.20.1
-
5 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/backup.c b/block/backup.c
-index 9988753249..51c36d291b 100644
+index 381659d5ef..9ee43981e8 100644
--- a/block/backup.c
+++ b/block/backup.c
-@@ -572,6 +572,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -560,6 +560,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_target_error,
int creation_flags,
BlockCompletionFunc *cb, void *opaque,
JobTxn *txn, Error **errp)
{
int64_t len;
-@@ -705,6 +706,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -677,6 +678,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;
error_propagate(errp, local_err);
backup_job_cleanup(bs);
diff --git a/blockdev.c b/blockdev.c
-index 4775a07d93..ce4506f3af 100644
+index d358169995..a3542db57a 100644
--- a/blockdev.c
+++ b/blockdev.c
-@@ -3550,7 +3550,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
+@@ -3546,7 +3546,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,
bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
-@@ -3660,7 +3660,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
+@@ -3656,7 +3656,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,
job_state_transition(job, JOB_STATUS_RUNNING);
aio_co_enter(job->aio_context, job->co);
}
---
-2.20.1
-
+
+block_init(bdrv_vma_init);
diff --git a/blockdev.c b/blockdev.c
-index ce4506f3af..9210494b47 100644
+index a3542db57a..5d524b9a74 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -31,11 +31,13 @@
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
-@@ -3152,6 +3155,539 @@ out:
+@@ -3148,6 +3151,539 @@ out:
aio_context_release(aio_context);
}
##
# @query-uuid:
#
---
-2.20.1
-
---
Makefile | 3 +-
Makefile.objs | 1 +
- block/backup.c | 103 +++--
+ block/backup.c | 93 +++--
block/replication.c | 1 +
blockdev.c | 208 +++++----
include/block/block_int.h | 4 +
vma-writer.c | 771 ++++++++++++++++++++++++++++++++++
vma.c | 756 +++++++++++++++++++++++++++++++++
vma.h | 150 +++++++
- 11 files changed, 2752 insertions(+), 105 deletions(-)
+ 11 files changed, 2739 insertions(+), 108 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 04a0d45050..0b5a8353ea 100644
+index d4c5750256..a14995fdb3 100644
--- a/Makefile
+++ b/Makefile
@@ -419,7 +419,7 @@ dummy := $(call unnest-vars,, \
block-obj-m = block/
diff --git a/block/backup.c b/block/backup.c
-index 51c36d291b..18598fd491 100644
+index 9ee43981e8..5240f71bb5 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -41,6 +41,7 @@ typedef struct BackupBlockJob {
BlockdevOnError on_source_error;
BlockdevOnError on_target_error;
CoRwlock flush_rwlock;
-@@ -130,12 +131,20 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
+@@ -131,12 +132,20 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
}
if (qemu_iovec_is_zero(&qiov)) {
}
if (ret < 0) {
trace_backup_do_cow_write_fail(job, start, ret);
-@@ -213,7 +222,11 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job,
+@@ -220,8 +229,12 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job,
trace_backup_do_cow_process(job, start);
if (job->use_copy_range) {
-- ret = backup_cow_with_offload(job, start, end, is_write_notifier);
+- ret = backup_cow_with_offload(job, start, dirty_end,
+- is_write_notifier);
+ if (job->dump_cb) {
+ ret = - 1;
+ } else {
-+ ret = backup_cow_with_offload(job, start, end, is_write_notifier);
++ ret = backup_cow_with_offload(job, start, dirty_end,
++ is_write_notifier);
+ }
if (ret < 0) {
job->use_copy_range = false;
}
-@@ -297,7 +310,9 @@ static void backup_abort(Job *job)
+@@ -306,7 +319,9 @@ static void backup_abort(Job *job)
static void backup_clean(Job *job)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
+ }
blk_unref(s->target);
s->target = NULL;
- }
-@@ -306,7 +321,9 @@ static void backup_attached_aio_context(BlockJob *job, AioContext *aio_context)
+
+@@ -320,7 +335,9 @@ static void backup_attached_aio_context(BlockJob *job, AioContext *aio_context)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common);
}
void backup_do_checkpoint(BlockJob *job, Error **errp)
-@@ -347,9 +364,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
+@@ -359,9 +376,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
if (read) {
return block_job_error_action(&job->common, job->on_source_error,
true, error);
}
}
-@@ -571,6 +590,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -559,6 +578,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
int creation_flags,
BlockCompletionFunc *cb, void *opaque,
int pause_count,
JobTxn *txn, Error **errp)
-@@ -581,7 +601,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
- int ret;
+@@ -570,7 +590,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+ HBitmap *copy_bitmap = NULL;
assert(bs);
- assert(target);
if (bs == target) {
error_setg(errp, "Source and target cannot be the same");
-@@ -594,13 +614,13 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -583,23 +603,23 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
return NULL;
}
error_setg(errp, "Compression is not supported for this drive %s",
bdrv_get_device_name(target));
return NULL;
-@@ -610,7 +630,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+ }
+
+- 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)) {
return NULL;
}
return NULL;
}
-@@ -650,15 +670,18 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -629,7 +649,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+ goto error;
+ }
+
+- cluster_size = backup_calculate_cluster_size(target, errp);
++ cluster_size = backup_calculate_cluster_size(target ? target : bs, errp);
+ if (cluster_size < 0) {
+ goto error;
+ }
+@@ -646,15 +666,18 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
goto error;
}
job->on_source_error = on_source_error;
job->on_target_error = on_target_error;
job->sync_mode = sync_mode;
-@@ -669,6 +692,9 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
- /* Detect image-fleecing (and similar) schemes */
- job->serialize_target_writes = bdrv_chain_contains(target, bs);
-
-+ if (!target) {
-+ goto use_default_cluster_size;
-+ }
- /* If there is no backing file on the target, we cannot rely on COW if our
- * backup cluster size is smaller than the target cluster size. Even for
- * targets with a backing file, try to avoid COW if possible. */
-@@ -693,18 +719,35 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
- /* Not fatal; just trudge on ahead. */
- job->cluster_size = BACKUP_CLUSTER_SIZE_DEFAULT;
- } else {
-- job->cluster_size = MAX(BACKUP_CLUSTER_SIZE_DEFAULT, bdi.cluster_size);
-+ use_default_cluster_size:
-+ ret = bdrv_get_info(bs, &bdi);
-+ if (ret < 0) {
-+ job->cluster_size = BACKUP_CLUSTER_SIZE_DEFAULT;
-+ } else {
-+ /* round down to nearest BACKUP_CLUSTER_SIZE_DEFAULT */
-+ job->cluster_size = (bdi.cluster_size / BACKUP_CLUSTER_SIZE_DEFAULT) * BACKUP_CLUSTER_SIZE_DEFAULT;
-+ if (job->cluster_size == 0) {
-+ /* but we can't go below it */
-+ job->cluster_size = BACKUP_CLUSTER_SIZE_DEFAULT;
-+ }
-+ }
-+ }
-+ if (target) {
-+ job->use_copy_range = true;
-+ 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,
-+ QEMU_ALIGN_UP(job->copy_range_size,
-+ job->cluster_size));
-+ } else {
-+ job->use_copy_range = false;
- }
-- job->use_copy_range = true;
+@@ -667,16 +690,20 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+ job->cluster_size = cluster_size;
+ job->copy_bitmap = copy_bitmap;
+ copy_bitmap = NULL;
+- 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,
- QEMU_ALIGN_UP(job->copy_range_size,
- job->cluster_size));
-
+-
- /* Required permissions are already taken with target's blk_new() */
- block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
- &error_abort);
++
+ 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,
++ QEMU_ALIGN_UP(job->copy_range_size,
++ job->cluster_size));
++
+ /* 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->len = len;
job->common.job.pause_count += pause_count;
if (local_err) {
error_propagate(errp, local_err);
diff --git a/blockdev.c b/blockdev.c
-index 9210494b47..f8ce285caa 100644
+index 5d524b9a74..2466a02cbd 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -31,7 +31,6 @@
static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =
QTAILQ_HEAD_INITIALIZER(monitor_bdrv_states);
-@@ -3160,15 +3160,14 @@ out:
+@@ -3156,15 +3156,14 @@ out:
static struct PVEBackupState {
Error *error;
bool cancel;
size_t total;
size_t transferred;
size_t zero_bytes;
-@@ -3187,6 +3186,71 @@ typedef struct PVEBackupDevInfo {
+@@ -3183,6 +3182,71 @@ typedef struct PVEBackupDevInfo {
static void pvebackup_run_next_job(void);
static void pvebackup_cleanup(void)
{
qemu_mutex_lock(&backup_state.backup_mutex);
-@@ -3198,9 +3262,11 @@ static void pvebackup_cleanup(void)
+@@ -3194,9 +3258,11 @@ static void pvebackup_cleanup(void)
backup_state.end_time = time(NULL);
}
g_list_free(backup_state.di_list);
-@@ -3208,6 +3274,13 @@ static void pvebackup_cleanup(void)
+@@ -3204,6 +3270,13 @@ static void pvebackup_cleanup(void)
qemu_mutex_unlock(&backup_state.backup_mutex);
}
static void pvebackup_complete_cb(void *opaque, int ret)
{
// This always runs in the main loop
-@@ -3224,9 +3297,9 @@ static void pvebackup_complete_cb(void *opaque, int ret)
+@@ -3220,9 +3293,9 @@ static void pvebackup_complete_cb(void *opaque, int ret)
di->bs = NULL;
di->target = NULL;
}
// remove self from job queue
-@@ -3254,14 +3327,9 @@ static void pvebackup_cancel(void *opaque)
+@@ -3250,14 +3323,9 @@ static void pvebackup_cancel(void *opaque)
error_setg(&backup_state.error, "backup cancelled");
}
}
GList *l = backup_state.di_list;
-@@ -3292,18 +3360,14 @@ void qmp_backup_cancel(Error **errp)
+@@ -3288,18 +3356,14 @@ void qmp_backup_cancel(Error **errp)
Coroutine *co = qemu_coroutine_create(pvebackup_cancel, NULL);
qemu_coroutine_enter(co);
Error **errp)
{
char *cdata = NULL;
-@@ -3317,7 +3381,12 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3313,7 +3377,12 @@ static int config_to_vma(const char *file, BackupFormat format,
char *basename = g_path_get_basename(file);
if (format == BACKUP_FORMAT_VMA) {
} else if (format == BACKUP_FORMAT_DIR) {
char config_path[PATH_MAX];
snprintf(config_path, PATH_MAX, "%s/%s", backup_dir, basename);
-@@ -3334,28 +3403,30 @@ static int config_to_vma(const char *file, BackupFormat format,
+@@ -3330,28 +3399,30 @@ static int config_to_vma(const char *file, BackupFormat format,
return 0;
}
}
qemu_mutex_unlock(&backup_state.backup_mutex);
-@@ -3366,7 +3437,7 @@ static void pvebackup_run_next_job(void)
+@@ -3362,7 +3433,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,
bool has_devlist, const char *devlist,
bool has_speed, int64_t speed, Error **errp)
{
-@@ -3374,7 +3445,8 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3370,7 +3441,8 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
BlockDriverState *bs = NULL;
const char *backup_dir = NULL;
Error *local_err = NULL;
gchar **devs = NULL;
GList *di_list = NULL;
GList *l;
-@@ -3386,7 +3458,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3382,7 +3454,7 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
backup_state.backup_mutex_initialized = true;
}
error_set(errp, ERROR_CLASS_GENERIC_ERROR,
"previous backup not finished");
return NULL;
-@@ -3461,40 +3533,28 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3457,40 +3529,28 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
total += size;
}
goto err;
}
}
-@@ -3535,14 +3595,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3531,14 +3591,14 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
/* add configuration file to archive */
if (has_config_file) {
goto err;
}
}
-@@ -3565,12 +3625,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3561,12 +3621,13 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
}
backup_state.backup_file = g_strdup(backup_file);
backup_state.total = total;
backup_state.transferred = 0;
-@@ -3581,21 +3642,21 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
+@@ -3577,21 +3638,21 @@ UuidInfo *qmp_backup(const char *backup_file, bool has_format,
while (l) {
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
}
qemu_mutex_unlock(&backup_state.backup_mutex);
-@@ -3631,9 +3692,10 @@ err:
+@@ -3627,9 +3688,10 @@ err:
g_strfreev(devs);
}
}
if (backup_dir) {
-@@ -4086,7 +4148,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
+@@ -4082,7 +4144,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,
bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
-@@ -4196,7 +4258,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
+@@ -4192,7 +4254,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,
+int vma_reader_verify(VmaReader *vmar, bool verbose, Error **errp);
+
+#endif /* BACKUP_VMA_H */
---
-2.20.1
-
if (argc < 2) {
help();
---
-2.20.1
-
if (throttling_group) {
blk_io_limits_enable(blk, throttling_group);
}
---
-2.20.1
-
bool write_zero = true;
if (readmap) {
---
-2.20.1
-
"-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 577e9b0f40..88512e26e9 100644
+index 68ca370e19..bb2cdb8ea9 100644
--- a/vl.c
+++ b/vl.c
-@@ -2994,6 +2994,7 @@ static void user_register_global_props(void)
+@@ -2993,6 +2993,7 @@ static void user_register_global_props(void)
int main(int argc, char **argv, char **envp)
{
int i;
int snapshot, linux_boot;
const char *initrd_filename;
const char *kernel_filename, *kernel_cmdline;
-@@ -3682,6 +3683,13 @@ int main(int argc, char **argv, char **envp)
+@@ -3681,6 +3682,13 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
break;
case QEMU_OPTION_vnc:
vnc_parse(optarg, &error_fatal);
break;
---
-2.20.1
-
}
/* This function is only used for old state version 1 and 2 */
---
-2.20.1
-
2 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
-index 89f014f39a..ad2f9bf243 100644
+index 0613f59c7b..ef5c1bf487 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2223,6 +2223,7 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
},
};
return raw_co_create(&options, errp);
-@@ -2773,7 +2794,7 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
+@@ -2789,7 +2810,7 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
}
/* Copy locks to the new fd */
##
# @BlockdevCreateOptionsGluster:
---
-2.20.1
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Thomas Lamprecht <t.lamprecht@proxmox.com>
+Date: Fri, 21 Jun 2019 10:38:46 +0200
+Subject: [PATCH] PVE: savevm-async: kick AIO wait on block state write
+
+Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+---
+ savevm-async.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/savevm-async.c b/savevm-async.c
+index 2149010bb8..0bbbbf51ba 100644
+--- a/savevm-async.c
++++ b/savevm-async.c
+@@ -154,6 +154,7 @@ static void coroutine_fn block_state_write_entry(void *opaque) {
+ BlkRwCo *rwco = opaque;
+ rwco->ret = blk_co_pwritev(snap_state.target, rwco->offset, rwco->qiov->size,
+ rwco->qiov, 0);
++ aio_wait_kick();
+ }
+
+ static ssize_t block_state_writev_buffer(void *opaque, struct iovec *iov,
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
-Date: Wed, 15 May 2019 15:10:11 +0100
-Subject: [PATCH] docs: recommend use of md-clear feature on all Intel CPUs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Update x86 CPU model guidance to recommend that the md-clear feature is
-manually enabled with all Intel CPU models, when supported by the host
-microcode.
-
-Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-Message-Id: <20190515141011.5315-3-berrange@redhat.com>
-Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-(cherry picked from commit 2c7e82a30774730100da9dbe68d2360459030d91)
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- docs/qemu-cpu-models.texi | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/docs/qemu-cpu-models.texi b/docs/qemu-cpu-models.texi
-index 23c11dc86f..ad040cfc98 100644
---- a/docs/qemu-cpu-models.texi
-+++ b/docs/qemu-cpu-models.texi
-@@ -200,6 +200,18 @@ Not included by default in any Intel CPU model.
- Should be explicitly turned on for all Intel CPU models.
-
- Note that not all CPU hardware will support this feature.
-+
-+@item @code{md-clear}
-+
-+Required to confirm the MDS (CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
-+CVE-2019-11091) fixes.
-+
-+Not included by default in any Intel CPU model.
-+
-+Must be explicitly turned on for all Intel CPU models.
-+
-+Requires the host CPU microcode to support this feature before it
-+can be used for guest CPUs.
- @end table
-
-
---
-2.20.1
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Mon, 24 Jun 2019 10:19:50 +0200
+Subject: [PATCH] PVE: move snapshot cleanup into bottom half
+
+as per:
+ (0ceccd858a8d) migration: qemu_savevm_state_cleanup() in cleanup
+
+may affect held locks and therefore change assumptions made
+by that function!
+
+Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+---
+ savevm-async.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/savevm-async.c b/savevm-async.c
+index 0bbbbf51ba..f9355c5036 100644
+--- a/savevm-async.c
++++ b/savevm-async.c
+@@ -197,6 +197,8 @@ static void process_savevm_cleanup(void *opaque)
+ int ret;
+ qemu_bh_delete(snap_state.cleanup_bh);
+ snap_state.cleanup_bh = NULL;
++ qemu_savevm_state_cleanup();
++
+ qemu_mutex_unlock_iothread();
+ qemu_thread_join(&snap_state.thread);
+ qemu_mutex_lock_iothread();
+@@ -273,7 +275,6 @@ static void *process_savevm_thread(void *opaque)
+ save_snapshot_error("qemu_savevm_state_iterate error %d", ret);
+ break;
+ }
+- qemu_savevm_state_cleanup();
+ DPRINTF("save complete\n");
+ break;
+ }
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Thomas Lamprecht <t.lamprecht@proxmox.com>
-Date: Fri, 21 Jun 2019 10:38:46 +0200
-Subject: [PATCH] PVE: savevm-async: kick AIO wait on block state write
-
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- savevm-async.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/savevm-async.c b/savevm-async.c
-index 2149010bb8..0bbbbf51ba 100644
---- a/savevm-async.c
-+++ b/savevm-async.c
-@@ -154,6 +154,7 @@ static void coroutine_fn block_state_write_entry(void *opaque) {
- BlkRwCo *rwco = opaque;
- rwco->ret = blk_co_pwritev(snap_state.target, rwco->offset, rwco->qiov->size,
- rwco->qiov, 0);
-+ aio_wait_kick();
- }
-
- static ssize_t block_state_writev_buffer(void *opaque, struct iovec *iov,
---
-2.20.1
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Tue, 25 Jun 2019 11:17:58 +0200
+Subject: [PATCH] PVE: monitor: disable oob capability
+
+A bisect revealed that commit 8258292e18c3
+("monitor: Remove "x-oob", offer capability "oob" unconditionally")
+causes unexpected hangs when restoring live snapshots from some
+types of block devices (particularly RBD).
+We need to figure out what's happnening there. For now, since we
+had this disabled before and probably don't need it now either,
+disable oob, so we can get a functioning qemu out...
+
+Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+---
+ monitor.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 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;
+
+ /* 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);
+
+ qemu_chr_fe_init(&mon->chr, chr, &error_abort);
+ mon->flags = flags;
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Mon, 24 Jun 2019 10:19:50 +0200
-Subject: [PATCH] PVE: move snapshot cleanup into bottom half
-
-as per:
- (0ceccd858a8d) migration: qemu_savevm_state_cleanup() in cleanup
-
-may affect held locks and therefore change assumptions made
-by that function!
-
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- savevm-async.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/savevm-async.c b/savevm-async.c
-index 0bbbbf51ba..f9355c5036 100644
---- a/savevm-async.c
-+++ b/savevm-async.c
-@@ -197,6 +197,8 @@ static void process_savevm_cleanup(void *opaque)
- int ret;
- qemu_bh_delete(snap_state.cleanup_bh);
- snap_state.cleanup_bh = NULL;
-+ qemu_savevm_state_cleanup();
-+
- qemu_mutex_unlock_iothread();
- qemu_thread_join(&snap_state.thread);
- qemu_mutex_lock_iothread();
-@@ -273,7 +275,6 @@ static void *process_savevm_thread(void *opaque)
- save_snapshot_error("qemu_savevm_state_iterate error %d", ret);
- break;
- }
-- qemu_savevm_state_cleanup();
- DPRINTF("save complete\n");
- break;
- }
---
-2.20.1
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dietmar Maurer <dietmar@proxmox.com>
+Date: Mon, 21 Oct 2019 11:51:57 +0200
+Subject: [PATCH] PVE bug fix #1071 - vma-writer.c: use correct AioContext
+
+Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
+---
+ vma-writer.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/vma-writer.c b/vma-writer.c
+index fd9567634d..b163fa2d3a 100644
+--- a/vma-writer.c
++++ b/vma-writer.c
+@@ -199,12 +199,14 @@ int vma_writer_register_stream(VmaWriter *vmaw, const char *devname,
+ return n;
+ }
+
+-static void vma_co_continue_write(void *opaque)
++static void coroutine_fn yield_until_fd_writable(int fd)
+ {
+- VmaWriter *vmaw = opaque;
+-
+- DPRINTF("vma_co_continue_write\n");
+- qemu_coroutine_enter(vmaw->co_writer);
++ assert(qemu_in_coroutine());
++ AioContext *ctx = qemu_get_current_aio_context();
++ aio_set_fd_handler(ctx, fd, false, NULL, (IOHandler *)qemu_coroutine_enter,
++ NULL, qemu_coroutine_self());
++ qemu_coroutine_yield();
++ aio_set_fd_handler(ctx, fd, false, NULL, NULL, NULL, NULL);
+ }
+
+ static ssize_t coroutine_fn
+@@ -224,14 +226,12 @@ vma_queue_write(VmaWriter *vmaw, const void *buf, size_t bytes)
+ vmaw->co_writer = qemu_coroutine_self();
+
+ while (done < bytes) {
+- aio_set_fd_handler(qemu_get_aio_context(), vmaw->fd, false, NULL, vma_co_continue_write, NULL, vmaw);
+- qemu_coroutine_yield();
+- aio_set_fd_handler(qemu_get_aio_context(), vmaw->fd, false, NULL, NULL, NULL, NULL);
+ if (vmaw->status < 0) {
+ DPRINTF("vma_queue_write detected canceled backup\n");
+ done = -1;
+ break;
+ }
++ yield_until_fd_writable(vmaw->fd);
+ ret = write(vmaw->fd, buf + done, bytes - done);
+ if (ret > 0) {
+ done += ret;
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Tue, 25 Jun 2019 11:17:58 +0200
-Subject: [PATCH] PVE: monitor: disable oob capability
-
-A bisect revealed that commit 8258292e18c3
-("monitor: Remove "x-oob", offer capability "oob" unconditionally")
-causes unexpected hangs when restoring live snapshots from some
-types of block devices (particularly RBD).
-We need to figure out what's happnening there. For now, since we
-had this disabled before and probably don't need it now either,
-disable oob, so we can get a functioning qemu out...
-
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
----
- monitor.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/monitor.c b/monitor.c
-index 4807bbe811..f8d2338667 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -4605,10 +4605,7 @@ void monitor_init(Chardev *chr, int flags)
- bool use_readline = flags & MONITOR_USE_READLINE;
-
- /* 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);
-
- qemu_chr_fe_init(&mon->chr, chr, &error_abort);
- mon->flags = flags;
---
-2.20.1
-
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Dietmar Maurer <dietmar@proxmox.com>
-Date: Mon, 21 Oct 2019 11:51:57 +0200
-Subject: [PATCH] PVE bug fix #1071 - vma-writer.c: use correct AioContext
-
-Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
----
- vma-writer.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/vma-writer.c b/vma-writer.c
-index fd9567634d..b163fa2d3a 100644
---- a/vma-writer.c
-+++ b/vma-writer.c
-@@ -199,12 +199,14 @@ int vma_writer_register_stream(VmaWriter *vmaw, const char *devname,
- return n;
- }
-
--static void vma_co_continue_write(void *opaque)
-+static void coroutine_fn yield_until_fd_writable(int fd)
- {
-- VmaWriter *vmaw = opaque;
--
-- DPRINTF("vma_co_continue_write\n");
-- qemu_coroutine_enter(vmaw->co_writer);
-+ assert(qemu_in_coroutine());
-+ AioContext *ctx = qemu_get_current_aio_context();
-+ aio_set_fd_handler(ctx, fd, false, NULL, (IOHandler *)qemu_coroutine_enter,
-+ NULL, qemu_coroutine_self());
-+ qemu_coroutine_yield();
-+ aio_set_fd_handler(ctx, fd, false, NULL, NULL, NULL, NULL);
- }
-
- static ssize_t coroutine_fn
-@@ -224,14 +226,12 @@ vma_queue_write(VmaWriter *vmaw, const void *buf, size_t bytes)
- vmaw->co_writer = qemu_coroutine_self();
-
- while (done < bytes) {
-- aio_set_fd_handler(qemu_get_aio_context(), vmaw->fd, false, NULL, vma_co_continue_write, NULL, vmaw);
-- qemu_coroutine_yield();
-- aio_set_fd_handler(qemu_get_aio_context(), vmaw->fd, false, NULL, NULL, NULL, NULL);
- if (vmaw->status < 0) {
- DPRINTF("vma_queue_write detected canceled backup\n");
- done = -1;
- break;
- }
-+ yield_until_fd_writable(vmaw->fd);
- ret = write(vmaw->fd, buf + done, bytes - done);
- if (ret > 0) {
- done += ret;
---
-2.20.1
-extra/0001-target-i386-add-MDS-NO-feature.patch
-extra/0002-target-i386-define-md-clear-bit.patch
-extra/0003-virtio-balloon-fix-QEMU-4.0-config-size-migration-in.patch
-extra/0004-Fix-heap-overflow-in-ip_reass-on-big-packet-input.patch
-extra/0005-monitor-qmp-resume-monitor-when-clearing-its-queue.patch
+extra/0001-monitor-qmp-resume-monitor-when-clearing-its-queue.patch
pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch
pve/0002-PVE-Config-Adjust-network-script-path-to-etc-kvm.patch
pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch
pve/0025-PVE-Add-dummy-id-command-line-parameter.patch
pve/0026-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch
pve/0027-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch
-pve/0028-docs-recommend-use-of-md-clear-feature-on-all-Intel-.patch
-pve/0029-PVE-savevm-async-kick-AIO-wait-on-block-state-write.patch
-pve/0030-PVE-move-snapshot-cleanup-into-bottom-half.patch
-pve/0031-PVE-monitor-disable-oob-capability.patch
-pve/0032-PVE-bug-fix-1071-vma-writer.c-use-correct-AioContext.patch
+pve/0028-PVE-savevm-async-kick-AIO-wait-on-block-state-write.patch
+pve/0029-PVE-move-snapshot-cleanup-into-bottom-half.patch
+pve/0030-PVE-monitor-disable-oob-capability.patch
+pve/0031-PVE-bug-fix-1071-vma-writer.c-use-correct-AioContext.patch
-Subproject commit 131b9a05705636086699df15d4a6d328bb2585e8
+Subproject commit 23967e5b2a6c6d04b8db766a8a149f3631a7b899