# also update debian/changelog
KVMVER=2.0
-KVMPKGREL=1
+KVMPKGREL=2
KVMPACKAGE=pve-qemu-kvm
KVMDIR=qemu-kvm
download:
rm -rf ${KVMDIR} ${KVMSRC}
git clone git://git.qemu-project.org/qemu.git -b master ${KVMDIR}
- cd ${KVMDIR}; git checkout v2.0.0
+ #cd ${KVMDIR}; git checkout v2.0.0
tar czf ${KVMSRC} --exclude CVS --exclude .git --exclude .svn ${KVMDIR}
${KVM_DEB} kvm: ${KVMSRC}
+pve-qemu-kvm (2.0-2) unstable; urgency=low
+
+ * update to latest qemu (commit 2a2c4830c0068d70443f3dddc4cc668f0c601b5c)
+
+ -- Proxmox Support Team <support@proxmox.com> Thu, 12 Jun 2014 10:20:10 +0200
+
pve-qemu-kvm (2.0-1) unstable; urgency=low
* update to qemu 2.0
Index: new/qapi-schema.json
===================================================================
---- new.orig/qapi-schema.json 2014-05-05 09:28:22.000000000 +0200
-+++ new/qapi-schema.json 2014-05-05 09:32:34.000000000 +0200
-@@ -666,7 +666,7 @@
+--- new.orig/qapi-schema.json 2014-06-12 11:39:32.000000000 +0200
++++ new/qapi-schema.json 2014-06-12 11:51:17.000000000 +0200
+@@ -379,7 +379,7 @@
# @vma: Proxmox vma backup format
##
{ 'enum': 'BackupFormat',
# @backup:
Index: new/blockdev.c
===================================================================
---- new.orig/blockdev.c 2014-05-05 09:28:22.000000000 +0200
-+++ new/blockdev.c 2014-05-05 09:36:50.000000000 +0200
-@@ -1850,6 +1850,8 @@
+--- new.orig/blockdev.c 2014-06-12 11:49:28.000000000 +0200
++++ new/blockdev.c 2014-06-12 12:05:39.000000000 +0200
+@@ -1902,6 +1902,8 @@
uint8_t dev_id;
//bool started;
bool completed;
} PVEBackupDevInfo;
static void pvebackup_run_next_job(void);
-@@ -1918,8 +1920,6 @@
+@@ -1970,8 +1972,6 @@
{
PVEBackupDevInfo *di = opaque;
di->completed = true;
if (ret < 0 && !backup_state.error) {
-@@ -1930,8 +1930,11 @@
+@@ -1982,8 +1982,11 @@
BlockDriverState *bs = di->bs;
di->bs = NULL;
block_job_cb(bs, ret);
-@@ -2008,6 +2011,7 @@
+@@ -2060,6 +2063,7 @@
bool has_speed, int64_t speed, Error **errp)
{
BlockDriverState *bs;
Error *local_err = NULL;
uuid_t uuid;
VmaWriter *vmaw = NULL;
-@@ -2024,11 +2028,6 @@
+@@ -2076,11 +2080,6 @@
/* Todo: try to auto-detect format based on file name */
format = has_format ? format : BACKUP_FORMAT_VMA;
if (has_devlist) {
devs = g_strsplit_set(devlist, ",;:", -1);
-@@ -2096,27 +2095,63 @@
+@@ -2147,27 +2146,63 @@
uuid_generate(uuid);
- vmaw = vma_writer_create(backup_file, uuid, &local_err);
- if (!vmaw) {
-- if (error_is_set(&local_err)) {
+- if (local_err) {
- error_propagate(errp, local_err);
+ if (format == BACKUP_FORMAT_VMA) {
+ vmaw = vma_writer_create(backup_file, uuid, &local_err);
+ if (!vmaw) {
-+ if (error_is_set(&local_err)) {
++ if (local_err) {
+ error_propagate(errp, local_err);
+ }
+ goto err;
+ int flags = BDRV_O_RDWR|BDRV_O_CACHE_WB;
+ bdrv_img_create(di->targetfile, "raw", NULL, NULL, NULL,
+ di->size, flags, &local_err, false);
-+ if (error_is_set(&local_err)) {
++ if (local_err) {
+ error_propagate(errp, local_err);
+ goto err;
+ }
+
-+ di->target = bdrv_new("");
++ di->target = bdrv_new("", &error_abort);
+ if (bdrv_open(&di->target, di->targetfile, NULL, NULL, flags, NULL, &local_err) < 0) {
+ bdrv_unref(di->target);
+ error_propagate(errp, local_err);
}
/* add configuration file to archive */
-@@ -2129,12 +2164,27 @@
+@@ -2180,12 +2215,27 @@
goto err;
}
g_free(cdata);
}
-@@ -2174,10 +2224,11 @@
+@@ -2225,10 +2275,11 @@
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
if (local_err != NULL) {
error_setg(&backup_state.error, "backup_job_create failed");
pvebackup_cancel(NULL);
-@@ -2194,8 +2245,17 @@
+@@ -2245,8 +2296,17 @@
l = di_list;
while (l) {
}
g_list_free(di_list);
-@@ -2209,6 +2269,10 @@
+@@ -2260,6 +2320,10 @@
unlink(backup_file);
}
Index: new/hmp-commands.hx
===================================================================
---- new.orig/hmp-commands.hx 2014-05-05 09:28:22.000000000 +0200
-+++ new/hmp-commands.hx 2014-05-05 09:32:34.000000000 +0200
+--- new.orig/hmp-commands.hx 2014-06-12 11:39:32.000000000 +0200
++++ new/hmp-commands.hx 2014-06-12 11:51:17.000000000 +0200
@@ -90,9 +90,11 @@
{
Index: new/hmp.c
===================================================================
---- new.orig/hmp.c 2014-05-05 09:28:22.000000000 +0200
-+++ new/hmp.c 2014-05-05 09:32:34.000000000 +0200
-@@ -1248,11 +1248,13 @@
+--- new.orig/hmp.c 2014-06-12 11:39:32.000000000 +0200
++++ new/hmp.c 2014-06-12 11:51:17.000000000 +0200
+@@ -1258,11 +1258,13 @@
{
Error *error = NULL;
Index: new/blockdev.c
===================================================================
---- new.orig/blockdev.c 2014-05-05 09:16:48.000000000 +0200
-+++ new/blockdev.c 2014-05-05 09:28:22.000000000 +0200
-@@ -45,6 +45,7 @@
+--- new.orig/blockdev.c 2014-06-12 11:39:00.000000000 +0200
++++ new/blockdev.c 2014-06-12 11:49:28.000000000 +0200
+@@ -44,6 +44,7 @@
#include "qmp-commands.h"
#include "trace.h"
#include "sysemu/arch_init.h"
static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives);
-@@ -1513,7 +1514,6 @@
+@@ -1556,7 +1557,6 @@
}
}
-
static void eject_device(BlockDriverState *bs, int force, Error **errp)
{
- if (bdrv_in_use(bs)) {
-@@ -1826,6 +1826,437 @@
+ if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_EJECT, errp)) {
+@@ -1878,6 +1878,436 @@
bdrv_put_ref_bh_schedule(bs);
}
+ while (l) {
+ PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
+ l = g_list_next(l);
-+ if (bdrv_in_use(di->bs)) {
-+ error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(di->bs));
++ if (bdrv_op_is_blocked(di->bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
+ goto err;
+ }
+
+
+ vmaw = vma_writer_create(backup_file, uuid, &local_err);
+ if (!vmaw) {
-+ if (error_is_set(&local_err)) {
++ if (local_err) {
+ error_propagate(errp, local_err);
+ }
+ goto err;
bool has_on_error, BlockdevOnError on_error,
Index: new/hmp-commands.hx
===================================================================
---- new.orig/hmp-commands.hx 2014-05-05 06:55:26.000000000 +0200
-+++ new/hmp-commands.hx 2014-05-05 09:28:22.000000000 +0200
+--- new.orig/hmp-commands.hx 2014-06-12 10:19:18.000000000 +0200
++++ new/hmp-commands.hx 2014-06-12 11:39:32.000000000 +0200
@@ -88,6 +88,35 @@
Copy data from a backing file into a block device.
ETEXI
{
.name = "block_job_set_speed",
.args_type = "device:B,speed:o",
-@@ -1738,6 +1767,8 @@
+@@ -1764,6 +1793,8 @@
show CPU statistics
@item info usernet
show user network stack connection states
@item info migrate_capabilities
Index: new/hmp.c
===================================================================
---- new.orig/hmp.c 2014-05-05 07:34:43.000000000 +0200
-+++ new/hmp.c 2014-05-05 09:28:22.000000000 +0200
-@@ -134,6 +134,44 @@
+--- new.orig/hmp.c 2014-06-12 10:50:04.000000000 +0200
++++ new/hmp.c 2014-06-12 11:39:32.000000000 +0200
+@@ -135,6 +135,44 @@
qapi_free_MouseInfoList(mice_list);
}
void hmp_info_migrate(Monitor *mon, const QDict *qdict)
{
MigrationInfo *info;
-@@ -1196,6 +1234,29 @@
+@@ -1206,6 +1244,29 @@
hmp_handle_error(mon, &error);
}
{
Index: new/hmp.h
===================================================================
---- new.orig/hmp.h 2014-05-05 06:55:26.000000000 +0200
-+++ new/hmp.h 2014-05-05 09:28:22.000000000 +0200
-@@ -28,6 +28,7 @@
+--- new.orig/hmp.h 2014-06-12 10:19:18.000000000 +0200
++++ new/hmp.h 2014-06-12 11:39:32.000000000 +0200
+@@ -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_cache_size(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);
-@@ -69,6 +70,8 @@
+@@ -70,6 +71,8 @@
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_block_job_pause(Monitor *mon, const QDict *qdict);
Index: new/monitor.c
===================================================================
---- new.orig/monitor.c 2014-05-05 06:55:26.000000000 +0200
-+++ new/monitor.c 2014-05-05 09:28:22.000000000 +0200
-@@ -2903,6 +2903,13 @@
+--- new.orig/monitor.c 2014-06-12 10:19:18.000000000 +0200
++++ new/monitor.c 2014-06-12 11:39:32.000000000 +0200
+@@ -2897,6 +2897,13 @@
},
#endif
{
.params = "",
Index: new/qapi-schema.json
===================================================================
---- new.orig/qapi-schema.json 2014-05-05 08:17:59.000000000 +0200
-+++ new/qapi-schema.json 2014-05-05 09:28:22.000000000 +0200
-@@ -627,6 +627,95 @@
+--- new.orig/qapi-schema.json 2014-06-12 11:13:26.000000000 +0200
++++ new/qapi-schema.json 2014-06-12 11:39:32.000000000 +0200
+@@ -340,6 +340,95 @@
##
{ 'command': 'query-events', 'returns': ['EventInfo'] }
#
Index: new/qmp-commands.hx
===================================================================
---- new.orig/qmp-commands.hx 2014-05-05 07:34:43.000000000 +0200
-+++ new/qmp-commands.hx 2014-05-05 09:28:22.000000000 +0200
+--- new.orig/qmp-commands.hx 2014-06-12 10:50:04.000000000 +0200
++++ new/qmp-commands.hx 2014-06-12 11:39:32.000000000 +0200
@@ -1080,6 +1080,24 @@
EQMP
Index: new/Makefile
===================================================================
---- new.orig/Makefile 2014-05-05 07:52:59.000000000 +0200
-+++ new/Makefile 2014-05-05 07:58:22.000000000 +0200
+--- new.orig/Makefile 2014-06-12 10:19:18.000000000 +0200
++++ new/Makefile 2014-06-12 11:17:40.000000000 +0200
@@ -146,7 +146,7 @@
include $(SRC_PATH)/libcacard/Makefile
endif
-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
+all: $(DOCS) $(TOOLS) vma$(EXESUF) $(HELPERS-y) recurse-all modules
- vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
-@@ -220,6 +220,7 @@
+ config-host.h: config-host.h-timestamp
+ config-host.h-timestamp: config-host.mak
+@@ -214,6 +214,7 @@
qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
qemu-io$(EXESUF): qemu-io.o $(block-obj-y) libqemuutil.a libqemustub.a
Index: new/vma-reader.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-reader.c 2014-05-05 07:58:22.000000000 +0200
++++ new/vma-reader.c 2014-06-12 11:17:40.000000000 +0200
@@ -0,0 +1,799 @@
+/*
+ * VMA: Virtual Machine Archive
Index: new/vma-writer.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-writer.c 2014-05-05 07:58:22.000000000 +0200
++++ new/vma-writer.c 2014-06-12 11:17:40.000000000 +0200
@@ -0,0 +1,875 @@
+/*
+ * VMA: Virtual Machine Archive
Index: new/vma.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.c 2014-05-05 07:58:22.000000000 +0200
-@@ -0,0 +1,579 @@
++++ new/vma.c 2014-06-12 11:37:50.000000000 +0200
+@@ -0,0 +1,583 @@
+/*
+ * VMA: Virtual Machine Archive
+ *
+
+ bdrv_img_create(devfn, "raw", NULL, NULL, NULL, di->size,
+ flags, &errp, 0);
-+ if (error_is_set(&errp)) {
++ if (errp) {
+ g_error("can't create file %s: %s", devfn,
+ error_get_pretty(errp));
+ }
+ write_zero = false;
+ }
+
-+ BlockDriverState *bs = bdrv_new(di->devname);
-+ if (bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
++ BlockDriverState *bs = bdrv_new(di->devname, &errp);
++ if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
+ g_error("can't open file %s - %s", devfn,
+ error_get_pretty(errp));
+ }
+ path = extract_devname(path, &devname, ind++);
+
+ BlockDriver *drv = NULL;
-+ BlockDriverState *bs = bdrv_new(devname);
+ Error *errp = NULL;
-+
++ BlockDriverState *bs = bdrv_new(devname, &errp);
++
++ if (errp) {
++ g_error("bdrv_new '%s' failed - %s", devname, error_get_pretty(errp));
++ }
++
+ res = bdrv_open(&bs, path, NULL, NULL, BDRV_O_CACHE_WB , drv, &errp);
+ if (res < 0) {
+ unlink(archivename);
Index: new/vma.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.h 2014-05-05 07:58:22.000000000 +0200
++++ new/vma.h 2014-06-12 11:17:40.000000000 +0200
@@ -0,0 +1,146 @@
+/*
+ * VMA: Virtual Machine Archive
+#endif /* BACKUP_VMA_H */
Index: new/Makefile.objs
===================================================================
---- new.orig/Makefile.objs 2014-05-05 07:52:59.000000000 +0200
-+++ new/Makefile.objs 2014-05-05 07:58:22.000000000 +0200
+--- new.orig/Makefile.objs 2014-06-12 10:19:18.000000000 +0200
++++ new/Makefile.objs 2014-06-12 11:17:40.000000000 +0200
@@ -14,6 +14,7 @@
block-obj-y += block/
block-obj-y += qapi-types.o qapi-visit.o
Index: new/Makefile.objs
===================================================================
---- new.orig/Makefile.objs 2014-05-05 09:49:29.000000000 +0200
-+++ new/Makefile.objs 2014-05-05 09:54:17.000000000 +0200
-@@ -55,6 +55,7 @@
+--- new.orig/Makefile.objs 2014-06-12 11:17:40.000000000 +0200
++++ new/Makefile.objs 2014-06-12 12:08:10.000000000 +0200
+@@ -57,6 +57,7 @@
common-obj-y += qemu-char.o #aio.o
common-obj-y += block-migration.o
common-obj-y += page_cache.o xbzrle.o
Index: new/block.c
===================================================================
---- new.orig/block.c 2014-05-05 09:49:29.000000000 +0200
-+++ new/block.c 2014-05-05 09:54:17.000000000 +0200
-@@ -1967,7 +1967,7 @@
- bs_new->drv ? bs_new->drv->format_name : "");
+--- new.orig/block.c 2014-06-12 10:19:18.000000000 +0200
++++ new/block.c 2014-06-12 12:08:10.000000000 +0200
+@@ -2077,7 +2077,7 @@
+ bdrv_set_backing_hd(bs_top, bs_new);
}
-static void bdrv_delete(BlockDriverState *bs)
assert(!bs->job);
Index: new/hmp-commands.hx
===================================================================
---- new.orig/hmp-commands.hx 2014-05-05 09:49:29.000000000 +0200
-+++ new/hmp-commands.hx 2014-05-05 09:54:17.000000000 +0200
-@@ -1777,6 +1777,8 @@
+--- new.orig/hmp-commands.hx 2014-06-12 11:51:17.000000000 +0200
++++ new/hmp-commands.hx 2014-06-12 12:08:10.000000000 +0200
+@@ -1803,6 +1803,8 @@
show current migration capabilities
@item info migrate_cache_size
show current migration XBZRLE cache size
@item info balloon
show balloon information
@item info qtree
-@@ -1798,3 +1800,35 @@
+@@ -1824,3 +1826,35 @@
STEXI
@end table
ETEXI
+ },
Index: new/hmp.c
===================================================================
---- new.orig/hmp.c 2014-05-05 09:49:29.000000000 +0200
-+++ new/hmp.c 2014-05-05 09:54:17.000000000 +0200
-@@ -1738,3 +1738,60 @@
+--- new.orig/hmp.c 2014-06-12 11:51:17.000000000 +0200
++++ new/hmp.c 2014-06-12 12:08:10.000000000 +0200
+@@ -1767,3 +1767,60 @@
qmp_object_del(id, &err);
hmp_handle_error(mon, &err);
}
+}
Index: new/hmp.h
===================================================================
---- new.orig/hmp.h 2014-05-05 09:49:29.000000000 +0200
-+++ new/hmp.h 2014-05-05 09:54:17.000000000 +0200
-@@ -25,6 +25,7 @@
+--- new.orig/hmp.h 2014-06-12 11:39:32.000000000 +0200
++++ new/hmp.h 2014-06-12 12:08:10.000000000 +0200
+@@ -26,6 +26,7 @@
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_migrate(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
-@@ -84,6 +85,10 @@
+@@ -85,6 +86,10 @@
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_nbd_server_start(Monitor *mon, const QDict *qdict);
Index: new/include/block/block.h
===================================================================
---- new.orig/include/block/block.h 2014-05-05 09:49:29.000000000 +0200
-+++ new/include/block/block.h 2014-05-05 09:54:17.000000000 +0200
-@@ -251,6 +251,7 @@
+--- new.orig/include/block/block.h 2014-06-12 10:19:18.000000000 +0200
++++ new/include/block/block.h 2014-06-12 12:08:10.000000000 +0200
+@@ -279,6 +279,7 @@
const char *backing_file);
int bdrv_get_backing_file_depth(BlockDriverState *bs);
int bdrv_truncate(BlockDriverState *bs, int64_t offset);
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
Index: new/include/sysemu/sysemu.h
===================================================================
---- new.orig/include/sysemu/sysemu.h 2014-05-05 09:49:29.000000000 +0200
-+++ new/include/sysemu/sysemu.h 2014-05-05 09:54:17.000000000 +0200
+--- new.orig/include/sysemu/sysemu.h 2014-06-12 10:19:18.000000000 +0200
++++ new/include/sysemu/sysemu.h 2014-06-12 12:08:10.000000000 +0200
@@ -73,16 +73,17 @@
void do_savevm(Monitor *mon, const QDict *qdict);
int qemu_loadvm_state(QEMUFile *f);
Index: new/monitor.c
===================================================================
---- new.orig/monitor.c 2014-05-05 09:49:29.000000000 +0200
-+++ new/monitor.c 2014-05-05 09:54:17.000000000 +0200
-@@ -2931,6 +2931,13 @@
+--- new.orig/monitor.c 2014-06-12 11:39:32.000000000 +0200
++++ new/monitor.c 2014-06-12 12:08:10.000000000 +0200
+@@ -2925,6 +2925,13 @@
.mhandler.cmd = hmp_info_migrate_cache_size,
},
{
.params = "",
Index: new/qapi-schema.json
===================================================================
---- new.orig/qapi-schema.json 2014-05-05 09:49:29.000000000 +0200
-+++ new/qapi-schema.json 2014-05-05 09:54:17.000000000 +0200
-@@ -820,6 +820,42 @@
+--- new.orig/qapi-schema.json 2014-06-12 11:51:17.000000000 +0200
++++ new/qapi-schema.json 2014-06-12 12:08:10.000000000 +0200
+@@ -538,6 +538,42 @@
'*downtime': 'int',
'*setup-time': 'int'} }
##
# @query-migrate
#
-@@ -3687,8 +3723,18 @@
+@@ -2497,8 +2533,18 @@
#
# Since: 1.2.0
##
#
Index: new/qemu-options.hx
===================================================================
---- new.orig/qemu-options.hx 2014-05-05 09:49:29.000000000 +0200
-+++ new/qemu-options.hx 2014-05-05 09:54:17.000000000 +0200
-@@ -2759,6 +2759,19 @@
+--- new.orig/qemu-options.hx 2014-06-12 10:39:20.000000000 +0200
++++ new/qemu-options.hx 2014-06-12 12:08:10.000000000 +0200
+@@ -2838,6 +2838,19 @@
Start right away with a saved state (@code{loadvm} in monitor)
ETEXI
"-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
Index: new/qmp-commands.hx
===================================================================
---- new.orig/qmp-commands.hx 2014-05-05 09:49:29.000000000 +0200
-+++ new/qmp-commands.hx 2014-05-05 09:54:17.000000000 +0200
-@@ -3593,3 +3593,34 @@
+--- new.orig/qmp-commands.hx 2014-06-12 11:39:32.000000000 +0200
++++ new/qmp-commands.hx 2014-06-12 12:08:10.000000000 +0200
+@@ -3603,3 +3603,34 @@
} } ] }
EQMP
Index: new/savevm-async.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/savevm-async.c 2014-05-05 09:55:53.000000000 +0200
-@@ -0,0 +1,478 @@
++++ new/savevm-async.c 2014-06-12 12:38:38.000000000 +0200
+@@ -0,0 +1,486 @@
+#include "qemu-common.h"
+#include "qapi/qmp/qerror.h"
+#include "sysemu/sysemu.h"
+ size_t bs_pos;
+ int state;
+ Error *error;
++ Error *blocker;
+ int saved_vm_running;
+ QEMUFile *file;
+ int64_t total_time;
+ */
+ size_t size = (snap_state.bs_pos + BDRV_SECTOR_SIZE) & BDRV_SECTOR_MASK;
+ bdrv_truncate(snap_state.bs, size);
-+ bdrv_set_in_use(snap_state.bs, 0);
++ bdrv_op_unblock_all(snap_state.bs, snap_state.blocker);
++ error_free(snap_state.blocker);
++ snap_state.blocker = NULL;
+ bdrv_unref(snap_state.bs);
+ snap_state.bs = NULL;
+ }
+ snap_state.saved_vm_running = runstate_is_running();
+ snap_state.bs_pos = 0;
+ snap_state.total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
++ snap_state.blocker = NULL;
+
+ if (snap_state.error) {
+ error_free(snap_state.error);
+ }
+
+ /* Open the image */
-+ snap_state.bs = bdrv_new("vmstate");
++ snap_state.bs = bdrv_new("vmstate", &error_abort);
+ ret = bdrv_open(&snap_state.bs, statefile, NULL, NULL, bdrv_oflags, drv, &local_err);
+
+ if (ret < 0) {
+ }
+
+
-+ bdrv_set_in_use(snap_state.bs, 1);
++ error_setg(&snap_state.blocker, "block device is in use by savevm");
++ bdrv_op_block_all(snap_state.bs, snap_state.blocker);
+ bdrv_ref(snap_state.bs);
+
+ Coroutine *co = qemu_coroutine_create(process_savevm_co);
+ }
+
+ if (!bdrv_can_snapshot(bs)) {
-+ error_set(errp, QERR_NOT_SUPPORTED);
++ error_set(errp, QERR_UNSUPPORTED);
+ return;
+ }
+
+ }
+
+ if (!bdrv_can_snapshot(bs)) {
-+ error_set(errp, QERR_NOT_SUPPORTED);
++ error_set(errp, QERR_UNSUPPORTED);
+ return;
+ }
+
+ BlockDriverState *bs = NULL;
+ BlockDriver *drv = NULL;
+ Error *local_err = NULL;
++ Error *blocker = NULL;
+
+ QEMUFile *f;
+ int ret = -1;
+
-+ bs = bdrv_new("vmstate");
++ bs = bdrv_new("vmstate", &error_abort);
+ ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_CACHE_WB, drv, &local_err);
-+ bdrv_set_in_use(bs, 1);
++ error_setg(&blocker, "block device is in use by load state");
++ bdrv_op_block_all(bs, blocker);
+ bdrv_ref(bs);
+
+ if (ret < 0) {
+
+ the_end:
+ if (bs) {
-+ bdrv_set_in_use(bs, 0);
++ bdrv_op_unblock_all(bs, blocker);
++ error_free(blocker);
+ bdrv_unref(bs);
+ }
+ return ret;
+}
Index: new/savevm.c
===================================================================
---- new.orig/savevm.c 2014-05-05 09:49:29.000000000 +0200
-+++ new/savevm.c 2014-05-05 09:54:17.000000000 +0200
-@@ -460,11 +460,11 @@
+--- new.orig/savevm.c 2014-06-12 10:19:18.000000000 +0200
++++ new/savevm.c 2014-06-12 12:08:10.000000000 +0200
+@@ -461,11 +461,11 @@
return false;
}
trace_savevm_state_begin();
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
-@@ -506,6 +506,7 @@
+@@ -507,6 +507,7 @@
break;
}
}
}
/*
-@@ -554,7 +555,7 @@
+@@ -555,7 +556,7 @@
return ret;
}
{
SaveStateEntry *se;
int ret;
-@@ -581,7 +582,7 @@
+@@ -582,7 +583,7 @@
trace_savevm_section_end(se->idstr, se->section_id);
if (ret < 0) {
qemu_file_set_error(f, ret);
}
}
-@@ -610,6 +611,7 @@
+@@ -611,6 +612,7 @@
qemu_put_byte(f, QEMU_VM_EOF);
qemu_fflush(f);
uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size)
Index: new/vl.c
===================================================================
---- new.orig/vl.c 2014-05-05 09:49:29.000000000 +0200
-+++ new/vl.c 2014-05-05 09:54:17.000000000 +0200
-@@ -2953,6 +2953,7 @@
+--- new.orig/vl.c 2014-06-12 11:09:49.000000000 +0200
++++ new/vl.c 2014-06-12 12:08:10.000000000 +0200
+@@ -2979,6 +2979,7 @@
int optind;
const char *optarg;
const char *loadvm = NULL;
+ const char *loadstate = NULL;
MachineClass *machine_class;
- QEMUMachine *machine;
const char *cpu_model;
-@@ -3574,6 +3575,9 @@
+ const char *vga_model = NULL;
+@@ -3628,6 +3629,9 @@
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
case QEMU_OPTION_full_screen:
full_screen = 1;
break;
-@@ -4541,6 +4545,10 @@
+@@ -4599,6 +4603,10 @@
if (load_vmstate(loadvm) < 0) {
autostart = 0;
}
+ }
}
- if (incoming) {
+ qdev_prop_check_global();
Index: new/ui/vnc.c
===================================================================
---- new.orig/ui/vnc.c 2014-05-05 10:17:15.000000000 +0200
-+++ new/ui/vnc.c 2014-05-05 11:18:48.000000000 +0200
-@@ -1619,6 +1619,10 @@
+--- new.orig/ui/vnc.c 2014-06-12 10:19:19.000000000 +0200
++++ new/ui/vnc.c 2014-06-12 10:47:24.000000000 +0200
+@@ -1626,6 +1626,10 @@
static void do_key_event(VncState *vs, int down, int keycode, int sym)
{
/* QEMU console switch */
switch(keycode) {
case 0x2a: /* Left Shift */
-@@ -1694,7 +1698,24 @@
+@@ -1705,7 +1709,24 @@
}
if (qemu_console_is_graphic(NULL)) {
} else {
bool numlock = vs->modifiers_state[0x45];
bool control = (vs->modifiers_state[0x1d] ||
-@@ -1828,7 +1849,8 @@
+@@ -1844,7 +1865,8 @@
lsym = lsym - 'A' + 'a';
}
- keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF) & SCANCODE_KEYMASK;
+ keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF);
+
+ trace_vnc_key_event_map(down, sym, keycode, code2name(keycode));
do_key_event(vs, down, keycode, sym);
}
-
-@@ -3037,7 +3059,7 @@
+@@ -3036,7 +3058,7 @@
char *vnc_display_local_addr(DisplayState *ds)
{
VncDisplay *vs = vnc_display;
Index: new/qapi-schema.json
===================================================================
---- new.orig/qapi-schema.json 2014-05-05 07:54:16.000000000 +0200
-+++ new/qapi-schema.json 2014-05-05 08:09:23.000000000 +0200
-@@ -3431,6 +3431,8 @@
+--- new.orig/qapi-schema.json 2014-06-12 10:50:04.000000000 +0200
++++ new/qapi-schema.json 2014-06-12 10:53:30.000000000 +0200
+@@ -2241,6 +2241,8 @@
#
# @default: #optional whether the machine is default
#
# @cpu-max: maximum number of CPUs supported by the machine type
# (since 1.5.0)
#
-@@ -3438,7 +3440,7 @@
+@@ -2248,7 +2250,7 @@
##
{ 'type': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
# @query-machines:
Index: new/vl.c
===================================================================
---- new.orig/vl.c 2014-05-05 07:54:16.000000000 +0200
-+++ new/vl.c 2014-05-05 08:14:33.000000000 +0200
-@@ -1673,6 +1673,11 @@
- info->name = g_strdup(m->name);
- info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;
+--- new.orig/vl.c 2014-06-12 10:49:25.000000000 +0200
++++ new/vl.c 2014-06-12 11:09:49.000000000 +0200
+@@ -1699,6 +1699,11 @@
+ info->name = g_strdup(mc->name);
+ info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
-+ if (strcmp(m->name, MACHINE_GET_CLASS(current_machine)->qemu_machine->name) == 0) {
++ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
+ info->has_is_current = true;
+ info->is_current = true;
+ }
internal-snapshot-async.patch
disable-efi-enable-pxe-roms.patch
backup-vma-allow-empty-backups.patch
-0001-aio-Fix-use-after-free-in-cancellation-path.patch
-0001-aio-fix-qemu_bh_schedule-bh-ctx-race-condition.patch