[pve-devel] [PATCH 1/3] adapt patches to qemu 2.0.0

Stefan Priebe s.priebe at profihost.ag
Fri May 2 21:24:39 CEST 2014


---
 ...-still-buggy-under-load-for-migration-but.patch |   22 +-
 debian/patches/adjust-path.diff                    |   24 +-
 debian/patches/backup-add-dir-format.patch         |   82 ++--
 .../patches/backup-add-pve-monitor-commands.patch  |   90 ++--
 debian/patches/backup-add-vma-binary.patch         |  110 +++--
 debian/patches/backup-add-vma-verify-command.patch |   74 ++--
 ...kup-do-not-return-errors-in-dump-callback.patch |   24 +-
 debian/patches/backup-modify-job-api.patch         |   63 +--
 debian/patches/backup-vma-add-dump-config.patch    |   20 +-
 .../patches/backup-vma-allow-empty-backups.patch   |  102 ++---
 .../backup-vma-correctly-propagate-error.patch     |   52 ++-
 debian/patches/backup-vma-remove-async-queue.patch |   81 ++--
 ...store-tolerate-a-size-difference-up-to-4M.patch |   18 +-
 debian/patches/disable-efi-enable-pxe-roms.patch   |   56 +--
 debian/patches/enable-kvm-by-default.patch         |   16 +-
 debian/patches/fairsched.diff                      |   45 +-
 debian/patches/fix-qemu-img-snapshot-removal.patch |   16 +-
 debian/patches/internal-snapshot-async.patch       |  204 ++++-----
 debian/patches/modify-query-machines.patch         |   30 +-
 debian/patches/modify-query-spice.patch            |   53 ++-
 debian/patches/pve-auth.patch                      |  440 ++++++++++----------
 .../qemu_do_exit_on_failed_load_vmstate.patch      |   10 +-
 debian/patches/set-cpu-model-to-kvm64.patch        |   16 +-
 debian/patches/spice-use-pve-certs.patch           |   16 +-
 debian/patches/vencrypt-auth-plain.patch           |   20 +-
 debian/patches/virtio-balloon-fix-query.patch      |   48 ++-
 26 files changed, 884 insertions(+), 848 deletions(-)

diff --git a/debian/patches/0001-ahci-ich-is-still-buggy-under-load-for-migration-but.patch b/debian/patches/0001-ahci-ich-is-still-buggy-under-load-for-migration-but.patch
index e7c4185..665af75 100644
--- a/debian/patches/0001-ahci-ich-is-still-buggy-under-load-for-migration-but.patch
+++ b/debian/patches/0001-ahci-ich-is-still-buggy-under-load-for-migration-but.patch
@@ -1,26 +1,21 @@
-From 0404d2f9d021fb2d1a50cad3edb2fb79e87a739e Mon Sep 17 00:00:00 2001
-From: Stefan Priebe <s.priebe at profihost.ag>
-Date: Tue, 17 Dec 2013 11:29:11 +0100
-Subject: [PATCH] ahci / ich is still buggy under load for migration but we
- still enable it ;-)
+commit a35f4dfe6ef7a2848e140d2b26bc2c7886345b78
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:59:54 2014 +0200
 
----
- hw/ide/ahci.c |    2 +-
- hw/ide/ich.c  |    2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+    0001-ahci-ich-is-still-buggy-under-load-for-migration-but.patch
 
 diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
-index fbea9e8..b36752f 100644
+index bfe633f..0bcba2a 100644
 --- a/hw/ide/ahci.c
 +++ b/hw/ide/ahci.c
-@@ -1309,7 +1309,7 @@ typedef struct SysbusAHCIState {
+@@ -1312,7 +1312,7 @@ typedef struct SysbusAHCIState {
  
  static const VMStateDescription vmstate_sysbus_ahci = {
      .name = "sysbus-ahci",
 -    .unmigratable = 1, /* Still buggy under I/O load */
 +    .unmigratable = 0,
      .fields = (VMStateField []) {
-         VMSTATE_AHCI(ahci, AHCIPCIState),
+         VMSTATE_AHCI(ahci, SysbusAHCIState),
          VMSTATE_END_OF_LIST()
 diff --git a/hw/ide/ich.c b/hw/ide/ich.c
 index 1c7c058..8fd9e9f 100644
@@ -35,6 +30,3 @@ index 1c7c058..8fd9e9f 100644
      .version_id = 1,
      .fields = (VMStateField []) {
          VMSTATE_PCI_DEVICE(parent_obj, AHCIPCIState),
--- 
-1.7.10.4
-
diff --git a/debian/patches/adjust-path.diff b/debian/patches/adjust-path.diff
index d14e2dd..7bc564e 100644
--- a/debian/patches/adjust-path.diff
+++ b/debian/patches/adjust-path.diff
@@ -1,8 +1,14 @@
-Index: new/include/net/net.h
-===================================================================
---- new.orig/include/net/net.h	2013-11-26 10:50:22.000000000 +0100
-+++ new/include/net/net.h	2013-11-26 11:02:32.000000000 +0100
-@@ -176,8 +176,9 @@
+commit 689ed34c0c644b52bb8615a558c9c317ccb1ac93
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:53:07 2014 +0200
+
+    adjust-path.diff
+
+diff --git a/include/net/net.h b/include/net/net.h
+index 8166345..5ec8f5f 100644
+--- a/include/net/net.h
++++ b/include/net/net.h
+@@ -195,8 +195,9 @@ int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret);
  int net_hub_id_for_client(NetClientState *nc, int *id);
  NetClientState *net_hub_port_find(int hub_id);
  
@@ -14,10 +20,10 @@ Index: new/include/net/net.h
  #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
  #define DEFAULT_BRIDGE_INTERFACE "br0"
  
-Index: new/net/tap_int.h
-===================================================================
---- new.orig/net/tap_int.h	2013-11-26 10:50:22.000000000 +0100
-+++ new/net/tap_int.h	2013-11-26 11:02:32.000000000 +0100
+diff --git a/net/tap_int.h b/net/tap_int.h
+index 86bb224..8955f5d 100644
+--- a/net/tap_int.h
++++ b/net/tap_int.h
 @@ -29,8 +29,6 @@
  #include "qemu-common.h"
  #include "qapi-types.h"
diff --git a/debian/patches/backup-add-dir-format.patch b/debian/patches/backup-add-dir-format.patch
index 2a92799..9a3acda 100644
--- a/debian/patches/backup-add-dir-format.patch
+++ b/debian/patches/backup-add-dir-format.patch
@@ -1,21 +1,14 @@
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-12-06 10:26:47.000000000 +0100
-+++ new/qapi-schema.json	2013-12-06 10:27:49.000000000 +0100
-@@ -586,7 +586,7 @@
- # @vma: Proxmox vma backup format
- ##
- { 'enum': 'BackupFormat',
--  'data': [ 'vma' ] }
-+  'data': [ 'vma', 'dir' ] }
- 
- ##
- # @backup:
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2013-12-06 10:27:39.000000000 +0100
-+++ new/blockdev.c	2013-12-06 10:27:49.000000000 +0100
-@@ -1760,6 +1760,8 @@
+commit e988ad3f02023c920f6e62fb0a547d328c32cd1a
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:36 2014 +0200
+
+    backup-add-dir-format.patch
+
+diff --git a/blockdev.c b/blockdev.c
+index ce509b5..181d56e 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -1850,6 +1850,8 @@ typedef struct PVEBackupDevInfo {
      uint8_t dev_id;
      //bool started;
      bool completed;
@@ -24,7 +17,7 @@ Index: new/blockdev.c
  } PVEBackupDevInfo;
  
  static void pvebackup_run_next_job(void);
-@@ -1828,8 +1830,6 @@
+@@ -1918,8 +1920,6 @@ static void pvebackup_complete_cb(void *opaque, int ret)
  {
      PVEBackupDevInfo *di = opaque;
  
@@ -33,7 +26,7 @@ Index: new/blockdev.c
      di->completed = true;
  
      if (ret < 0 && !backup_state.error) {
-@@ -1840,8 +1840,11 @@
+@@ -1930,8 +1930,11 @@ static void pvebackup_complete_cb(void *opaque, int ret)
      BlockDriverState *bs = di->bs;
  
      di->bs = NULL;
@@ -46,7 +39,7 @@ Index: new/blockdev.c
  
      block_job_cb(bs, ret);
  
-@@ -1918,6 +1921,7 @@
+@@ -2008,6 +2011,7 @@ char *qmp_backup(const char *backup_file, bool has_format,
                      bool has_speed, int64_t speed, Error **errp)
  {
      BlockDriverState *bs;
@@ -54,7 +47,7 @@ Index: new/blockdev.c
      Error *local_err = NULL;
      uuid_t uuid;
      VmaWriter *vmaw = NULL;
-@@ -1934,11 +1938,6 @@
+@@ -2024,11 +2028,6 @@ char *qmp_backup(const char *backup_file, bool has_format,
      /* Todo: try to auto-detect format based on file name */
      format = has_format ? format : BACKUP_FORMAT_VMA;
  
@@ -66,7 +59,7 @@ Index: new/blockdev.c
      if (has_devlist) {
          devs = g_strsplit_set(devlist, ",;:", -1);
  
-@@ -2006,27 +2005,63 @@
+@@ -2096,27 +2095,63 @@ char *qmp_backup(const char *backup_file, bool has_format,
  
      uuid_generate(uuid);
  
@@ -134,7 +127,7 @@ Index: new/blockdev.c
 +            }
 +
 +            di->target = bdrv_new("");
-+            if (bdrv_open(di->target, di->targetfile, NULL, flags, NULL, &local_err) < 0) {
++            if (bdrv_open(&di->target, di->targetfile, NULL, NULL, flags, NULL, &local_err) < 0) {
 +                bdrv_unref(di->target);
 +                error_propagate(errp, local_err);
 +                goto err;
@@ -146,7 +139,7 @@ Index: new/blockdev.c
      }
  
      /* add configuration file to archive */
-@@ -2039,12 +2074,27 @@
+@@ -2129,12 +2164,27 @@ char *qmp_backup(const char *backup_file, bool has_format,
              goto err;
          }
  
@@ -179,7 +172,7 @@ Index: new/blockdev.c
          g_free(cdata);
      }
  
-@@ -2084,10 +2134,11 @@
+@@ -2174,10 +2224,11 @@ char *qmp_backup(const char *backup_file, bool has_format,
          PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
          l = g_list_next(l);
  
@@ -192,7 +185,7 @@ Index: new/blockdev.c
          if (local_err != NULL) {
              error_setg(&backup_state.error, "backup_job_create failed");
              pvebackup_cancel(NULL);
-@@ -2104,8 +2155,17 @@
+@@ -2194,8 +2245,17 @@ err:
  
      l = di_list;
      while (l) {
@@ -211,7 +204,7 @@ Index: new/blockdev.c
      }
      g_list_free(di_list);
  
-@@ -2119,6 +2179,10 @@
+@@ -2209,6 +2269,10 @@ err:
          unlink(backup_file);
      }
  
@@ -222,11 +215,11 @@ Index: new/blockdev.c
      return NULL;
  }
  
-Index: new/hmp-commands.hx
-===================================================================
---- new.orig/hmp-commands.hx	2013-12-06 10:26:47.000000000 +0100
-+++ new/hmp-commands.hx	2013-12-06 10:27:49.000000000 +0100
-@@ -85,9 +85,11 @@
+diff --git a/hmp-commands.hx b/hmp-commands.hx
+index 4c2747d..1b59d42 100644
+--- a/hmp-commands.hx
++++ b/hmp-commands.hx
+@@ -90,9 +90,11 @@ ETEXI
  
     {
          .name       = "backup",
@@ -241,11 +234,11 @@ Index: new/hmp-commands.hx
          .mhandler.cmd = hmp_backup,
      },
  
-Index: new/hmp.c
-===================================================================
---- new.orig/hmp.c	2013-12-06 10:26:47.000000000 +0100
-+++ new/hmp.c	2013-12-06 10:27:49.000000000 +0100
-@@ -1245,11 +1245,13 @@
+diff --git a/hmp.c b/hmp.c
+index 0611cf2..8a0ad29 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -1248,11 +1248,13 @@ void hmp_backup(Monitor *mon, const QDict *qdict)
  {
      Error *error = NULL;
  
@@ -260,3 +253,16 @@ Index: new/hmp.c
                 devlist, qdict_haskey(qdict, "speed"), speed, &error);
  
      hmp_handle_error(mon, &error);
+diff --git a/qapi-schema.json b/qapi-schema.json
+index ae56435..e3c39ea 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -666,7 +666,7 @@
+ # @vma: Proxmox vma backup format
+ ##
+ { 'enum': 'BackupFormat',
+-  'data': [ 'vma' ] }
++  'data': [ 'vma', 'dir' ] }
+ 
+ ##
+ # @backup:
diff --git a/debian/patches/backup-add-pve-monitor-commands.patch b/debian/patches/backup-add-pve-monitor-commands.patch
index 8c04c9c..8c61eb1 100644
--- a/debian/patches/backup-add-pve-monitor-commands.patch
+++ b/debian/patches/backup-add-pve-monitor-commands.patch
@@ -1,7 +1,13 @@
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2013-12-06 10:04:18.000000000 +0100
-+++ new/blockdev.c	2013-12-06 10:27:39.000000000 +0100
+commit b11518cfcaf07a9851ce5aff1200b70af170d98f
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:36 2014 +0200
+
+    backup-add-pve-monitor-commands.patch
+
+diff --git a/blockdev.c b/blockdev.c
+index a83eef5..ce509b5 100644
+--- a/blockdev.c
++++ b/blockdev.c
 @@ -45,6 +45,7 @@
  #include "qmp-commands.h"
  #include "trace.h"
@@ -10,7 +16,7 @@ Index: new/blockdev.c
  
  static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives);
  
-@@ -1438,7 +1439,6 @@
+@@ -1513,7 +1514,6 @@ exit:
      }
  }
  
@@ -18,7 +24,7 @@ Index: new/blockdev.c
  static void eject_device(BlockDriverState *bs, int force, Error **errp)
  {
      if (bdrv_in_use(bs)) {
-@@ -1736,6 +1736,437 @@
+@@ -1826,6 +1826,437 @@ static void block_job_cb(void *opaque, int ret)
      bdrv_put_ref_bh_schedule(bs);
  }
  
@@ -456,11 +462,11 @@ Index: new/blockdev.c
  void qmp_block_stream(const char *device, bool has_base,
                        const char *base, bool has_speed, int64_t speed,
                        bool has_on_error, BlockdevOnError on_error,
-Index: new/hmp-commands.hx
-===================================================================
---- new.orig/hmp-commands.hx	2013-12-03 06:36:18.000000000 +0100
-+++ new/hmp-commands.hx	2013-12-06 10:26:47.000000000 +0100
-@@ -83,6 +83,35 @@
+diff --git a/hmp-commands.hx b/hmp-commands.hx
+index f3fc514..4c2747d 100644
+--- a/hmp-commands.hx
++++ b/hmp-commands.hx
+@@ -88,6 +88,35 @@ STEXI
  Copy data from a backing file into a block device.
  ETEXI
  
@@ -496,7 +502,7 @@ Index: new/hmp-commands.hx
      {
          .name       = "block_job_set_speed",
          .args_type  = "device:B,speed:o",
-@@ -1692,6 +1721,8 @@
+@@ -1738,6 +1767,8 @@ show the current VM UUID
  show CPU statistics
  @item info usernet
  show user network stack connection states
@@ -505,11 +511,11 @@ Index: new/hmp-commands.hx
  @item info migrate
  show migration status
  @item info migrate_capabilities
-Index: new/hmp.c
-===================================================================
---- new.orig/hmp.c	2013-12-06 10:04:18.000000000 +0100
-+++ new/hmp.c	2013-12-06 10:26:47.000000000 +0100
-@@ -133,6 +133,44 @@
+diff --git a/hmp.c b/hmp.c
+index 4fe5cf7..0611cf2 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -134,6 +134,44 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict)
      qapi_free_MouseInfoList(mice_list);
  }
  
@@ -554,11 +560,10 @@ Index: new/hmp.c
  void hmp_info_migrate(Monitor *mon, const QDict *qdict)
  {
      MigrationInfo *info;
-@@ -1193,6 +1231,29 @@
- 
+@@ -1197,6 +1235,29 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
      hmp_handle_error(mon, &error);
  }
-+
+ 
 +void hmp_backup_cancel(Monitor *mon, const QDict *qdict)
 +{
 +    Error *error = NULL;
@@ -581,14 +586,15 @@ Index: new/hmp.c
 +
 +    hmp_handle_error(mon, &error);
 +}
- 
++
  void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict)
  {
-Index: new/hmp.h
-===================================================================
---- new.orig/hmp.h	2013-12-03 06:36:18.000000000 +0100
-+++ new/hmp.h	2013-12-06 10:04:22.000000000 +0100
-@@ -28,6 +28,7 @@
+     Error *error = NULL;
+diff --git a/hmp.h b/hmp.h
+index ed58f0e..a9f3c2c 100644
+--- a/hmp.h
++++ b/hmp.h
+@@ -28,6 +28,7 @@ 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);
@@ -596,7 +602,7 @@ Index: new/hmp.h
  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 @@
+@@ -69,6 +70,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);
@@ -605,11 +611,11 @@ Index: new/hmp.h
  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);
-Index: new/monitor.c
-===================================================================
---- new.orig/monitor.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/monitor.c	2013-12-06 10:04:22.000000000 +0100
-@@ -2880,6 +2880,13 @@
+diff --git a/monitor.c b/monitor.c
+index 342e83b..a69dd39 100644
+--- a/monitor.c
++++ b/monitor.c
+@@ -2903,6 +2903,13 @@ static mon_cmd_t info_cmds[] = {
      },
  #endif
      {
@@ -623,11 +629,11 @@ Index: new/monitor.c
          .name       = "migrate",
          .args_type  = "",
          .params     = "",
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-12-06 10:04:18.000000000 +0100
-+++ new/qapi-schema.json	2013-12-06 10:26:47.000000000 +0100
-@@ -547,6 +547,95 @@
+diff --git a/qapi-schema.json b/qapi-schema.json
+index e823314..ae56435 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -627,6 +627,95 @@
  ##
  { 'command': 'query-events', 'returns': ['EventInfo'] }
  
@@ -723,11 +729,11 @@ Index: new/qapi-schema.json
  ##
  # @MigrationStats
  #
-Index: new/qmp-commands.hx
-===================================================================
---- new.orig/qmp-commands.hx	2013-12-06 10:04:18.000000000 +0100
-+++ new/qmp-commands.hx	2013-12-06 10:04:22.000000000 +0100
-@@ -966,6 +966,24 @@
+diff --git a/qmp-commands.hx b/qmp-commands.hx
+index df87119..c8e5fdc 100644
+--- a/qmp-commands.hx
++++ b/qmp-commands.hx
+@@ -1080,6 +1080,24 @@ Example:
  EQMP
  
      {
diff --git a/debian/patches/backup-add-vma-binary.patch b/debian/patches/backup-add-vma-binary.patch
index 560f3f5..e0c0fd8 100644
--- a/debian/patches/backup-add-vma-binary.patch
+++ b/debian/patches/backup-add-vma-binary.patch
@@ -1,41 +1,23 @@
-From 6289a43696ca6f713a5d3bb9f95a5adb608a5e13 Mon Sep 17 00:00:00 2001
-From: Dietmar Maurer <dietmar at proxmox.com>
-Date: Tue, 13 Nov 2012 11:11:38 +0100
-Subject: [PATCH v5 4/6] introduce new vma archive format
+commit 9345306824aacb38516ee304362be9b352869b4d
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:55:21 2014 +0200
 
-This is a very simple archive format, see docs/specs/vma_spec.txt
+    backup-add-vma-binary.patch
 
-Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
----
- Makefile                |    3 +-
- Makefile.objs           |    2 +-
- blockdev.c              |    6 +-
- docs/specs/vma_spec.txt |   24 ++
- vma-reader.c            |  799 ++++++++++++++++++++++++++++++++++++++++
- vma-writer.c            |  940 +++++++++++++++++++++++++++++++++++++++++++++++
- vma.c                   |  561 ++++++++++++++++++++++++++++
- vma.h                   |  145 ++++++++
- 8 files changed, 2476 insertions(+), 4 deletions(-)
- create mode 100644 docs/specs/vma_spec.txt
- create mode 100644 vma-reader.c
- create mode 100644 vma-writer.c
- create mode 100644 vma.c
- create mode 100644 vma.h
-
-Index: new/Makefile
-===================================================================
---- new.orig/Makefile	2013-12-04 12:07:18.000000000 +0100
-+++ new/Makefile	2013-12-04 12:07:25.000000000 +0100
-@@ -128,7 +128,7 @@
+diff --git a/Makefile b/Makefile
+index 423e373..198beef 100644
+--- a/Makefile
++++ b/Makefile
+@@ -146,7 +146,7 @@ ifeq ($(CONFIG_SMARTCARD_NSS),y)
  include $(SRC_PATH)/libcacard/Makefile
  endif
  
--all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
-+all: $(DOCS) $(TOOLS) vma$(EXESUF) $(HELPERS-y) recurse-all
+-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
++all: $(DOCS) $(TOOLS) vma$(EXESUF) $(HELPERS-y) recurse-all modules
+ 
+ vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
  
- config-host.h: config-host.h-timestamp
- config-host.h-timestamp: config-host.mak
-@@ -194,6 +194,7 @@
+@@ -220,6 +220,7 @@ qemu-img.o: qemu-img-cmds.h
  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
@@ -43,10 +25,23 @@ Index: new/Makefile
  
  qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
  
-Index: new/vma-reader.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-reader.c	2013-12-04 12:07:25.000000000 +0100
+diff --git a/Makefile.objs b/Makefile.objs
+index a6e0e2a..43b0f4f 100644
+--- a/Makefile.objs
++++ b/Makefile.objs
+@@ -14,6 +14,7 @@ block-obj-$(CONFIG_WIN32) += aio-win32.o
+ block-obj-y += block/
+ block-obj-y += qapi-types.o qapi-visit.o
+ block-obj-y += qemu-io-cmds.o
++block-obj-y += vma-writer.o
+ 
+ block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
+ block-obj-y += qemu-coroutine-sleep.o
+diff --git a/vma-reader.c b/vma-reader.c
+new file mode 100644
+index 0000000..bc36cba
+--- /dev/null
++++ b/vma-reader.c
 @@ -0,0 +1,799 @@
 +/*
 + * VMA: Virtual Machine Archive
@@ -847,10 +842,11 @@ Index: new/vma-reader.c
 +    return ret;
 +}
 +
-Index: new/vma-writer.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-writer.c	2013-12-04 14:26:06.000000000 +0100
+diff --git a/vma-writer.c b/vma-writer.c
+new file mode 100644
+index 0000000..7ac1acc
+--- /dev/null
++++ b/vma-writer.c
 @@ -0,0 +1,875 @@
 +/*
 + * VMA: Virtual Machine Archive
@@ -1727,10 +1723,11 @@ Index: new/vma-writer.c
 +
 +    g_free(vmaw);
 +}
-Index: new/vma.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.c	2013-12-04 12:07:25.000000000 +0100
+diff --git a/vma.c b/vma.c
+new file mode 100644
+index 0000000..eb0748e
+--- /dev/null
++++ b/vma.c
 @@ -0,0 +1,579 @@
 +/*
 + * VMA: Virtual Machine Archive
@@ -2031,7 +2028,7 @@ Index: new/vma.c
 +            }
 +
 +            BlockDriverState *bs = bdrv_new(di->devname);
-+            if (bdrv_open(bs, devfn, NULL, flags, NULL, &errp)) {
++            if (bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
 +                g_error("can't open file %s - %s", devfn,
 +                        error_get_pretty(errp));
 +            }
@@ -2200,7 +2197,7 @@ Index: new/vma.c
 +        BlockDriverState *bs = bdrv_new(devname);
 +        Error *errp = NULL;
 +
-+        res = bdrv_open(bs, path, NULL, BDRV_O_CACHE_WB , drv, &errp);
++        res = bdrv_open(&bs, path, NULL, NULL, BDRV_O_CACHE_WB , drv, &errp);
 +        if (res < 0) {
 +            unlink(archivename);
 +            g_error("bdrv_open '%s' failed - %s", path, error_get_pretty(errp));
@@ -2311,10 +2308,11 @@ Index: new/vma.c
 +    help();
 +    return 0;
 +}
-Index: new/vma.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.h	2013-12-04 14:27:56.000000000 +0100
+diff --git a/vma.h b/vma.h
+new file mode 100644
+index 0000000..6625eb9
+--- /dev/null
++++ b/vma.h
 @@ -0,0 +1,146 @@
 +/*
 + * VMA: Virtual Machine Archive
@@ -2462,15 +2460,3 @@ Index: new/vma.h
 +                       Error **errp);
 +
 +#endif /* BACKUP_VMA_H */
-Index: new/Makefile.objs
-===================================================================
---- new.orig/Makefile.objs	2013-12-04 12:07:18.000000000 +0100
-+++ new/Makefile.objs	2013-12-04 12:07:25.000000000 +0100
-@@ -14,6 +14,7 @@
- block-obj-y += block/
- block-obj-y += qapi-types.o qapi-visit.o
- block-obj-y += qemu-io-cmds.o
-+block-obj-y += vma-writer.o
- 
- block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
- block-obj-y += qemu-coroutine-sleep.o
diff --git a/debian/patches/backup-add-vma-verify-command.patch b/debian/patches/backup-add-vma-verify-command.patch
index d28bc35..9d9f8bd 100644
--- a/debian/patches/backup-add-vma-verify-command.patch
+++ b/debian/patches/backup-add-vma-verify-command.patch
@@ -1,28 +1,14 @@
-From acdcd483ac6977e096ef7cde746d22bbf82e04d3 Mon Sep 17 00:00:00 2001
-From: Dietmar Maurer <dietmar at proxmox.com>
-Date: Mon, 11 Mar 2013 07:07:46 +0100
-Subject: [PATCH v5 7/7] vma: add verify command
+commit 9f1f20e5ea537e9c5ff5194d158ab733edda790c
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:55:21 2014 +0200
 
-Users wants to verify the archive after backup.
+    backup-add-vma-verify-command.patch
 
-Examples:
-
- # vma verify -v test.vma
-
- # lzop -d -c test.vma.lzo |vma verify -
-
-Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
----
- vma-reader.c |  118 +++++++++++++++++++++++++++++++++++++++++++---------------
- vma.c        |   57 +++++++++++++++++++++++++++-
- vma.h        |    1 +
- 3 files changed, 145 insertions(+), 31 deletions(-)
-
-Index: new/vma-reader.c
-===================================================================
---- new.orig/vma-reader.c	2013-12-04 10:45:45.000000000 +0100
-+++ new/vma-reader.c	2013-12-04 10:47:53.000000000 +0100
-@@ -53,6 +53,8 @@
+diff --git a/vma-reader.c b/vma-reader.c
+index bc36cba..79e8666 100644
+--- a/vma-reader.c
++++ b/vma-reader.c
+@@ -53,6 +53,8 @@ struct VmaReader {
      time_t start_time;
      int64_t cluster_count;
      int64_t clusters_read;
@@ -31,7 +17,7 @@ Index: new/vma-reader.c
      int clusters_read_per;
  };
  
-@@ -433,6 +435,27 @@
+@@ -433,6 +435,27 @@ VmaDeviceInfo *vma_reader_get_device_info(VmaReader *vmar, guint8 dev_id)
      return NULL;
  }
  
@@ -59,7 +45,7 @@ Index: new/vma-reader.c
  int vma_reader_register_bs(VmaReader *vmar, guint8 dev_id, BlockDriverState *bs,
                             bool write_zeroes, Error **errp)
  {
-@@ -449,17 +472,7 @@
+@@ -449,17 +472,7 @@ int vma_reader_register_bs(VmaReader *vmar, guint8 dev_id, BlockDriverState *bs,
          return -1;
      }
  
@@ -78,7 +64,7 @@ Index: new/vma-reader.c
  
      return 0;
  }
-@@ -526,9 +539,10 @@
+@@ -526,9 +539,10 @@ static int restore_write_data(VmaReader *vmar, guint8 dev_id,
      }
      return 0;
  }
@@ -90,7 +76,7 @@ Index: new/vma-reader.c
  {
      assert(vmar);
      assert(buf);
-@@ -553,7 +567,7 @@
+@@ -553,7 +567,7 @@ static int restore_extent(VmaReader *vmar, unsigned char *buf,
  
          if (dev_id != vmar->vmstate_stream) {
              bs = rstate->bs;
@@ -99,7 +85,7 @@ Index: new/vma-reader.c
                  error_setg(errp, "got wrong dev id %d", dev_id);
                  return -1;
              }
-@@ -609,10 +623,13 @@
+@@ -609,10 +623,13 @@ static int restore_extent(VmaReader *vmar, unsigned char *buf,
                  return -1;
              }
  
@@ -117,7 +103,7 @@ Index: new/vma-reader.c
              }
  
              start += VMA_CLUSTER_SIZE;
-@@ -642,26 +659,37 @@
+@@ -642,26 +659,37 @@ static int restore_extent(VmaReader *vmar, unsigned char *buf,
                          return -1;
                      }
  
@@ -165,7 +151,7 @@ Index: new/vma-reader.c
                          }
                      }
                  }
-@@ -679,8 +707,9 @@
+@@ -679,8 +707,9 @@ static int restore_extent(VmaReader *vmar, unsigned char *buf,
      return 0;
  }
  
@@ -177,7 +163,7 @@ Index: new/vma-reader.c
  {
      assert(vmar);
      assert(vmar->head_data);
-@@ -747,7 +776,7 @@
+@@ -747,7 +776,7 @@ int vma_reader_restore(VmaReader *vmar, int vmstate_fd, bool verbose,
          }
  
          if (restore_extent(vmar, buf, extent_size, vmstate_fd, verbose,
@@ -186,7 +172,7 @@ Index: new/vma-reader.c
              return -1;
          }
  
-@@ -794,6 +823,38 @@
+@@ -794,6 +823,38 @@ int vma_reader_restore(VmaReader *vmar, int vmstate_fd, bool verbose,
          }
      }
  
@@ -225,11 +211,11 @@ Index: new/vma-reader.c
 +    return vma_reader_restore_full(vmar, -1, verbose, true, errp);
 +}
 +
-Index: new/vma.c
-===================================================================
---- new.orig/vma.c	2013-12-04 10:47:35.000000000 +0100
-+++ new/vma.c	2013-12-04 10:47:53.000000000 +0100
-@@ -34,6 +34,7 @@
+diff --git a/vma.c b/vma.c
+index eb0748e..a15bbaf 100644
+--- a/vma.c
++++ b/vma.c
+@@ -34,6 +34,7 @@ static void help(void)
          "vma list <filename>\n"
          "vma create <filename> [-c config] <archive> pathname ...\n"
          "vma extract <filename> [-r <fifo>] <targetdir>\n"
@@ -237,7 +223,7 @@ Index: new/vma.c
          ;
  
      printf("%s", help_msg);
-@@ -338,6 +339,58 @@
+@@ -338,6 +339,58 @@ static int extract_content(int argc, char **argv)
      return ret;
  }
  
@@ -296,7 +282,7 @@ Index: new/vma.c
  typedef struct BackupJob {
      BlockDriverState *bs;
      int64_t len;
-@@ -572,6 +625,8 @@
+@@ -572,6 +625,8 @@ int main(int argc, char **argv)
          return create_archive(argc, argv);
      } else if (!strcmp(cmdname, "extract")) {
          return extract_content(argc, argv);
@@ -305,11 +291,11 @@ Index: new/vma.c
      }
  
      help();
-Index: new/vma.h
-===================================================================
---- new.orig/vma.h	2013-12-04 10:45:45.000000000 +0100
-+++ new/vma.h	2013-12-04 10:47:53.000000000 +0100
-@@ -140,5 +140,6 @@
+diff --git a/vma.h b/vma.h
+index 6625eb9..9bb6ea4 100644
+--- a/vma.h
++++ b/vma.h
+@@ -142,5 +142,6 @@ int vma_reader_register_bs(VmaReader *vmar, guint8 dev_id,
                             Error **errp);
  int vma_reader_restore(VmaReader *vmar, int vmstate_fd, bool verbose,
                         Error **errp);
diff --git a/debian/patches/backup-do-not-return-errors-in-dump-callback.patch b/debian/patches/backup-do-not-return-errors-in-dump-callback.patch
index 2d69274..5747000 100644
--- a/debian/patches/backup-do-not-return-errors-in-dump-callback.patch
+++ b/debian/patches/backup-do-not-return-errors-in-dump-callback.patch
@@ -1,14 +1,14 @@
-The backup dump_cb should always return success. Else the original write
-does not succeed and the VM gets notified. 
+commit 7d2dfe5b4e07a7b012cd4b163414f33d95d7d4fa
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:36 2014 +0200
 
-We simply report success and cancel the backup job instead.
+    backup-do-not-return-errors-in-dump-callback.patch
 
-
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2014-03-26 06:50:24.000000000 +0100
-+++ new/blockdev.c	2014-03-26 08:44:29.000000000 +0100
-@@ -1772,6 +1772,11 @@
+diff --git a/blockdev.c b/blockdev.c
+index 181d56e..f17a1e1 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -1862,6 +1862,11 @@ static int pvebackup_dump_cb(void *opaque, BlockDriverState *target,
  {
      PVEBackupDevInfo *di = opaque;
  
@@ -20,7 +20,7 @@ Index: new/blockdev.c
      if (sector_num & 0x7f) {
          if (!backup_state.error) {
              error_setg(&backup_state.error,
-@@ -1782,7 +1787,6 @@
+@@ -1872,7 +1877,6 @@ static int pvebackup_dump_cb(void *opaque, BlockDriverState *target,
      }
  
      int64_t cluster_num = sector_num >> 7;
@@ -28,7 +28,7 @@ Index: new/blockdev.c
  
      int ret = -1;
  
-@@ -1790,17 +1794,27 @@
+@@ -1880,17 +1884,27 @@ static int pvebackup_dump_cb(void *opaque, BlockDriverState *target,
          size_t zero_bytes = 0;
          ret = vma_writer_write(backup_state.vmaw, di->dev_id, cluster_num,
                                 buf, &zero_bytes);
@@ -60,7 +60,7 @@ Index: new/blockdev.c
  }
  
  static void pvebackup_cleanup(void)
-@@ -1872,7 +1886,7 @@
+@@ -1962,7 +1976,7 @@ static void pvebackup_cancel(void *opaque)
              BlockJob *job = di->bs->job;
              if (job) {
                  if (!di->completed) {
diff --git a/debian/patches/backup-modify-job-api.patch b/debian/patches/backup-modify-job-api.patch
index afeba0a..8b87af3 100644
--- a/debian/patches/backup-modify-job-api.patch
+++ b/debian/patches/backup-modify-job-api.patch
@@ -1,8 +1,14 @@
-Index: new/block/backup.c
-===================================================================
---- new.orig/block/backup.c	2013-12-05 08:18:53.000000000 +0100
-+++ new/block/backup.c	2013-12-05 13:16:21.000000000 +0100
-@@ -39,6 +39,7 @@
+commit 5df3785fb21121e99af33f38d7d788a61e902b60
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:35 2014 +0200
+
+    backup-modify-job-api.patch
+
+diff --git a/block/backup.c b/block/backup.c
+index 15a2e55..0b1ebd8 100644
+--- a/block/backup.c
++++ b/block/backup.c
+@@ -39,6 +39,7 @@ typedef struct BackupBlockJob {
      BlockDriverState *target;
      MirrorSyncMode sync_mode;
      RateLimit limit;
@@ -10,19 +16,22 @@ Index: new/block/backup.c
      BlockdevOnError on_source_error;
      BlockdevOnError on_target_error;
      CoRwlock flush_rwlock;
-@@ -136,13 +137,21 @@
+@@ -136,14 +137,23 @@ static int coroutine_fn backup_do_cow(BlockDriverState *bs,
              goto out;
          }
  
 +        int64_t start_sec = start * BACKUP_SECTORS_PER_CLUSTER;
          if (buffer_is_zero(iov.iov_base, iov.iov_len)) {
 -            ret = bdrv_co_write_zeroes(job->target,
--                                       start * BACKUP_SECTORS_PER_CLUSTER, n);
+-                                       start * BACKUP_SECTORS_PER_CLUSTER,
+-                                       n, BDRV_REQ_MAY_UNMAP);
 +            if (job->dump_cb) {
 +                ret = job->dump_cb(job->common.opaque, job->target, start_sec, n, NULL);
 +            }
 +            if (job->target) {
-+                ret = bdrv_co_write_zeroes(job->target, start_sec, n);
++                ret = bdrv_co_write_zeroes(job->target,
++                                           start_sec,
++                                           n, BDRV_REQ_MAY_UNMAP);
 +            }
          } else {
 -            ret = bdrv_co_writev(job->target,
@@ -37,7 +46,7 @@ Index: new/block/backup.c
          }
          if (ret < 0) {
              trace_backup_do_cow_write_fail(job, start, ret);
-@@ -199,7 +208,9 @@
+@@ -205,7 +215,9 @@ static void backup_iostatus_reset(BlockJob *job)
  {
      BackupBlockJob *s = container_of(job, BackupBlockJob, common);
  
@@ -48,7 +57,7 @@ Index: new/block/backup.c
  }
  
  static const BlockJobDriver backup_job_driver = {
-@@ -215,9 +226,11 @@
+@@ -221,9 +233,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
      if (read) {
          return block_job_error_action(&job->common, job->common.bs,
                                        job->on_source_error, true, error);
@@ -61,7 +70,7 @@ Index: new/block/backup.c
      }
  }
  
-@@ -242,9 +255,11 @@
+@@ -248,9 +262,11 @@ static void coroutine_fn backup_run(void *opaque)
  
      job->bitmap = hbitmap_alloc(end, 0);
  
@@ -76,7 +85,7 @@ Index: new/block/backup.c
  
      bdrv_add_before_write_notifier(bs, &before_write);
  
-@@ -337,8 +352,10 @@
+@@ -343,8 +359,10 @@ static void coroutine_fn backup_run(void *opaque)
  
      hbitmap_free(job->bitmap);
  
@@ -89,7 +98,7 @@ Index: new/block/backup.c
  
      block_job_completed(&job->common, ret);
  }
-@@ -347,13 +364,15 @@
+@@ -353,13 +371,15 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
                    int64_t speed, MirrorSyncMode sync_mode,
                    BlockdevOnError on_source_error,
                    BlockdevOnError on_target_error,
@@ -106,7 +115,7 @@ Index: new/block/backup.c
      assert(cb);
  
      if ((on_source_error == BLOCKDEV_ON_ERROR_STOP ||
-@@ -376,10 +395,12 @@
+@@ -382,10 +402,12 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
          return;
      }
  
@@ -119,11 +128,11 @@ Index: new/block/backup.c
      job->common.len = len;
      job->common.co = qemu_coroutine_create(backup_run);
      qemu_coroutine_enter(job->common.co, job);
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2013-12-05 08:18:53.000000000 +0100
-+++ new/blockdev.c	2013-12-05 13:07:43.000000000 +0100
-@@ -1932,7 +1932,7 @@
+diff --git a/blockdev.c b/blockdev.c
+index 5dd01ea..a83eef5 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -2030,7 +2030,7 @@ void qmp_drive_backup(const char *device, const char *target,
      }
  
      backup_start(bs, target_bs, speed, sync, on_source_error, on_target_error,
@@ -132,21 +141,21 @@ Index: new/blockdev.c
      if (local_err != NULL) {
          bdrv_unref(target_bs);
          error_propagate(errp, local_err);
-Index: new/include/block/block_int.h
-===================================================================
---- new.orig/include/block/block_int.h	2013-12-05 08:18:53.000000000 +0100
-+++ new/include/block/block_int.h	2013-12-05 13:16:53.000000000 +0100
-@@ -54,6 +54,9 @@
- #define BLOCK_OPT_LAZY_REFCOUNTS    "lazy_refcounts"
+diff --git a/include/block/block_int.h b/include/block/block_int.h
+index cd5bc73..9111eff 100644
+--- a/include/block/block_int.h
++++ b/include/block/block_int.h
+@@ -55,6 +55,9 @@
  #define BLOCK_OPT_ADAPTER_TYPE      "adapter_type"
+ #define BLOCK_OPT_REDUNDANCY        "redundancy"
  
 +typedef int BackupDumpFunc(void *opaque, BlockDriverState *bs,
 +                           int64_t sector_num, int n_sectors, unsigned char *buf);
 +
  typedef struct BdrvTrackedRequest {
      BlockDriverState *bs;
-     int64_t sector_num;
-@@ -427,7 +430,9 @@
+     int64_t offset;
+@@ -496,7 +499,9 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
                    int64_t speed, MirrorSyncMode sync_mode,
                    BlockdevOnError on_source_error,
                    BlockdevOnError on_target_error,
diff --git a/debian/patches/backup-vma-add-dump-config.patch b/debian/patches/backup-vma-add-dump-config.patch
index 9947dee..57bb009 100644
--- a/debian/patches/backup-vma-add-dump-config.patch
+++ b/debian/patches/backup-vma-add-dump-config.patch
@@ -1,8 +1,14 @@
-Index: new/vma.c
-===================================================================
---- new.orig/vma.c	2013-12-04 10:47:53.000000000 +0100
-+++ new/vma.c	2013-12-04 10:47:57.000000000 +0100
-@@ -32,6 +32,7 @@
+commit 985e3137f32c2cb65d154e1b7735db43a20180ed
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:55:21 2014 +0200
+
+    backup-vma-add-dump-config.patch
+
+diff --git a/vma.c b/vma.c
+index a15bbaf..470499f 100644
+--- a/vma.c
++++ b/vma.c
+@@ -32,6 +32,7 @@ static void help(void)
          "usage: vma command [command options]\n"
          "\n"
          "vma list <filename>\n"
@@ -10,7 +16,7 @@ Index: new/vma.c
          "vma create <filename> [-c config] <archive> pathname ...\n"
          "vma extract <filename> [-r <fifo>] <targetdir>\n"
          "vma verify <filename> [-v]\n"
-@@ -601,6 +602,67 @@
+@@ -601,6 +602,67 @@ static int create_archive(int argc, char **argv)
      return 0;
  }
  
@@ -78,7 +84,7 @@ Index: new/vma.c
  int main(int argc, char **argv)
  {
      const char *cmdname;
-@@ -627,6 +689,8 @@
+@@ -627,6 +689,8 @@ int main(int argc, char **argv)
          return extract_content(argc, argv);
      } else if (!strcmp(cmdname, "verify")) {
          return verify_content(argc, argv);
diff --git a/debian/patches/backup-vma-allow-empty-backups.patch b/debian/patches/backup-vma-allow-empty-backups.patch
index e4c7e65..b50bba4 100644
--- a/debian/patches/backup-vma-allow-empty-backups.patch
+++ b/debian/patches/backup-vma-allow-empty-backups.patch
@@ -1,13 +1,14 @@
-This patch allows the creation of vma files without data streams.
+commit 0568bf60b8b6964278047fcc029a5789458a6972
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:59:54 2014 +0200
 
-Such files only contain configuration data. This is useful if a
-user set backup=no to all VM disks.
+    backup-vma-allow-empty-backups.patch
 
-Index: new/vma-reader.c
-===================================================================
---- new.orig/vma-reader.c	2014-04-14 08:40:47.000000000 +0200
-+++ new/vma-reader.c	2014-04-14 10:33:00.000000000 +0200
-@@ -334,11 +334,6 @@
+diff --git a/vma-reader.c b/vma-reader.c
+index 9b7e41b..5d83562 100644
+--- a/vma-reader.c
++++ b/vma-reader.c
+@@ -334,11 +334,6 @@ static int vma_reader_read_head(VmaReader *vmar, Error **errp)
          }
      }
  
@@ -19,7 +20,7 @@ Index: new/vma-reader.c
      for (i = 0; i < VMA_MAX_CONFIGS; i++) {
          uint32_t name_ptr = GUINT32_FROM_BE(h->config_names[i]);
          uint32_t data_ptr = GUINT32_FROM_BE(h->config_data[i]);
-@@ -830,16 +825,20 @@
+@@ -830,16 +825,20 @@ static int vma_reader_restore_full(VmaReader *vmar, int vmstate_fd,
      }
  
      if (verbose) {
@@ -50,11 +51,11 @@ Index: new/vma-reader.c
          }
      }
      return ret;
-Index: new/vma-writer.c
-===================================================================
---- new.orig/vma-writer.c	2014-04-14 08:40:47.000000000 +0200
-+++ new/vma-writer.c	2014-04-14 11:00:45.000000000 +0200
-@@ -257,7 +257,7 @@
+diff --git a/vma-writer.c b/vma-writer.c
+index a2be614..c09911a 100644
+--- a/vma-writer.c
++++ b/vma-writer.c
+@@ -257,7 +257,7 @@ vma_queue_write(VmaWriter *vmaw, const void *buf, size_t bytes)
      }
  
      vmaw->co_writer = NULL;
@@ -63,7 +64,7 @@ Index: new/vma-writer.c
      return (done == bytes) ? bytes : -1;
  }
  
-@@ -381,10 +381,6 @@
+@@ -381,10 +381,6 @@ static int coroutine_fn vma_write_header(VmaWriter *vmaw)
      time_t ctime = time(NULL);
      head->ctime = GUINT64_TO_BE(ctime);
  
@@ -74,7 +75,7 @@ Index: new/vma-writer.c
      for (i = 0; i < VMA_MAX_CONFIGS; i++) {
          head->config_names[i] = GUINT32_TO_BE(vmaw->config_names[i]);
          head->config_data[i] = GUINT32_TO_BE(vmaw->config_data[i]);
-@@ -501,6 +497,23 @@
+@@ -501,6 +497,23 @@ static int vma_count_open_streams(VmaWriter *vmaw)
      return open_drives;
  }
  
@@ -98,7 +99,7 @@ Index: new/vma-writer.c
  /**
   * all jobs should call this when there is no more data
   * Returns: number of remaining stream (0 ==> finished)
-@@ -528,12 +541,7 @@
+@@ -528,12 +541,7 @@ vma_writer_close_stream(VmaWriter *vmaw, uint8_t dev_id)
  
      if (open_drives <= 0) {
          DPRINTF("vma_writer_set_status all drives completed\n");
@@ -112,11 +113,11 @@ Index: new/vma-writer.c
      }
  
      return open_drives;
-Index: new/vma.c
-===================================================================
---- new.orig/vma.c	2014-04-14 08:40:47.000000000 +0200
-+++ new/vma.c	2014-04-14 10:50:24.000000000 +0200
-@@ -33,7 +33,7 @@
+diff --git a/vma.c b/vma.c
+index 470499f..beca9a2 100644
+--- a/vma.c
++++ b/vma.c
+@@ -33,7 +33,7 @@ static void help(void)
          "\n"
          "vma list <filename>\n"
          "vma config <filename> [-c config]\n"
@@ -125,7 +126,7 @@ Index: new/vma.c
          "vma extract <filename> [-r <fifo>] <targetdir>\n"
          "vma verify <filename> [-v]\n"
          ;
-@@ -401,6 +401,18 @@
+@@ -401,6 +401,18 @@ typedef struct BackupJob {
  
  #define BACKUP_SECTORS_PER_CLUSTER (VMA_CLUSTER_SIZE / BDRV_SECTOR_SIZE)
  
@@ -144,7 +145,7 @@ Index: new/vma.c
  static void coroutine_fn backup_run(void *opaque)
  {
      BackupJob *job = (BackupJob *)opaque;
-@@ -474,8 +486,8 @@
+@@ -474,8 +486,8 @@ static int create_archive(int argc, char **argv)
      }
  
  
@@ -155,7 +156,7 @@ Index: new/vma.c
          help();
      }
  
-@@ -510,11 +522,11 @@
+@@ -510,11 +522,11 @@ static int create_archive(int argc, char **argv)
          l = g_list_next(l);
      }
  
@@ -169,7 +170,7 @@ Index: new/vma.c
  
          BlockDriver *drv = NULL;
          BlockDriverState *bs = bdrv_new(devname);
-@@ -546,37 +558,42 @@
+@@ -546,37 +558,42 @@ static int create_archive(int argc, char **argv)
      int percent = 0;
      int last_percent = -1;
  
@@ -182,13 +183,6 @@ Index: new/vma.c
 -            uint64_t total = 0;
 -            uint64_t transferred = 0;
 -            uint64_t zero_bytes = 0;
--
--            int i;
--            for (i = 0; i < 256; i++) {
--                if (vmastat.stream_info[i].size) {
--                    total += vmastat.stream_info[i].size;
--                    transferred += vmastat.stream_info[i].transferred;
--                    zero_bytes += vmastat.stream_info[i].zero_bytes;
 +    if (devcount) {
 +        while (1) {
 +            main_loop_wait(false);
@@ -207,42 +201,48 @@ Index: new/vma.c
 +                        transferred += vmastat.stream_info[i].transferred;
 +                        zero_bytes += vmastat.stream_info[i].zero_bytes;
 +                    }
-                 }
--            }
--            percent = (transferred*100)/total;
--            if (percent != last_percent) {
--                fprintf(stderr, "progress %d%% %zd/%zd %zd\n", percent,
--                        transferred, total, zero_bytes);
--                fflush(stderr);
++                }
 +                percent = (transferred*100)/total;
 +                if (percent != last_percent) {
 +                    fprintf(stderr, "progress %d%% %zd/%zd %zd\n", percent,
 +                            transferred, total, zero_bytes);
 +                    fflush(stderr);
  
--                last_percent = percent;
+-            int i;
+-            for (i = 0; i < 256; i++) {
+-                if (vmastat.stream_info[i].size) {
+-                    total += vmastat.stream_info[i].size;
+-                    transferred += vmastat.stream_info[i].transferred;
+-                    zero_bytes += vmastat.stream_info[i].zero_bytes;
 +                    last_percent = percent;
-+                }
+                 }
              }
--        }
+-            percent = (transferred*100)/total;
+-            if (percent != last_percent) {
+-                fprintf(stderr, "progress %d%% %zd/%zd %zd\n", percent,
+-                        transferred, total, zero_bytes);
+-                fflush(stderr);
  
--        if (vmastat.closed) {
--            break;
+-                last_percent = percent;
 +            if (vmastat.closed) {
 +                break;
-+            }
+             }
          }
+-
+-        if (vmastat.closed) {
+-            break;
+-        }
 +    } else {
 +        Coroutine *co = qemu_coroutine_create(backup_run_empty);
 +        qemu_coroutine_enter(co, vmaw);
      }
  
      bdrv_drain_all();
-Index: new/vma.h
-===================================================================
---- new.orig/vma.h	2014-04-14 08:40:47.000000000 +0200
-+++ new/vma.h	2014-04-14 10:50:00.000000000 +0200
-@@ -128,6 +128,7 @@
+diff --git a/vma.h b/vma.h
+index 98377e4..365ceb2 100644
+--- a/vma.h
++++ b/vma.h
+@@ -128,6 +128,7 @@ int64_t coroutine_fn vma_writer_write(VmaWriter *vmaw, uint8_t dev_id,
                                        size_t *zero_bytes);
  
  int coroutine_fn vma_writer_close_stream(VmaWriter *vmaw, uint8_t dev_id);
diff --git a/debian/patches/backup-vma-correctly-propagate-error.patch b/debian/patches/backup-vma-correctly-propagate-error.patch
index 74f2dc5..2232ce4 100644
--- a/debian/patches/backup-vma-correctly-propagate-error.patch
+++ b/debian/patches/backup-vma-correctly-propagate-error.patch
@@ -1,8 +1,27 @@
-Index: new/vma-writer.c
-===================================================================
---- new.orig/vma-writer.c	2014-03-27 08:48:32.000000000 +0100
-+++ new/vma-writer.c	2014-03-27 08:48:33.000000000 +0100
-@@ -797,6 +797,13 @@
+commit e88d17294e393a589e391cbb36ff2151eefb96ce
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:36 2014 +0200
+
+    backup-vma-correctly-propagate-error.patch
+
+diff --git a/blockdev.c b/blockdev.c
+index f17a1e1..2a41b26 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -1886,7 +1886,7 @@ static int pvebackup_dump_cb(void *opaque, BlockDriverState *target,
+                                buf, &zero_bytes);
+         if (ret < 0) {
+             if (!backup_state.error) {
+-                error_setg(&backup_state.error, "vma_writer_write error %d", ret);
++                vma_writer_error_propagate(backup_state.vmaw, &backup_state.error);
+             }
+             if (di->bs && di->bs->job) {
+                 block_job_cancel(di->bs->job);
+diff --git a/vma-writer.c b/vma-writer.c
+index 7ac1acc..b61b1e2 100644
+--- a/vma-writer.c
++++ b/vma-writer.c
+@@ -797,6 +797,13 @@ vma_writer_write(VmaWriter *vmaw, uint8_t dev_id, int64_t cluster_num,
      return transferred;
  }
  
@@ -16,11 +35,11 @@ Index: new/vma-writer.c
  int vma_writer_close(VmaWriter *vmaw, Error **errp)
  {
      g_assert(vmaw != NULL);
-Index: new/vma.h
-===================================================================
---- new.orig/vma.h	2014-03-27 08:48:32.000000000 +0100
-+++ new/vma.h	2014-03-27 08:48:33.000000000 +0100
-@@ -116,6 +116,7 @@
+diff --git a/vma.h b/vma.h
+index 9bb6ea4..98377e4 100644
+--- a/vma.h
++++ b/vma.h
+@@ -116,6 +116,7 @@ typedef struct VmaDeviceInfo {
  
  VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp);
  int vma_writer_close(VmaWriter *vmaw, Error **errp);
@@ -28,16 +47,3 @@ Index: new/vma.h
  void vma_writer_destroy(VmaWriter *vmaw);
  int vma_writer_add_config(VmaWriter *vmaw, const char *name, gpointer data,
                            size_t len);
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2014-03-27 08:48:33.000000000 +0100
-+++ new/blockdev.c	2014-03-27 08:49:50.000000000 +0100
-@@ -1796,7 +1796,7 @@
-                                buf, &zero_bytes);
-         if (ret < 0) {
-             if (!backup_state.error) {
--                error_setg(&backup_state.error, "vma_writer_write error %d", ret);
-+                vma_writer_error_propagate(backup_state.vmaw, &backup_state.error);
-             }
-             if (di->bs && di->bs->job) {
-                 block_job_cancel(di->bs->job);
diff --git a/debian/patches/backup-vma-remove-async-queue.patch b/debian/patches/backup-vma-remove-async-queue.patch
index 6f2dc0f..dde75db 100644
--- a/debian/patches/backup-vma-remove-async-queue.patch
+++ b/debian/patches/backup-vma-remove-async-queue.patch
@@ -1,12 +1,37 @@
-We do not gain much speed here, so I removed the whole queue code 
-to make things simpler.
+commit 702483f21dfdae6f4acb0c5e6c7509900bf62770
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:58:36 2014 +0200
 
-Also, previous code produced segmentation faults in qemu_co_mutex_lock().
+    backup-vma-remove-async-queue.patch
 
-Index: new/vma-writer.c
-===================================================================
---- new.orig/vma-writer.c	2014-03-27 08:59:26.000000000 +0100
-+++ new/vma-writer.c	2014-03-27 12:09:24.000000000 +0100
+diff --git a/blockdev.c b/blockdev.c
+index 2a41b26..eb31052 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -1965,6 +1965,11 @@ static void pvebackup_cancel(void *opaque)
+         error_setg(&backup_state.error, "backup cancelled");
+     }
+ 
++    if (backup_state.vmaw) {
++        /* make sure vma writer does not block anymore */
++        vma_writer_set_error(backup_state.vmaw, "backup cancelled");
++    }
++
+     /* drain all i/o (awake jobs waiting for aio) */
+     bdrv_drain_all();
+ 
+@@ -1977,6 +1982,7 @@ static void pvebackup_cancel(void *opaque)
+             if (job) {
+                 if (!di->completed) {
+                      block_job_cancel_sync(job);
++                     bdrv_drain_all(); /* drain all i/o (awake jobs waiting for aio) */
+                 }
+             }
+         }
+diff --git a/vma-writer.c b/vma-writer.c
+index b61b1e2..a2be614 100644
+--- a/vma-writer.c
++++ b/vma-writer.c
 @@ -33,14 +33,8 @@
      do { if (DEBUG_VMA) { printf("vma: " fmt, ## __VA_ARGS__); } } while (0)
  
@@ -24,7 +49,7 @@ Index: new/vma-writer.c
  
  struct VmaWriter {
      int fd;
-@@ -52,16 +46,14 @@
+@@ -52,16 +46,14 @@ struct VmaWriter {
      bool closed;
  
      /* we always write extents */
@@ -43,7 +68,7 @@ Index: new/vma-writer.c
      CoMutex flush_lock;
      Coroutine *co_writer;
  
-@@ -222,38 +214,39 @@
+@@ -222,38 +214,39 @@ static void vma_co_continue_write(void *opaque)
  }
  
  static ssize_t coroutine_fn
@@ -101,7 +126,7 @@ Index: new/vma-writer.c
                                       g_strerror(errno));
                  done = -1; /* always return failure for partial writes */
                  break;
-@@ -263,102 +256,9 @@
+@@ -263,102 +256,9 @@ vma_co_write(VmaWriter *vmaw, const void *buf, size_t bytes)
          }
      }
  
@@ -206,7 +231,7 @@ Index: new/vma-writer.c
  }
  
  VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
-@@ -425,20 +325,16 @@
+@@ -425,20 +325,16 @@ VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
      }
  
      /* we use O_DIRECT, so we need to align IO buffers */
@@ -230,7 +255,7 @@ Index: new/vma-writer.c
  
      uuid_copy(vmaw->uuid, uuid);
  
-@@ -465,8 +361,7 @@
+@@ -465,8 +361,7 @@ err:
  static int coroutine_fn vma_write_header(VmaWriter *vmaw)
  {
      assert(vmaw);
@@ -240,7 +265,7 @@ Index: new/vma-writer.c
      VmaHeader *head = (VmaHeader *)buf;
  
      int i;
-@@ -477,7 +372,7 @@
+@@ -477,7 +372,7 @@ static int coroutine_fn vma_write_header(VmaWriter *vmaw)
          return vmaw->status;
      }
  
@@ -249,7 +274,7 @@ Index: new/vma-writer.c
  
      head->magic = VMA_MAGIC;
      head->version = GUINT32_TO_BE(1); /* v1 */
-@@ -512,7 +407,7 @@
+@@ -512,7 +407,7 @@ static int coroutine_fn vma_write_header(VmaWriter *vmaw)
      uint32_t header_size = sizeof(VmaHeader) + vmaw->header_blob_table_size;
      head->header_size = GUINT32_TO_BE(header_size);
  
@@ -258,7 +283,7 @@ Index: new/vma-writer.c
          return -1; /* just to be sure */
      }
  
-@@ -810,13 +705,7 @@
+@@ -810,13 +705,7 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
  
      int i;
  
@@ -273,7 +298,7 @@ Index: new/vma-writer.c
  
      if (vmaw->cmd) {
          if (pclose(vmaw->cmd) < 0) {
-@@ -874,9 +763,5 @@
+@@ -874,9 +763,5 @@ void vma_writer_destroy(VmaWriter *vmaw)
          g_checksum_free(vmaw->md5csum);
      }
  
@@ -283,27 +308,3 @@ Index: new/vma-writer.c
 -
      g_free(vmaw);
  }
-Index: new/blockdev.c
-===================================================================
---- new.orig/blockdev.c	2014-03-27 12:10:25.000000000 +0100
-+++ new/blockdev.c	2014-03-27 12:10:47.000000000 +0100
-@@ -1875,6 +1875,11 @@
-         error_setg(&backup_state.error, "backup cancelled");
-     }
- 
-+    if (backup_state.vmaw) {
-+        /* make sure vma writer does not block anymore */
-+        vma_writer_set_error(backup_state.vmaw, "backup cancelled");
-+    }
-+
-     /* drain all i/o (awake jobs waiting for aio) */
-     bdrv_drain_all();
- 
-@@ -1887,6 +1892,7 @@
-             if (job) {
-                 if (!di->completed) {
-                      block_job_cancel_sync(job);
-+                     bdrv_drain_all(); /* drain all i/o (awake jobs waiting for aio) */
-                 }
-             }
-         }
diff --git a/debian/patches/backup-vma-restore-tolerate-a-size-difference-up-to-4M.patch b/debian/patches/backup-vma-restore-tolerate-a-size-difference-up-to-4M.patch
index 2e76dae..1638c04 100644
--- a/debian/patches/backup-vma-restore-tolerate-a-size-difference-up-to-4M.patch
+++ b/debian/patches/backup-vma-restore-tolerate-a-size-difference-up-to-4M.patch
@@ -1,16 +1,11 @@
-From 4ca68d0ccfd64f2fdc63ba44813bbafab8d90c81 Mon Sep 17 00:00:00 2001
-From: Dietmar Maurer <dietmar at proxmox.com>
-Date: Tue, 26 Mar 2013 06:21:16 +0100
-Subject: [PATCH v5 8/8] vma restore: tolerate a size difference up to 4M
+commit df82560d72df7d33741e3fda4831f7354e8b02f1
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:55:21 2014 +0200
 
-
-Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
----
- vma-reader.c |    8 +++++++-
- 1 files changed, 7 insertions(+), 1 deletions(-)
+    backup-vma-restore-tolerate-a-size-difference-up-to-4M.patch
 
 diff --git a/vma-reader.c b/vma-reader.c
-index a740f04..69e7578 100644
+index 79e8666..9b7e41b 100644
 --- a/vma-reader.c
 +++ b/vma-reader.c
 @@ -465,7 +465,13 @@ int vma_reader_register_bs(VmaReader *vmar, guint8 dev_id, BlockDriverState *bs,
@@ -28,6 +23,3 @@ index a740f04..69e7578 100644
          error_setg(errp, "vma_reader_register_bs for stream %s failed - "
                     "unexpected size %zd != %zd", vmar->devinfo[dev_id].devname,
                     size, vmar->devinfo[dev_id].size);
--- 
-1.7.2.5
-
diff --git a/debian/patches/disable-efi-enable-pxe-roms.patch b/debian/patches/disable-efi-enable-pxe-roms.patch
index 9601154..fa6b1bd 100644
--- a/debian/patches/disable-efi-enable-pxe-roms.patch
+++ b/debian/patches/disable-efi-enable-pxe-roms.patch
@@ -1,8 +1,14 @@
-Index: new/hw/net/e1000.c
-===================================================================
---- new.orig/hw/net/e1000.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/hw/net/e1000.c	2014-01-29 12:54:48.000000000 +0100
-@@ -1571,7 +1571,7 @@
+commit ef817df2a3979b49e11646d37b3984ae25b36ebe
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:59:54 2014 +0200
+
+    disable-efi-enable-pxe-roms.patch
+
+diff --git a/hw/net/e1000.c b/hw/net/e1000.c
+index 8387443..6e28e0f 100644
+--- a/hw/net/e1000.c
++++ b/hw/net/e1000.c
+@@ -1571,7 +1571,7 @@ static void e1000_class_init(ObjectClass *klass, void *data)
  
      k->init = pci_e1000_init;
      k->exit = pci_e1000_uninit;
@@ -11,11 +17,11 @@ Index: new/hw/net/e1000.c
      k->vendor_id = PCI_VENDOR_ID_INTEL;
      k->device_id = E1000_DEVID;
      k->revision = 0x03;
-Index: new/hw/net/ne2000.c
-===================================================================
---- new.orig/hw/net/ne2000.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/hw/net/ne2000.c	2014-01-29 12:55:50.000000000 +0100
-@@ -767,7 +767,7 @@
+diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
+index 4c32e9e..12cf3ed 100644
+--- a/hw/net/ne2000.c
++++ b/hw/net/ne2000.c
+@@ -767,7 +767,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
  
      k->init = pci_ne2000_init;
      k->exit = pci_ne2000_exit;
@@ -24,11 +30,11 @@ Index: new/hw/net/ne2000.c
      k->vendor_id = PCI_VENDOR_ID_REALTEK;
      k->device_id = PCI_DEVICE_ID_REALTEK_8029;
      k->class_id = PCI_CLASS_NETWORK_ETHERNET;
-Index: new/hw/net/pcnet-pci.c
-===================================================================
---- new.orig/hw/net/pcnet-pci.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/hw/net/pcnet-pci.c	2014-01-29 12:56:21.000000000 +0100
-@@ -359,7 +359,7 @@
+diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
+index 6a5d806..945fff4 100644
+--- a/hw/net/pcnet-pci.c
++++ b/hw/net/pcnet-pci.c
+@@ -359,7 +359,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data)
  
      k->init = pci_pcnet_init;
      k->exit = pci_pcnet_uninit;
@@ -37,11 +43,11 @@ Index: new/hw/net/pcnet-pci.c
      k->vendor_id = PCI_VENDOR_ID_AMD;
      k->device_id = PCI_DEVICE_ID_AMD_LANCE;
      k->revision = 0x10;
-Index: new/hw/net/rtl8139.c
-===================================================================
---- new.orig/hw/net/rtl8139.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/hw/net/rtl8139.c	2014-01-29 12:56:38.000000000 +0100
-@@ -3560,7 +3560,7 @@
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index 5329f44..4be91a1 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -3560,7 +3560,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
  
      k->init = pci_rtl8139_init;
      k->exit = pci_rtl8139_uninit;
@@ -50,11 +56,11 @@ Index: new/hw/net/rtl8139.c
      k->vendor_id = PCI_VENDOR_ID_REALTEK;
      k->device_id = PCI_DEVICE_ID_REALTEK_8139;
      k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */
-Index: new/hw/virtio/virtio-pci.c
-===================================================================
---- new.orig/hw/virtio/virtio-pci.c	2013-12-03 06:36:18.000000000 +0100
-+++ new/hw/virtio/virtio-pci.c	2014-01-29 12:57:38.000000000 +0100
-@@ -1418,7 +1418,7 @@
+diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
+index ce97514..d815b0e 100644
+--- a/hw/virtio/virtio-pci.c
++++ b/hw/virtio/virtio-pci.c
+@@ -1445,7 +1445,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data)
      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
      VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass);
  
diff --git a/debian/patches/enable-kvm-by-default.patch b/debian/patches/enable-kvm-by-default.patch
index 805c5f5..07c8b4a 100644
--- a/debian/patches/enable-kvm-by-default.patch
+++ b/debian/patches/enable-kvm-by-default.patch
@@ -1,8 +1,14 @@
-Index: new/vl.c
-===================================================================
---- new.orig/vl.c	2013-11-27 11:12:55.000000000 +0100
-+++ new/vl.c	2013-11-27 11:26:13.000000000 +0100
-@@ -2638,8 +2638,8 @@
+commit b22db5e833c026691d16201093a8e31618934d2a
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    enable-kvm-by-default.patch
+
+diff --git a/vl.c b/vl.c
+index 5ef8a79..4abf217 100644
+--- a/vl.c
++++ b/vl.c
+@@ -2729,8 +2729,8 @@ static int configure_accelerator(QEMUMachine *machine)
  
      p = qemu_opt_get(qemu_get_machine_opts(), "accel");
      if (p == NULL) {
diff --git a/debian/patches/fairsched.diff b/debian/patches/fairsched.diff
index 5103295..83c7062 100644
--- a/debian/patches/fairsched.diff
+++ b/debian/patches/fairsched.diff
@@ -1,8 +1,14 @@
-Index: new/qemu-options.hx
-===================================================================
---- new.orig/qemu-options.hx	2013-11-26 10:50:22.000000000 +0100
-+++ new/qemu-options.hx	2013-11-26 11:04:08.000000000 +0100
-@@ -362,6 +362,12 @@
+commit ee3a9abef8f6e42463a572e26a2a166e10507cc6
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:53:07 2014 +0200
+
+    fairsched.diff
+
+diff --git a/qemu-options.hx b/qemu-options.hx
+index 2d33815..205fd24 100644
+--- a/qemu-options.hx
++++ b/qemu-options.hx
+@@ -363,6 +363,12 @@ STEXI
  @table @option
  ETEXI
  
@@ -15,11 +21,11 @@ Index: new/qemu-options.hx
  DEF("fda", HAS_ARG, QEMU_OPTION_fda,
      "-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)
-Index: new/vl.c
-===================================================================
---- new.orig/vl.c	2013-11-26 10:50:23.000000000 +0100
-+++ new/vl.c	2013-11-26 11:04:08.000000000 +0100
-@@ -155,6 +155,8 @@
+diff --git a/vl.c b/vl.c
+index 9975e5a..cf7f505 100644
+--- a/vl.c
++++ b/vl.c
+@@ -102,6 +102,8 @@ int main(int argc, char **argv)
  #endif
  #include "sysemu/qtest.h"
  
@@ -27,8 +33,8 @@ Index: new/vl.c
 +
  #include "disas/disas.h"
  
- #include "qemu/sockets.h"
-@@ -207,6 +209,7 @@
+ 
+@@ -152,6 +154,7 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
  CharDriverState *sclp_hds[MAX_SCLP_CONSOLES];
  int win2k_install_hack = 0;
  int singlestep = 0;
@@ -36,7 +42,7 @@ Index: new/vl.c
  int smp_cpus = 1;
  int max_cpus = 0;
  int smp_cores = 1;
-@@ -2819,6 +2822,9 @@
+@@ -2930,6 +2933,9 @@ out:
  int main(int argc, char **argv, char **envp)
  {
      int i;
@@ -46,7 +52,7 @@ Index: new/vl.c
      int snapshot, linux_boot;
      const char *icount_option = NULL;
      const char *initrd_filename;
-@@ -3553,6 +3559,21 @@
+@@ -3677,6 +3683,21 @@ int main(int argc, char **argv, char **envp)
                      exit(1);
                  }
                  break;
@@ -68,7 +74,7 @@ Index: new/vl.c
  	    case QEMU_OPTION_vnc:
  #ifdef CONFIG_VNC
                  display_remote++;
-@@ -4136,6 +4157,39 @@
+@@ -4268,6 +4289,39 @@ int main(int argc, char **argv, char **envp)
          }
      }
  
@@ -108,10 +114,11 @@ Index: new/vl.c
      cpu_exec_init_all();
  
      blk_mig_init();
-Index: new/vzsyscalls.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vzsyscalls.h	2013-11-26 11:04:08.000000000 +0100
+diff --git a/vzsyscalls.h b/vzsyscalls.h
+new file mode 100644
+index 0000000..bd9416f
+--- /dev/null
++++ b/vzsyscalls.h
 @@ -0,0 +1,47 @@
 +/*
 + *  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
diff --git a/debian/patches/fix-qemu-img-snapshot-removal.patch b/debian/patches/fix-qemu-img-snapshot-removal.patch
index 13c3bd7..5fbc4a0 100644
--- a/debian/patches/fix-qemu-img-snapshot-removal.patch
+++ b/debian/patches/fix-qemu-img-snapshot-removal.patch
@@ -1,8 +1,14 @@
-Index: new/qemu-img.c
-===================================================================
---- new.orig/qemu-img.c	2013-11-27 12:00:36.000000000 +0100
-+++ new/qemu-img.c	2013-11-27 12:06:45.000000000 +0100
-@@ -1778,7 +1778,8 @@
+commit 7239e030731f4690c0e1410d00e3e24a49ab6f7c
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    fix-qemu-img-snapshot-removal.patch
+
+diff --git a/qemu-img.c b/qemu-img.c
+index 8455994..54878cc 100644
+--- a/qemu-img.c
++++ b/qemu-img.c
+@@ -1897,7 +1897,8 @@ static int img_info(int argc, char **argv)
  
      list = collect_image_info_list(filename, fmt, chain);
      if (!list) {
diff --git a/debian/patches/internal-snapshot-async.patch b/debian/patches/internal-snapshot-async.patch
index d7d7252..e2cd7a0 100644
--- a/debian/patches/internal-snapshot-async.patch
+++ b/debian/patches/internal-snapshot-async.patch
@@ -1,31 +1,14 @@
-From 46fd4bb673a91d40352c95e9d3f62f63b5021053 Mon Sep 17 00:00:00 2001
-From: Stefan Priebe <s.priebe at profihost.ag>
-Date: Fri, 29 Nov 2013 22:17:03 +0100
-Subject: [PATCH] internal-snapshot-async-qemu1.7.patch
+commit 4e4fafb9e19247f8884bbc2b839dd52be58bb2c1
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:59:54 2014 +0200
 
----
- Makefile.objs           |    1 +
- block.c                 |    2 +-
- hmp-commands.hx         |   34 ++++
- hmp.c                   |   57 ++++++
- hmp.h                   |    5 +
- include/block/block.h   |    1 +
- include/sysemu/sysemu.h |    5 +-
- monitor.c               |    7 +
- qapi-schema.json        |   46 +++++
- qemu-options.hx         |   13 ++
- qmp-commands.hx         |   31 +++
- savevm-async.c          |  478 +++++++++++++++++++++++++++++++++++++++++++++++
- savevm.c                |   10 +-
- vl.c                    |    9 +
- 14 files changed, 692 insertions(+), 7 deletions(-)
- create mode 100644 savevm-async.c
+    internal-snapshot-async.patch
 
-Index: new/Makefile.objs
-===================================================================
---- new.orig/Makefile.objs	2013-12-06 07:46:38.000000000 +0100
-+++ new/Makefile.objs	2013-12-06 08:59:22.000000000 +0100
-@@ -56,6 +56,7 @@
+diff --git a/Makefile.objs b/Makefile.objs
+index 43b0f4f..a370347 100644
+--- a/Makefile.objs
++++ b/Makefile.objs
+@@ -55,6 +55,7 @@ common-obj-$(CONFIG_RDMA) += migration-rdma.o
  common-obj-y += qemu-char.o #aio.o
  common-obj-y += block-migration.o
  common-obj-y += page_cache.o xbzrle.o
@@ -33,11 +16,11 @@ Index: new/Makefile.objs
  
  common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
  
-Index: new/block.c
-===================================================================
---- new.orig/block.c	2013-12-06 07:46:38.000000000 +0100
-+++ new/block.c	2013-12-06 08:59:22.000000000 +0100
-@@ -1710,7 +1710,7 @@
+diff --git a/block.c b/block.c
+index 990a754..0c6ffc7 100644
+--- a/block.c
++++ b/block.c
+@@ -1967,7 +1967,7 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
              bs_new->drv ? bs_new->drv->format_name : "");
  }
  
@@ -46,11 +29,11 @@ Index: new/block.c
  {
      assert(!bs->dev);
      assert(!bs->job);
-Index: new/hmp-commands.hx
-===================================================================
---- new.orig/hmp-commands.hx	2013-12-06 08:57:27.000000000 +0100
-+++ new/hmp-commands.hx	2013-12-06 08:59:22.000000000 +0100
-@@ -1731,6 +1731,8 @@
+diff --git a/hmp-commands.hx b/hmp-commands.hx
+index 1b59d42..46d8fbb 100644
+--- a/hmp-commands.hx
++++ b/hmp-commands.hx
+@@ -1777,6 +1777,8 @@ show migration status
  show current migration capabilities
  @item info migrate_cache_size
  show current migration XBZRLE cache size
@@ -59,7 +42,7 @@ Index: new/hmp-commands.hx
  @item info balloon
  show balloon information
  @item info qtree
-@@ -1752,3 +1754,35 @@
+@@ -1798,3 +1800,35 @@ ETEXI
  STEXI
  @end table
  ETEXI
@@ -95,12 +78,12 @@ Index: new/hmp-commands.hx
 +        .help       = "Resume VM after snaphot.",
 +        .mhandler.cmd = hmp_savevm_end,
 +    },
-Index: new/hmp.c
-===================================================================
---- new.orig/hmp.c	2013-12-06 08:57:27.000000000 +0100
-+++ new/hmp.c	2013-12-06 08:59:22.000000000 +0100
-@@ -1655,3 +1655,60 @@
- 
+diff --git a/hmp.c b/hmp.c
+index 8a0ad29..89389c7 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -1738,3 +1738,60 @@ void hmp_object_del(Monitor *mon, const QDict *qdict)
+     qmp_object_del(id, &err);
      hmp_handle_error(mon, &err);
  }
 +
@@ -160,11 +143,11 @@ Index: new/hmp.c
 +        monitor_printf(mon, "Error: %s\n", info->error);
 +    }
 +}
-Index: new/hmp.h
-===================================================================
---- new.orig/hmp.h	2013-12-06 07:46:38.000000000 +0100
-+++ new/hmp.h	2013-12-06 08:59:22.000000000 +0100
-@@ -25,6 +25,7 @@
+diff --git a/hmp.h b/hmp.h
+index a9f3c2c..9af6d71 100644
+--- a/hmp.h
++++ b/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);
@@ -172,7 +155,7 @@ Index: new/hmp.h
  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 @@
+@@ -84,6 +85,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);
@@ -183,11 +166,11 @@ Index: new/hmp.h
  void hmp_send_key(Monitor *mon, const QDict *qdict);
  void hmp_screen_dump(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	2013-12-06 07:46:38.000000000 +0100
-+++ new/include/block/block.h	2013-12-06 08:59:22.000000000 +0100
-@@ -214,6 +214,7 @@
+diff --git a/include/block/block.h b/include/block/block.h
+index b3230a2..09e036d 100644
+--- a/include/block/block.h
++++ b/include/block/block.h
+@@ -251,6 +251,7 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs,
      const char *backing_file);
  int bdrv_get_backing_file_depth(BlockDriverState *bs);
  int bdrv_truncate(BlockDriverState *bs, int64_t offset);
@@ -195,11 +178,11 @@ Index: new/include/block/block.h
  int64_t bdrv_getlength(BlockDriverState *bs);
  int64_t bdrv_get_allocated_file_size(BlockDriverState *bs);
  void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
-Index: new/include/sysemu/sysemu.h
-===================================================================
---- new.orig/include/sysemu/sysemu.h	2013-12-06 07:46:38.000000000 +0100
-+++ new/include/sysemu/sysemu.h	2013-12-06 08:59:22.000000000 +0100
-@@ -73,16 +73,17 @@
+diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
+index ba5c7f8..d27abb3 100644
+--- a/include/sysemu/sysemu.h
++++ b/include/sysemu/sysemu.h
+@@ -73,16 +73,17 @@ void qemu_add_machine_init_done_notifier(Notifier *notify);
  
  void do_savevm(Monitor *mon, const QDict *qdict);
  int load_vmstate(const char *name);
@@ -219,11 +202,11 @@ Index: new/include/sysemu/sysemu.h
  void qemu_savevm_state_cancel(void);
  uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size);
  int qemu_loadvm_state(QEMUFile *f);
-Index: new/monitor.c
-===================================================================
---- new.orig/monitor.c	2013-12-06 07:46:38.000000000 +0100
-+++ new/monitor.c	2013-12-06 08:59:22.000000000 +0100
-@@ -2908,6 +2908,13 @@
+diff --git a/monitor.c b/monitor.c
+index a69dd39..5646d1e 100644
+--- a/monitor.c
++++ b/monitor.c
+@@ -2931,6 +2931,13 @@ static mon_cmd_t info_cmds[] = {
          .mhandler.cmd = hmp_info_migrate_cache_size,
      },
      {
@@ -237,11 +220,11 @@ Index: new/monitor.c
          .name       = "balloon",
          .args_type  = "",
          .params     = "",
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-12-06 08:57:27.000000000 +0100
-+++ new/qapi-schema.json	2013-12-06 08:59:22.000000000 +0100
-@@ -740,6 +740,42 @@
+diff --git a/qapi-schema.json b/qapi-schema.json
+index e3c39ea..3dc9a42 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -820,6 +820,42 @@
             '*downtime': 'int',
             '*setup-time': 'int'} }
  
@@ -284,7 +267,7 @@ Index: new/qapi-schema.json
  ##
  # @query-migrate
  #
-@@ -3436,8 +3472,18 @@
+@@ -3687,8 +3723,18 @@
  #
  # Since: 1.2.0
  ##
@@ -303,11 +286,11 @@ Index: new/qapi-schema.json
  ##
  # @QKeyCode:
  #
-Index: new/qemu-options.hx
-===================================================================
---- new.orig/qemu-options.hx	2013-12-06 07:46:38.000000000 +0100
-+++ new/qemu-options.hx	2013-12-06 08:59:22.000000000 +0100
-@@ -2734,6 +2734,19 @@
+diff --git a/qemu-options.hx b/qemu-options.hx
+index 205fd24..26e49f8 100644
+--- a/qemu-options.hx
++++ b/qemu-options.hx
+@@ -2759,6 +2759,19 @@ STEXI
  Start right away with a saved state (@code{loadvm} in monitor)
  ETEXI
  
@@ -327,12 +310,12 @@ Index: new/qemu-options.hx
  #ifndef _WIN32
  DEF("daemonize", 0, QEMU_OPTION_daemonize, \
      "-daemonize      daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
-Index: new/qmp-commands.hx
-===================================================================
---- new.orig/qmp-commands.hx	2013-12-06 07:46:38.000000000 +0100
-+++ new/qmp-commands.hx	2013-12-06 08:59:22.000000000 +0100
-@@ -3326,3 +3326,34 @@
- <- { "return": {} }
+diff --git a/qmp-commands.hx b/qmp-commands.hx
+index c8e5fdc..e7b5295 100644
+--- a/qmp-commands.hx
++++ b/qmp-commands.hx
+@@ -3593,3 +3593,34 @@ Example:
+                    } } ] }
  
  EQMP
 +
@@ -366,10 +349,11 @@ Index: new/qmp-commands.hx
 +        .args_type  = "",
 +        .mhandler.cmd_new = qmp_marshal_input_query_savevm,
 +    },
-Index: new/savevm-async.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/savevm-async.c	2013-12-06 08:59:22.000000000 +0100
+diff --git a/savevm-async.c b/savevm-async.c
+new file mode 100644
+index 0000000..693d96f
+--- /dev/null
++++ b/savevm-async.c
 @@ -0,0 +1,478 @@
 +#include "qemu-common.h"
 +#include "qapi/qmp/qerror.h"
@@ -629,7 +613,7 @@ Index: new/savevm-async.c
 +
 +    /* Open the image */
 +    snap_state.bs = bdrv_new("vmstate");
-+    ret = bdrv_open(snap_state.bs, statefile, NULL, bdrv_oflags, drv, &local_err);
++    ret = bdrv_open(&snap_state.bs, statefile, NULL, NULL, bdrv_oflags, drv, &local_err);
 +
 +    if (ret < 0) {
 +        error_set(errp, ERROR_CLASS_GENERIC_ERROR, "failed to open '%s'", statefile);
@@ -814,7 +798,7 @@ Index: new/savevm-async.c
 +    int ret = -1;
 +
 +    bs = bdrv_new("vmstate");
-+    ret = bdrv_open(bs, filename, NULL, BDRV_O_CACHE_WB, drv, &local_err);
++    ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_CACHE_WB, drv, &local_err);
 +    bdrv_set_in_use(bs, 1);
 +    bdrv_ref(bs);
 +
@@ -849,11 +833,11 @@ Index: new/savevm-async.c
 +    }
 +    return ret;
 +}
-Index: new/savevm.c
-===================================================================
---- new.orig/savevm.c	2013-12-06 07:46:38.000000000 +0100
-+++ new/savevm.c	2013-12-06 08:59:22.000000000 +0100
-@@ -1845,11 +1845,11 @@
+diff --git a/savevm.c b/savevm.c
+index 22123be..bfdaff6 100644
+--- a/savevm.c
++++ b/savevm.c
+@@ -460,11 +460,11 @@ bool qemu_savevm_state_blocked(Error **errp)
      return false;
  }
  
@@ -865,9 +849,9 @@ Index: new/savevm.c
 -    int ret;
 +    int ret = 0;
  
+     trace_savevm_state_begin();
      QTAILQ_FOREACH(se, &savevm_handlers, entry) {
-         if (!se->ops || !se->ops->set_params) {
-@@ -1890,6 +1890,7 @@
+@@ -506,6 +506,7 @@ void qemu_savevm_state_begin(QEMUFile *f,
              break;
          }
      }
@@ -875,7 +859,7 @@ Index: new/savevm.c
  }
  
  /*
-@@ -1937,7 +1938,7 @@
+@@ -554,7 +555,7 @@ int qemu_savevm_state_iterate(QEMUFile *f)
      return ret;
  }
  
@@ -884,8 +868,8 @@ Index: new/savevm.c
  {
      SaveStateEntry *se;
      int ret;
-@@ -1962,7 +1963,7 @@
-         trace_savevm_section_end(se->section_id);
+@@ -581,7 +582,7 @@ void qemu_savevm_state_complete(QEMUFile *f)
+         trace_savevm_section_end(se->idstr, se->section_id);
          if (ret < 0) {
              qemu_file_set_error(f, ret);
 -            return;
@@ -893,7 +877,7 @@ Index: new/savevm.c
          }
      }
  
-@@ -1991,6 +1992,7 @@
+@@ -610,6 +611,7 @@ void qemu_savevm_state_complete(QEMUFile *f)
  
      qemu_put_byte(f, QEMU_VM_EOF);
      qemu_fflush(f);
@@ -901,27 +885,19 @@ Index: new/savevm.c
  }
  
  uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size)
-Index: new/vl.c
-===================================================================
---- new.orig/vl.c	2013-12-06 07:46:38.000000000 +0100
-+++ new/vl.c	2013-12-06 08:59:22.000000000 +0100
-@@ -1643,6 +1643,7 @@
-         info->name = g_strdup(m->name);
-         info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;
- 
-+
-         if (strcmp(m->name, current_machine->name) == 0) {
-             info->has_is_current = true;
-             info->is_current = true;
-@@ -2842,6 +2843,7 @@
+diff --git a/vl.c b/vl.c
+index 81ef69e..6661883 100644
+--- a/vl.c
++++ b/vl.c
+@@ -2953,6 +2953,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;
      QEMUMachine *machine;
      const char *cpu_model;
-     const char *vga_model = "none";
-@@ -3455,6 +3457,9 @@
+@@ -3574,6 +3575,9 @@ int main(int argc, char **argv, char **envp)
  	    case QEMU_OPTION_loadvm:
  		loadvm = optarg;
  		break;
@@ -931,7 +907,7 @@ Index: new/vl.c
              case QEMU_OPTION_full_screen:
                  full_screen = 1;
                  break;
-@@ -4406,6 +4411,10 @@
+@@ -4541,6 +4545,10 @@ int main(int argc, char **argv, char **envp)
          if (load_vmstate(loadvm) < 0) {
              autostart = 0;
          }
diff --git a/debian/patches/modify-query-machines.patch b/debian/patches/modify-query-machines.patch
index 58c6cc0..33aad20 100644
--- a/debian/patches/modify-query-machines.patch
+++ b/debian/patches/modify-query-machines.patch
@@ -1,8 +1,14 @@
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-11-27 11:35:03.000000000 +0100
-+++ new/qapi-schema.json	2013-11-27 11:41:45.000000000 +0100
-@@ -3180,6 +3180,8 @@
+commit aa270de7173705221a9abe99747194b113be3fea
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    modify-query-machines.patch
+
+diff --git a/qapi-schema.json b/qapi-schema.json
+index 70bafb0..c3a86de 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -3431,6 +3431,8 @@
  #
  # @default: #optional whether the machine is default
  #
@@ -11,7 +17,7 @@ Index: new/qapi-schema.json
  # @cpu-max: maximum number of CPUs supported by the machine type
  #           (since 1.5.0)
  #
-@@ -3187,7 +3189,7 @@
+@@ -3438,7 +3440,7 @@
  ##
  { 'type': 'MachineInfo',
    'data': { 'name': 'str', '*alias': 'str',
@@ -20,15 +26,15 @@ Index: new/qapi-schema.json
  
  ##
  # @query-machines:
-Index: new/vl.c
-===================================================================
---- new.orig/vl.c	2013-11-27 11:27:31.000000000 +0100
-+++ new/vl.c	2013-11-27 11:38:27.000000000 +0100
-@@ -1643,6 +1643,11 @@
+diff --git a/vl.c b/vl.c
+index 4abf217..81ef69e 100644
+--- a/vl.c
++++ b/vl.c
+@@ -1673,6 +1673,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
          info->name = g_strdup(m->name);
          info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;
  
-+        if (strcmp(m->name, current_machine->name) == 0) {
++        if (strcmp(m->name, MACHINE_GET_CLASS(current_machine)->qemu_machine->name) == 0) {
 +            info->has_is_current = true;
 +            info->is_current = true;
 +        }
diff --git a/debian/patches/modify-query-spice.patch b/debian/patches/modify-query-spice.patch
index 572e27a..94c8071 100644
--- a/debian/patches/modify-query-spice.patch
+++ b/debian/patches/modify-query-spice.patch
@@ -1,33 +1,14 @@
-Return last ticket with query-spice
+commit 7b24e1cf377273df5f3278e8e423eab1bb77f1af
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:32 2014 +0200
 
-We use this to implement spice seemless migration. The current spice code
-reconnect to the migrated VM using the original ticket. So we need 
-a way to read the original ticket.
+    modify-query-spice.patch
 
-Limits: This only works for a single spice session.
-
-
-Index: new/ui/spice-core.c
-===================================================================
---- new.orig/ui/spice-core.c	2013-11-27 10:51:33.000000000 +0100
-+++ new/ui/spice-core.c	2013-11-27 11:43:08.000000000 +0100
-@@ -539,6 +539,11 @@
-     micro = SPICE_SERVER_VERSION & 0xff;
-     info->compiled_version = g_strdup_printf("%d.%d.%d", major, minor, micro);
- 
-+    if (auth_passwd) {
-+        info->has_ticket = true;
-+        info->ticket =  g_strdup(auth_passwd);
-+    }
-+
-     if (port) {
-         info->has_port = true;
-         info->port = port;
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-11-27 11:41:45.000000000 +0100
-+++ new/qapi-schema.json	2013-11-27 11:43:08.000000000 +0100
-@@ -1209,11 +1209,14 @@
+diff --git a/qapi-schema.json b/qapi-schema.json
+index c3a86de..e823314 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -1320,11 +1320,14 @@
  #
  # @channels: a list of @SpiceChannel for each active spice channel
  #
@@ -42,3 +23,19 @@ Index: new/qapi-schema.json
             'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
  
  ##
+diff --git a/ui/spice-core.c b/ui/spice-core.c
+index 4cce3b3..627ed54 100644
+--- a/ui/spice-core.c
++++ b/ui/spice-core.c
+@@ -540,6 +540,11 @@ SpiceInfo *qmp_query_spice(Error **errp)
+     micro = SPICE_SERVER_VERSION & 0xff;
+     info->compiled_version = g_strdup_printf("%d.%d.%d", major, minor, micro);
+ 
++    if (auth_passwd) {
++        info->has_ticket = true;
++        info->ticket =  g_strdup(auth_passwd);
++    }
++
+     if (port) {
+         info->has_port = true;
+         info->port = port;
diff --git a/debian/patches/pve-auth.patch b/debian/patches/pve-auth.patch
index a59cacf..6e856e0 100644
--- a/debian/patches/pve-auth.patch
+++ b/debian/patches/pve-auth.patch
@@ -1,171 +1,25 @@
-Index: new/ui/vnc.c
-===================================================================
---- new.orig/ui/vnc.c	2013-11-26 11:44:21.000000000 +0100
-+++ new/ui/vnc.c	2013-11-26 11:44:30.000000000 +0100
-@@ -43,6 +43,125 @@
- #include "vnc_keysym.h"
- #include "d3des.h"
- 
-+static int pve_vmid = 0;
-+
-+void pve_auth_setup(int vmid) {
-+	pve_vmid = vmid;
-+}
-+
-+static char *
-+urlencode(char *buf, const char *value)
-+{
-+	static const char *hexchar = "0123456789abcdef";
-+	char *p = buf;
-+	int i;
-+	int l = strlen(value);
-+	for (i = 0; i < l; i++) {
-+		char c = value[i];
-+		if (('a' <= c && c <= 'z') ||
-+		    ('A' <= c && c <= 'Z') ||
-+		    ('0' <= c && c <= '9')) {
-+			*p++ = c;
-+		} else if (c == 32) {
-+			*p++ = '+';
-+		} else {
-+			*p++ = '%';
-+			*p++ = hexchar[c >> 4];
-+			*p++ = hexchar[c & 15];
-+		}
-+	}
-+	*p = 0;
-+
-+	return p;
-+}
-+
-+int
-+pve_auth_verify(const char *clientip, const char *username, const char *passwd)
-+{
-+	struct sockaddr_in server;
-+
-+	int sfd = socket(AF_INET, SOCK_STREAM, 0);
-+	if (sfd == -1) {
-+		perror("pve_auth_verify: socket failed");
-+		return -1;
-+	}
-+
-+	struct hostent *he;
-+	if ((he = gethostbyname("localhost")) == NULL) {
-+		fprintf(stderr, "pve_auth_verify: error resolving hostname\n");
-+		goto err;
-+	}
-+
-+	memcpy(&server.sin_addr, he->h_addr_list[0], he->h_length);
-+	server.sin_family = AF_INET;
-+	server.sin_port = htons(85);
-+
-+	if (connect(sfd, (struct sockaddr *)&server, sizeof(server))) {
-+		perror("pve_auth_verify: error connecting to server");
-+		goto err;
-+	}
-+
-+	char buf[8192];
-+	char form[8192];
-+
-+	char *p = form;
-+	p = urlencode(p, "username");
-+	*p++ = '=';
-+	p = urlencode(p, username);
-+
-+	*p++ = '&';
-+	p = urlencode(p, "password");
-+	*p++ = '=';
-+	p = urlencode(p, passwd);
-+
-+ 	*p++ = '&';
-+	p = urlencode(p, "path");
-+	*p++ = '=';
-+	char authpath[256];
-+	sprintf(authpath, "/vms/%d", pve_vmid);
-+	p = urlencode(p, authpath);
-+
-+ 	*p++ = '&';
-+ 	p = urlencode(p, "privs");
-+	*p++ = '=';
-+ 	p = urlencode(p, "VM.Console");
-+
-+	sprintf(buf, "POST /api2/json/access/ticket HTTP/1.1\n"
-+		"Host: localhost:85\n"
-+		"Connection: close\n"
-+		"PVEClientIP: %s\n"
-+		"Content-Type: application/x-www-form-urlencoded\n"
-+		"Content-Length: %zd\n\n%s\n", clientip, strlen(form), form);
-+	ssize_t len = strlen(buf);
-+	ssize_t sb = send(sfd, buf, len, 0);
-+	if (sb < 0) {
-+		perror("pve_auth_verify: send failed");
-+		goto err;
-+	}
-+	if (sb != len) {
-+		fprintf(stderr, "pve_auth_verify: partial send error\n");
-+		goto err;
-+	}
-+
-+	len = recv(sfd, buf, sizeof(buf) - 1, 0);
-+	if (len < 0) {
-+		perror("pve_auth_verify: recv failed");
-+		goto err;
-+	}
-+
-+	buf[len] = 0;
-+
-+	//printf("DATA:%s\n", buf);
-+
-+	shutdown(sfd, SHUT_RDWR);
-+
-+	return strncmp(buf, "HTTP/1.1 200 OK", 15);
-+
-+err:
-+	shutdown(sfd, SHUT_RDWR);
-+	return -1;
-+}
-+
- static VncDisplay *vnc_display; /* needed for info vnc */
+commit 2fe327eac9189292436d1bcc27cf2d3a064da095
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    pve-auth.patch
+
+diff --git a/include/ui/console.h b/include/ui/console.h
+index 8a86617..bdbe378 100644
+--- a/include/ui/console.h
++++ b/include/ui/console.h
+@@ -319,6 +319,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
+ void cocoa_display_init(DisplayState *ds, int full_screen);
  
- static int vnc_cursor_define(VncState *vs);
-@@ -3155,6 +3274,7 @@
-             tls = 1; /* Require TLS */
-         } else if (strncmp(options, "x509", 4) == 0) {
-             char *start, *end;
-+            tls = 1; /* Require TLS */
-             x509 = 1; /* Require x509 certificates */
-             if (strncmp(options, "x509verify", 10) == 0)
-                 vs->tls.x509verify = 1; /* ...and verify client certs */
-@@ -3175,8 +3295,10 @@
-                 }
-                 g_free(path);
-             } else {
--                error_setg(errp, "No certificate path provided");
--                goto fail;
-+		if (pve_tls_set_x509_creds_dir(vs) < 0) {
-+                    error_setg(errp, "No certificate path provided");
-+                    goto fail;
-+		} 
-             }
- #endif
- #if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
-@@ -3240,10 +3362,10 @@
-             vs->auth = VNC_AUTH_VENCRYPT;
-             if (x509) {
-                 VNC_DEBUG("Initializing VNC server with x509 password auth\n");
--                vs->subauth = VNC_AUTH_VENCRYPT_X509VNC;
-+                vs->subauth = VNC_AUTH_VENCRYPT_X509PLAIN;
-             } else {
-                 VNC_DEBUG("Initializing VNC server with TLS password auth\n");
--                vs->subauth = VNC_AUTH_VENCRYPT_TLSVNC;
-+                vs->subauth = VNC_AUTH_VENCRYPT_TLSPLAIN;
-             }
-         } else {
- #endif /* CONFIG_VNC_TLS */
-Index: new/ui/vnc-auth-vencrypt.c
-===================================================================
---- new.orig/ui/vnc-auth-vencrypt.c	2013-11-26 10:50:23.000000000 +0100
-+++ new/ui/vnc-auth-vencrypt.c	2013-11-26 11:47:41.000000000 +0100
+ /* vnc.c */
++void pve_auth_setup(int vmid);
+ void vnc_display_init(DisplayState *ds);
+ void vnc_display_open(DisplayState *ds, const char *display, Error **errp);
+ void vnc_display_add_client(DisplayState *ds, int csock, bool skipauth);
+diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
+index bc7032e..2ecf624 100644
+--- a/ui/vnc-auth-vencrypt.c
++++ b/ui/vnc-auth-vencrypt.c
 @@ -26,6 +26,107 @@
  
  #include "vnc.h"
@@ -274,7 +128,7 @@ Index: new/ui/vnc-auth-vencrypt.c
  
  static void start_auth_vencrypt_subauth(VncState *vs)
  {
-@@ -37,6 +138,12 @@
+@@ -37,6 +138,12 @@ static void start_auth_vencrypt_subauth(VncState *vs)
         start_client_init(vs);
         break;
  
@@ -287,31 +141,11 @@ Index: new/ui/vnc-auth-vencrypt.c
      case VNC_AUTH_VENCRYPT_TLSVNC:
      case VNC_AUTH_VENCRYPT_X509VNC:
         VNC_DEBUG("Start TLS auth VNC\n");
-Index: new/ui/vnc.h
-===================================================================
---- new.orig/ui/vnc.h	2013-11-26 10:50:23.000000000 +0100
-+++ new/ui/vnc.h	2013-11-26 11:44:30.000000000 +0100
-@@ -270,6 +270,8 @@
-     char challenge[VNC_AUTH_CHALLENGE_SIZE];
- #ifdef CONFIG_VNC_TLS
-     int subauth; /* Used by VeNCrypt */
-+    int username_len;
-+    int password_len;
-     VncStateTLS tls;
- #endif
- #ifdef CONFIG_VNC_SASL
-@@ -585,4 +587,6 @@
- int vnc_zywrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
- void vnc_zrle_clear(VncState *vs);
- 
-+int pve_auth_verify(const char *clientip, const char *username, const char *passwd);
-+
- #endif /* __QEMU_VNC_H */
-Index: new/ui/vnc-tls.c
-===================================================================
---- new.orig/ui/vnc-tls.c	2013-11-26 10:50:23.000000000 +0100
-+++ new/ui/vnc-tls.c	2013-11-26 11:44:30.000000000 +0100
-@@ -302,6 +302,14 @@
+diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c
+index 50275de..0c61204 100644
+--- a/ui/vnc-tls.c
++++ b/ui/vnc-tls.c
+@@ -302,6 +302,14 @@ static int vnc_set_gnutls_priority(gnutls_session_t s, int x509)
  
  static int vnc_set_gnutls_priority(gnutls_session_t s, int x509)
  {
@@ -326,7 +160,7 @@ Index: new/ui/vnc-tls.c
      static const int cert_types[] = { GNUTLS_CRT_X509, 0 };
      static const int protocols[] = {
          GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0
-@@ -313,6 +321,11 @@
+@@ -313,6 +321,11 @@ static int vnc_set_gnutls_priority(gnutls_session_t s, int x509)
      };
      int rc;
  
@@ -338,7 +172,7 @@ Index: new/ui/vnc-tls.c
      rc = gnutls_kx_set_priority(s, x509 ? kx_x509 : kx_anon);
      if (rc != GNUTLS_E_SUCCESS) {
          return -1;
-@@ -466,6 +479,24 @@
+@@ -466,6 +479,24 @@ static int vnc_set_x509_credential(VncDisplay *vd,
      return 0;
  }
  
@@ -363,11 +197,11 @@ Index: new/ui/vnc-tls.c
  
  int vnc_tls_set_x509_creds_dir(VncDisplay *vd,
                                 const char *certdir)
-Index: new/ui/vnc-tls.h
-===================================================================
---- new.orig/ui/vnc-tls.h	2013-11-26 10:50:23.000000000 +0100
-+++ new/ui/vnc-tls.h	2013-11-26 11:44:30.000000000 +0100
-@@ -68,6 +68,8 @@
+diff --git a/ui/vnc-tls.h b/ui/vnc-tls.h
+index 36a2227..0010ecf 100644
+--- a/ui/vnc-tls.h
++++ b/ui/vnc-tls.h
+@@ -68,6 +68,8 @@ void vnc_tls_client_cleanup(VncState *vs);
  
  int vnc_tls_validate_certificate(VncState *vs);
  
@@ -376,11 +210,195 @@ Index: new/ui/vnc-tls.h
  int vnc_tls_set_x509_creds_dir(VncDisplay *vd,
  			       const char *path);
  
-Index: new/vl.c
-===================================================================
---- new.orig/vl.c	2013-11-26 11:44:20.000000000 +0100
-+++ new/vl.c	2013-11-26 11:44:30.000000000 +0100
-@@ -3566,6 +3566,7 @@
+diff --git a/ui/vnc.c b/ui/vnc.c
+index 5925774..76c80ad 100644
+--- a/ui/vnc.c
++++ b/ui/vnc.c
+@@ -44,6 +44,125 @@ static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 };
+ #include "vnc_keysym.h"
+ #include "d3des.h"
+ 
++static int pve_vmid = 0;
++
++void pve_auth_setup(int vmid) {
++	pve_vmid = vmid;
++}
++
++static char *
++urlencode(char *buf, const char *value)
++{
++	static const char *hexchar = "0123456789abcdef";
++	char *p = buf;
++	int i;
++	int l = strlen(value);
++	for (i = 0; i < l; i++) {
++		char c = value[i];
++		if (('a' <= c && c <= 'z') ||
++		    ('A' <= c && c <= 'Z') ||
++		    ('0' <= c && c <= '9')) {
++			*p++ = c;
++		} else if (c == 32) {
++			*p++ = '+';
++		} else {
++			*p++ = '%';
++			*p++ = hexchar[c >> 4];
++			*p++ = hexchar[c & 15];
++		}
++	}
++	*p = 0;
++
++	return p;
++}
++
++int
++pve_auth_verify(const char *clientip, const char *username, const char *passwd)
++{
++	struct sockaddr_in server;
++
++	int sfd = socket(AF_INET, SOCK_STREAM, 0);
++	if (sfd == -1) {
++		perror("pve_auth_verify: socket failed");
++		return -1;
++	}
++
++	struct hostent *he;
++	if ((he = gethostbyname("localhost")) == NULL) {
++		fprintf(stderr, "pve_auth_verify: error resolving hostname\n");
++		goto err;
++	}
++
++	memcpy(&server.sin_addr, he->h_addr_list[0], he->h_length);
++	server.sin_family = AF_INET;
++	server.sin_port = htons(85);
++
++	if (connect(sfd, (struct sockaddr *)&server, sizeof(server))) {
++		perror("pve_auth_verify: error connecting to server");
++		goto err;
++	}
++
++	char buf[8192];
++	char form[8192];
++
++	char *p = form;
++	p = urlencode(p, "username");
++	*p++ = '=';
++	p = urlencode(p, username);
++
++	*p++ = '&';
++	p = urlencode(p, "password");
++	*p++ = '=';
++	p = urlencode(p, passwd);
++
++ 	*p++ = '&';
++	p = urlencode(p, "path");
++	*p++ = '=';
++	char authpath[256];
++	sprintf(authpath, "/vms/%d", pve_vmid);
++	p = urlencode(p, authpath);
++
++ 	*p++ = '&';
++ 	p = urlencode(p, "privs");
++	*p++ = '=';
++ 	p = urlencode(p, "VM.Console");
++
++	sprintf(buf, "POST /api2/json/access/ticket HTTP/1.1\n"
++		"Host: localhost:85\n"
++		"Connection: close\n"
++		"PVEClientIP: %s\n"
++		"Content-Type: application/x-www-form-urlencoded\n"
++		"Content-Length: %zd\n\n%s\n", clientip, strlen(form), form);
++	ssize_t len = strlen(buf);
++	ssize_t sb = send(sfd, buf, len, 0);
++	if (sb < 0) {
++		perror("pve_auth_verify: send failed");
++		goto err;
++	}
++	if (sb != len) {
++		fprintf(stderr, "pve_auth_verify: partial send error\n");
++		goto err;
++	}
++
++	len = recv(sfd, buf, sizeof(buf) - 1, 0);
++	if (len < 0) {
++		perror("pve_auth_verify: recv failed");
++		goto err;
++	}
++
++	buf[len] = 0;
++
++	//printf("DATA:%s\n", buf);
++
++	shutdown(sfd, SHUT_RDWR);
++
++	return strncmp(buf, "HTTP/1.1 200 OK", 15);
++
++err:
++	shutdown(sfd, SHUT_RDWR);
++	return -1;
++}
++
+ static VncDisplay *vnc_display; /* needed for info vnc */
+ 
+ static int vnc_cursor_define(VncState *vs);
+@@ -3125,6 +3244,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
+             tls = 1; /* Require TLS */
+         } else if (strncmp(options, "x509", 4) == 0) {
+             char *start, *end;
++            tls = 1; /* Require TLS */
+             x509 = 1; /* Require x509 certificates */
+             if (strncmp(options, "x509verify", 10) == 0)
+                 vs->tls.x509verify = 1; /* ...and verify client certs */
+@@ -3145,8 +3265,10 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
+                 }
+                 g_free(path);
+             } else {
+-                error_setg(errp, "No certificate path provided");
+-                goto fail;
++		if (pve_tls_set_x509_creds_dir(vs) < 0) {
++                    error_setg(errp, "No certificate path provided");
++                    goto fail;
++		} 
+             }
+ #endif
+ #if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
+@@ -3219,10 +3341,10 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
+             vs->auth = VNC_AUTH_VENCRYPT;
+             if (x509) {
+                 VNC_DEBUG("Initializing VNC server with x509 password auth\n");
+-                vs->subauth = VNC_AUTH_VENCRYPT_X509VNC;
++                vs->subauth = VNC_AUTH_VENCRYPT_X509PLAIN;
+             } else {
+                 VNC_DEBUG("Initializing VNC server with TLS password auth\n");
+-                vs->subauth = VNC_AUTH_VENCRYPT_TLSVNC;
++                vs->subauth = VNC_AUTH_VENCRYPT_TLSPLAIN;
+             }
+         } else {
+ #endif /* CONFIG_VNC_TLS */
+diff --git a/ui/vnc.h b/ui/vnc.h
+index 8da81b8..ed1eaf4 100644
+--- a/ui/vnc.h
++++ b/ui/vnc.h
+@@ -279,6 +279,8 @@ struct VncState
+     char challenge[VNC_AUTH_CHALLENGE_SIZE];
+ #ifdef CONFIG_VNC_TLS
+     int subauth; /* Used by VeNCrypt */
++    int username_len;
++    int password_len;
+     VncStateTLS tls;
+ #endif
+ #ifdef CONFIG_VNC_SASL
+@@ -594,4 +596,6 @@ int vnc_zrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
+ int vnc_zywrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
+ void vnc_zrle_clear(VncState *vs);
+ 
++int pve_auth_verify(const char *clientip, const char *username, const char *passwd);
++
+ #endif /* __QEMU_VNC_H */
+diff --git a/vl.c b/vl.c
+index cf7f505..5ef8a79 100644
+--- a/vl.c
++++ b/vl.c
+@@ -3690,6 +3690,7 @@ int main(int argc, char **argv, char **envp)
  		    fprintf(stderr, "Invalid ID\n");
  		    exit(1);
  		}
@@ -388,15 +406,3 @@ Index: new/vl.c
                  break;
              case QEMU_OPTION_cpuunits:
                  cpuunits = atoi(optarg);
-Index: new/include/ui/console.h
-===================================================================
---- new.orig/include/ui/console.h	2013-11-26 10:50:22.000000000 +0100
-+++ new/include/ui/console.h	2013-11-26 11:44:30.000000000 +0100
-@@ -312,6 +312,7 @@
- void cocoa_display_init(DisplayState *ds, int full_screen);
- 
- /* vnc.c */
-+void pve_auth_setup(int vmid);
- void vnc_display_init(DisplayState *ds);
- void vnc_display_open(DisplayState *ds, const char *display, Error **errp);
- void vnc_display_add_client(DisplayState *ds, int csock, bool skipauth);
diff --git a/debian/patches/qemu_do_exit_on_failed_load_vmstate.patch b/debian/patches/qemu_do_exit_on_failed_load_vmstate.patch
index 6e790e7..9c6127e 100644
--- a/debian/patches/qemu_do_exit_on_failed_load_vmstate.patch
+++ b/debian/patches/qemu_do_exit_on_failed_load_vmstate.patch
@@ -1,8 +1,14 @@
+commit f9306ed51375d47448f4aa240e3441cad723eb13
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:59:54 2014 +0200
+
+    qemu_do_exit_on_failed_load_vmstate.patch
+
 diff --git a/vl.c b/vl.c
-index 6a062dd..1e12859 100644
+index 6661883..d3d71de 100644
 --- a/vl.c
 +++ b/vl.c
-@@ -4458,10 +4458,14 @@ int main(int argc, char **argv, char **envp)
+@@ -4544,10 +4544,14 @@ int main(int argc, char **argv, char **envp)
      if (loadvm) {
          if (load_vmstate(loadvm) < 0) {
              autostart = 0;
diff --git a/debian/patches/set-cpu-model-to-kvm64.patch b/debian/patches/set-cpu-model-to-kvm64.patch
index d954233..1ec2c5b 100644
--- a/debian/patches/set-cpu-model-to-kvm64.patch
+++ b/debian/patches/set-cpu-model-to-kvm64.patch
@@ -1,8 +1,14 @@
-Index: new/hw/i386/pc.c
-===================================================================
---- new.orig/hw/i386/pc.c	2013-11-27 10:51:33.000000000 +0100
-+++ new/hw/i386/pc.c	2013-11-27 11:37:06.000000000 +0100
-@@ -984,9 +984,9 @@
+commit a9c32bd96ab48f001634648b9f6dd9af7f47cc5e
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    set-cpu-model-to-kvm64.patch
+
+diff --git a/hw/i386/pc.c b/hw/i386/pc.c
+index 14f0d91..93af06c 100644
+--- a/hw/i386/pc.c
++++ b/hw/i386/pc.c
+@@ -997,9 +997,9 @@ void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge)
      /* init CPUs */
      if (cpu_model == NULL) {
  #ifdef TARGET_X86_64
diff --git a/debian/patches/spice-use-pve-certs.patch b/debian/patches/spice-use-pve-certs.patch
index 7a2bc1b..39a1f57 100644
--- a/debian/patches/spice-use-pve-certs.patch
+++ b/debian/patches/spice-use-pve-certs.patch
@@ -1,8 +1,14 @@
-Index: new/ui/spice-core.c
-===================================================================
---- new.orig/ui/spice-core.c	2013-11-27 11:43:08.000000000 +0100
-+++ new/ui/spice-core.c	2013-11-27 11:46:26.000000000 +0100
-@@ -672,32 +672,35 @@
+commit 1c95536a0d1bc1b4fc911481d6d631dddfba0667
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:32 2014 +0200
+
+    spice-use-pve-certs.patch
+
+diff --git a/ui/spice-core.c b/ui/spice-core.c
+index 627ed54..b8b8333 100644
+--- a/ui/spice-core.c
++++ b/ui/spice-core.c
+@@ -671,32 +671,35 @@ void qemu_spice_init(void)
  
      if (tls_port) {
          x509_dir = qemu_opt_get(opts, "x509-dir");
diff --git a/debian/patches/vencrypt-auth-plain.patch b/debian/patches/vencrypt-auth-plain.patch
index 143123d..6d8048c 100644
--- a/debian/patches/vencrypt-auth-plain.patch
+++ b/debian/patches/vencrypt-auth-plain.patch
@@ -1,8 +1,14 @@
-Index: new/ui/vnc-auth-vencrypt.c
-===================================================================
---- new.orig/ui/vnc-auth-vencrypt.c	2013-11-26 11:47:41.000000000 +0100
-+++ new/ui/vnc-auth-vencrypt.c	2013-11-26 11:48:13.000000000 +0100
-@@ -144,6 +144,11 @@
+commit e31664bd11efa0a3b7a879040c6e326a1f13ca23
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    vencrypt-auth-plain.patch
+
+diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
+index 2ecf624..880fec7 100644
+--- a/ui/vnc-auth-vencrypt.c
++++ b/ui/vnc-auth-vencrypt.c
+@@ -144,6 +144,11 @@ static void start_auth_vencrypt_subauth(VncState *vs)
         vnc_read_when(vs, protocol_client_auth_plain_start, 8);
         break;
  
@@ -14,7 +20,7 @@ Index: new/ui/vnc-auth-vencrypt.c
      case VNC_AUTH_VENCRYPT_TLSVNC:
      case VNC_AUTH_VENCRYPT_X509VNC:
         VNC_DEBUG("Start TLS auth VNC\n");
-@@ -228,25 +233,32 @@
+@@ -228,25 +233,32 @@ static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len
  {
      int auth = read_u32(data, 0);
  
@@ -60,7 +66,7 @@ Index: new/ui/vnc-auth-vencrypt.c
          }
      }
      return 0;
-@@ -261,10 +273,11 @@
+@@ -261,10 +273,11 @@ static int protocol_client_vencrypt_init(VncState *vs, uint8_t *data, size_t len
          vnc_flush(vs);
          vnc_client_error(vs);
      } else {
diff --git a/debian/patches/virtio-balloon-fix-query.patch b/debian/patches/virtio-balloon-fix-query.patch
index 6a30b83..e816414 100644
--- a/debian/patches/virtio-balloon-fix-query.patch
+++ b/debian/patches/virtio-balloon-fix-query.patch
@@ -1,8 +1,14 @@
-Index: new/hmp.c
-===================================================================
---- new.orig/hmp.c	2013-11-27 10:51:33.000000000 +0100
-+++ new/hmp.c	2013-11-27 11:35:03.000000000 +0100
-@@ -525,7 +525,35 @@
+commit 3e7be049c652f5c2c32e8840b44b1be7372c3c1d
+Author: Stefan Priebe <s.priebe at profihost.ag>
+Date:   Thu May 1 21:54:31 2014 +0200
+
+    virtio-balloon-fix-query.patch
+
+diff --git a/hmp.c b/hmp.c
+index 2f279c4..4fe5cf7 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -526,7 +526,35 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
          return;
      }
  
@@ -39,11 +45,11 @@ Index: new/hmp.c
  
      qapi_free_BalloonInfo(info);
  }
-Index: new/hw/virtio/virtio-balloon.c
-===================================================================
---- new.orig/hw/virtio/virtio-balloon.c	2013-11-27 10:51:33.000000000 +0100
-+++ new/hw/virtio/virtio-balloon.c	2013-11-27 11:35:03.000000000 +0100
-@@ -291,6 +291,35 @@
+diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
+index a470a0b..96d6519 100644
+--- a/hw/virtio/virtio-balloon.c
++++ b/hw/virtio/virtio-balloon.c
+@@ -291,6 +291,35 @@ static void virtio_balloon_stat(void *opaque, BalloonInfo *info)
      VirtIOBalloon *dev = opaque;
      info->actual = ram_size - ((uint64_t) dev->actual <<
                                 VIRTIO_BALLOON_PFN_SHIFT);
@@ -79,11 +85,11 @@ Index: new/hw/virtio/virtio-balloon.c
  }
  
  static void virtio_balloon_to_target(void *opaque, ram_addr_t target)
-Index: new/qapi-schema.json
-===================================================================
---- new.orig/qapi-schema.json	2013-11-27 10:51:33.000000000 +0100
-+++ new/qapi-schema.json	2013-11-27 11:35:03.000000000 +0100
-@@ -1229,15 +1229,34 @@
+diff --git a/qapi-schema.json b/qapi-schema.json
+index 391356f..70bafb0 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -1340,15 +1340,34 @@
  
  ##
  # @BalloonInfo:
@@ -121,11 +127,11 @@ Index: new/qapi-schema.json
  
  ##
  # @query-balloon:
-Index: new/qmp-commands.hx
-===================================================================
---- new.orig/qmp-commands.hx	2013-11-27 10:51:33.000000000 +0100
-+++ new/qmp-commands.hx	2013-11-27 11:35:03.000000000 +0100
-@@ -2948,6 +2948,13 @@
+diff --git a/qmp-commands.hx b/qmp-commands.hx
+index ed3ab92..df87119 100644
+--- a/qmp-commands.hx
++++ b/qmp-commands.hx
+@@ -3152,6 +3152,13 @@ Make an asynchronous request for balloon info. When the request completes a
  json-object will be returned containing the following data:
  
  - "actual": current balloon value in bytes (json-int)
@@ -139,7 +145,7 @@ Index: new/qmp-commands.hx
  
  Example:
  
-@@ -2955,6 +2962,12 @@
+@@ -3159,6 +3166,12 @@ Example:
  <- {
        "return":{
           "actual":1073741824,
-- 
1.7.10.4




More information about the pve-devel mailing list