Skip to contentSkip to conversation

Migration pull request

GIT PULL Applied Juan Quintela 3 participants 10 messages May 12, 2017 – May 16, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

Hi

This pull contains:
- Fix regression with compression threads (mea culpa)
- start of includes migration (creating of blocker.h header)
- Use Error** correctly after several iterations
- Rename of RAM_SAVE_FLAG_COMPRESS
- Create block capabilities for shared and enable

Please, apply.

The following changes since commit ecc1f5adeec4e3324d1b695a7c54e3967c526949:

maintainers: Add myself as linux-user reviewer (2017-05-11 13:31:11 -0400)

are available in the git repository at:

git://github.com/juanquintela/qemu.git tags/migration/20170512

for you to fetch changes up to f15e5850905dea6a09e29ef14df508ec236321d9:

migration: Create migration/blocker.h (2017-05-12 17:10:57 +0200)

----------------------------------------------------------------
migration/next for 20170512

----------------------------------------------------------------
Juan Quintela (5):
migration: Fix regression with compression threads
migration: Pass Error ** argument to {save,load}_vmstate
ram: Rename RAM_SAVE_FLAG_COMPRESS to RAM_SAVE_FLAG_ZERO
migration: Create block capabilities for shared and enable
migration: Create migration/blocker.h

 block/qcow.c                  |  2 +-
 block/vdi.c                   |  2 +-
 block/vhdx.c                  |  2 +-
 block/vmdk.c                  |  2 +-
 block/vpc.c                   |  2 +-
 block/vvfat.c                 |  2 +-
 hmp.c                         |  9 ++++++--
 hw/9pfs/9p.c                  |  2 +-
 hw/display/qxl.c              |  2 +-
 hw/display/virtio-gpu.c       |  2 +-
 hw/intc/arm_gic_kvm.c         |  2 +-
 hw/intc/arm_gicv3_its_kvm.c   |  2 +-
 hw/intc/arm_gicv3_kvm.c       |  2 +-
 hw/misc/ivshmem.c             |  2 +-
 hw/scsi/vhost-scsi.c          |  2 +-
 hw/virtio/vhost.c             |  2 +-
 include/migration/block.h     |  3 +++
 include/migration/blocker.h   | 35 +++++++++++++++++++++++++++++
 include/migration/migration.h | 21 +++---------------
 include/sysemu/sysemu.h       |  4 ++--
 migration/migration.c         | 37 +++++++++++++++++++++++++++++++
 migration/ram.c               | 35 +++++++++++++++++------------
 migration/savevm.c            | 51 +++++++++++++++++++++----------------------
 qapi-schema.json              |  7 +++++-
 replay/replay-snapshot.c      |  8 +++++--
 stubs/migr-blocker.c          |  2 +-
 target/i386/kvm.c             |  2 +-
 vl.c                          |  4 +++-
 28 files changed, 165 insertions(+), 83 deletions(-)
 create mode 100644 include/migration/blocker.h
#1 lore raw

[Qemu-devel] [PULL 1/5] migration: Fix regression with compression threads

Compression threads got broken on commit

commit 247956946651ae0280f7b1ea88bb6237dd01c231
Author: Juan Quintela <[email protected]>
Date: Tue Mar 21 11:45:01 2017 +0100

ram: reorganize last_sent_block

On do_compress_ram_page() we use a different QEMUFile than the migration one. We need to pass it there. The failure can be seen as:

(qemu) qemu-system-x86_64: Unknown combination of migration flags: 0
qemu-system-x86_64: error while loading state section id 3(ram)
qemu-system-x86_64: load of migration failed: Invalid argument

---
 migration/ram.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
migration/ram.c +10 -9
index 293d27c..995d1fc 100644
@@ -436,20 +436,21 @@ void migrate_compress_threads_create(void)
  * @offset: offset inside the block for the page
  *          in the lower bits, it contains flags
  */
-static size_t save_page_header(RAMState *rs, RAMBlock *block, ram_addr_t offset)
+static size_t save_page_header(RAMState *rs, QEMUFile *f,  RAMBlock *block,
+                               ram_addr_t offset)
 {
     size_t size, len;
 
     if (block == rs->last_sent_block) {
         offset |= RAM_SAVE_FLAG_CONTINUE;
     }
-    qemu_put_be64(rs->f, offset);
+    qemu_put_be64(f, offset);
     size = 8;
 
     if (!(offset & RAM_SAVE_FLAG_CONTINUE)) {
         len = strlen(block->idstr);
-        qemu_put_byte(rs->f, len);
-        qemu_put_buffer(rs->f, (uint8_t *)block->idstr, len);
+        qemu_put_byte(f, len);
+        qemu_put_buffer(f, (uint8_t *)block->idstr, len);
         size += 1 + len;
         rs->last_sent_block = block;
     }
@@ -571,7 +572,7 @@ static int save_xbzrle_page(RAMState *rs, uint8_t **current_data,
     }
 
     /* Send XBZRLE based compressed page */
-    bytes_xbzrle = save_page_header(rs, block,
+    bytes_xbzrle = save_page_header(rs, rs->f, block,
                                     offset | RAM_SAVE_FLAG_XBZRLE);
     qemu_put_byte(rs->f, ENCODING_FLAG_XBZRLE);
     qemu_put_be16(rs->f, encoded_len);
@@ -745,7 +746,7 @@ static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
     if (is_zero_range(p, TARGET_PAGE_SIZE)) {
         rs->zero_pages++;
         rs->bytes_transferred +=
-            save_page_header(rs, block, offset | RAM_SAVE_FLAG_COMPRESS);
+            save_page_header(rs, rs->f, block, offset | RAM_SAVE_FLAG_COMPRESS);
         qemu_put_byte(rs->f, 0);
         rs->bytes_transferred += 1;
         pages = 1;
@@ -834,7 +835,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
 
     /* XBZRLE overflow or normal page */
     if (pages == -1) {
-        rs->bytes_transferred += save_page_header(rs, block,
+        rs->bytes_transferred += save_page_header(rs, rs->f, block,
                                                   offset | RAM_SAVE_FLAG_PAGE);
         if (send_async) {
             qemu_put_buffer_async(rs->f, p, TARGET_PAGE_SIZE,
@@ -860,7 +861,7 @@ static int do_compress_ram_page(QEMUFile *f, RAMBlock *block,
     int bytes_sent, blen;
     uint8_t *p = block->host + (offset & TARGET_PAGE_MASK);
 
-    bytes_sent = save_page_header(rs, block, offset |
+    bytes_sent = save_page_header(rs, f, block, offset |
                                   RAM_SAVE_FLAG_COMPRESS_PAGE);
     blen = qemu_put_compression_data(f, p, TARGET_PAGE_SIZE,
                                      migrate_compress_level());
@@ -991,7 +992,7 @@ static int ram_save_compressed_page(RAMState *rs, PageSearchStatus *pss,
             pages = save_zero_page(rs, block, offset, p);
             if (pages == -1) {
                 /* Make sure the first page is sent out before other pages */
-                bytes_xmit = save_page_header(rs, block, offset |
+                bytes_xmit = save_page_header(rs, rs->f, block, offset |
                                               RAM_SAVE_FLAG_COMPRESS_PAGE);
                 blen = qemu_put_compression_data(rs->f, p, TARGET_PAGE_SIZE,
                                                  migrate_compress_level());
Signature · 1 line
2.9.3
#2 lore raw

[Qemu-devel] [PULL 3/5] ram: Rename RAM_SAVE_FLAG_COMPRESS to RAM_SAVE_FLAG_ZERO

In reply to Juan Quintela

Reflects better what it does now, and avoid confussions with RAM_SAVE_FLAG_COMPRESS_PAGE.

---
 migration/ram.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
migration/ram.c +12 -6
index 995d1fc..76c118c 100644
@@ -48,8 +48,14 @@
 /***********************************************************/
 /* ram save/restore */
 
+/* RAM_SAVE_FLAG_ZERO used to be named RAM_SAVE_FLAG_COMPRESS, it
+ * worked for pages that where filled with the same char.  We switched
+ * it to only search for the zero value.  And to avoid confusion with
+ * RAM_SSAVE_FLAG_COMPRESS_PAGE just rename it.
+ */
+
 #define RAM_SAVE_FLAG_FULL     0x01 /* Obsolete, not used anymore */
-#define RAM_SAVE_FLAG_COMPRESS 0x02
+#define RAM_SAVE_FLAG_ZERO     0x02
 #define RAM_SAVE_FLAG_MEM_SIZE 0x04
 #define RAM_SAVE_FLAG_PAGE     0x08
 #define RAM_SAVE_FLAG_EOS      0x10
@@ -746,7 +752,7 @@ static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
     if (is_zero_range(p, TARGET_PAGE_SIZE)) {
         rs->zero_pages++;
         rs->bytes_transferred +=
-            save_page_header(rs, rs->f, block, offset | RAM_SAVE_FLAG_COMPRESS);
+            save_page_header(rs, rs->f, block, offset | RAM_SAVE_FLAG_ZERO);
         qemu_put_byte(rs->f, 0);
         rs->bytes_transferred += 1;
         pages = 1;
@@ -2406,7 +2412,7 @@ static int ram_load_postcopy(QEMUFile *f)
 
         trace_ram_load_postcopy_loop((uint64_t)addr, flags);
         place_needed = false;
-        if (flags & (RAM_SAVE_FLAG_COMPRESS | RAM_SAVE_FLAG_PAGE)) {
+        if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE)) {
             block = ram_block_from_stream(f, flags);
 
             host = host_from_ram_block_offset(block, addr);
@@ -2453,7 +2459,7 @@ static int ram_load_postcopy(QEMUFile *f)
         last_host = host;
 
         switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
-        case RAM_SAVE_FLAG_COMPRESS:
+        case RAM_SAVE_FLAG_ZERO:
             ch = qemu_get_byte(f);
             memset(page_buffer, ch, TARGET_PAGE_SIZE);
             if (ch) {
@@ -2542,7 +2548,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
         flags = addr & ~TARGET_PAGE_MASK;
         addr &= TARGET_PAGE_MASK;
 
-        if (flags & (RAM_SAVE_FLAG_COMPRESS | RAM_SAVE_FLAG_PAGE |
+        if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE |
                      RAM_SAVE_FLAG_COMPRESS_PAGE | RAM_SAVE_FLAG_XBZRLE)) {
             RAMBlock *block = ram_block_from_stream(f, flags);
 
@@ -2604,7 +2610,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
             }
             break;
 
-        case RAM_SAVE_FLAG_COMPRESS:
+        case RAM_SAVE_FLAG_ZERO:
             ch = qemu_get_byte(f);
             ram_handle_compressed(host, ch, TARGET_PAGE_SIZE);
             break;
Signature · 1 line
2.9.3
#3 lore raw

[Qemu-devel] [PULL 4/5] migration: Create block capabilities for shared and enable

In reply to Juan Quintela

Those two capabilities were added through the command line. Notice that we just created them. This is just the boilerplate.

---
 include/migration/block.h     |  3 +++
 include/migration/migration.h |  3 +++
 migration/migration.c         | 36 ++++++++++++++++++++++++++++++++++++
 qapi-schema.json              |  7 ++++++-
 4 files changed, 48 insertions(+), 1 deletion(-)
include/migration/block.h +3 -0
index 41a1ac8..5b3f1a5 100644
@@ -20,4 +20,7 @@ uint64_t blk_mig_bytes_transferred(void);
 uint64_t blk_mig_bytes_remaining(void);
 uint64_t blk_mig_bytes_total(void);
 
+void migrate_set_block_shared(MigrationState *s, bool value);
+void migrate_set_block_enabled(MigrationState *s, bool value);
+
 #endif /* MIGRATION_BLOCK_H */
include/migration/migration.h +3 -0
index e29cb01..465d8ce 100644
@@ -311,6 +311,9 @@ bool migrate_colo_enabled(void);
 
 int64_t xbzrle_cache_resize(int64_t new_size);
 
+bool migrate_use_block_enabled(void);
+bool migrate_use_block_shared(void);
+
 bool migrate_use_compression(void);
 int migrate_compress_level(void);
 int migrate_compress_threads(void);
migration/migration.c +36 -0
index 799952c..250e3e3 100644
@@ -1210,6 +1210,16 @@ bool migration_is_blocked(Error **errp)
     return false;
 }
 
+void migrate_set_block_shared(MigrationState *s, bool value)
+{
+    s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED] = value;
+}
+
+void migrate_set_block_enabled(MigrationState *s, bool value)
+{
+    s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] = value;
+}
+
 void qmp_migrate(const char *uri, bool has_blk, bool blk,
                  bool has_inc, bool inc, bool has_detach, bool detach,
                  Error **errp)
@@ -1239,6 +1249,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
 
     s = migrate_init(&params);
 
+    if (has_blk && blk) {
+        migrate_set_block_enabled(s, true);
+    }
+
+    if (has_inc && inc) {
+        migrate_set_block_shared(s, true);
+    }
+
     if (strstart(uri, "tcp:", &p)) {
         tcp_start_outgoing_migration(s, p, &local_err);
 #ifdef CONFIG_RDMA
@@ -1434,6 +1452,24 @@ int64_t migrate_xbzrle_cache_size(void)
     return s->xbzrle_cache_size;
 }
 
+bool migrate_use_block_enabled(void)
+{
+    MigrationState *s;
+
+    s = migrate_get_current();
+
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED];
+}
+
+bool migrate_use_block_shared(void)
+{
+    MigrationState *s;
+
+    s = migrate_get_current();
+
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED];
+}
+
 /* migration thread support */
 /*
  * Something bad happened to the RP stream, mark an error
qapi-schema.json +6 -1
index 5728b7f..109852e 100644
@@ -894,11 +894,16 @@
 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
 #        during postcopy-ram migration. (since 2.9)
 #
+# @block-enabled: enable block migration (Since 2.10)
+#
+# @block-shared: enable block shared migration (Since 2.10)
+#
 # Since: 1.2
 ##
 { 'enum': 'MigrationCapability',
   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
-           'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] }
+           'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
+           'block-enabled', 'block-shared' ] }
 
 ##
 # @MigrationCapabilityStatus:
Signature · 1 line
2.9.3
#4 lore raw

[Qemu-devel] [PULL 2/5] migration: Pass Error ** argument to {save, load}_vmstate

In reply to Juan Quintela

This way we use the "normal" way of printing errors for hmp commands.

---
 hmp.c                    |  9 +++++++--
 include/sysemu/sysemu.h  |  4 ++--
 migration/savevm.c       | 51 ++++++++++++++++++++++++------------------------
 replay/replay-snapshot.c |  8 ++++++--
 vl.c                     |  4 +++-
 5 files changed, 43 insertions(+), 33 deletions(-)
hmp.c +7 -2
index 524e589..b9dd933 100644
@@ -1274,17 +1274,22 @@ void hmp_loadvm(Monitor *mon, const QDict *qdict)
 {
     int saved_vm_running  = runstate_is_running();
     const char *name = qdict_get_str(qdict, "name");
+    Error *err = NULL;
 
     vm_stop(RUN_STATE_RESTORE_VM);
 
-    if (load_vmstate(name) == 0 && saved_vm_running) {
+    if (load_vmstate(name, &err) == 0 && saved_vm_running) {
         vm_start();
     }
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_savevm(Monitor *mon, const QDict *qdict)
 {
-    save_vmstate(qdict_get_try_str(qdict, "name"));
+    Error *err = NULL;
+
+    save_vmstate(qdict_get_try_str(qdict, "name"), &err);
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_delvm(Monitor *mon, const QDict *qdict)
include/sysemu/sysemu.h +2 -2
index 15656b7..058d5eb 100644
@@ -75,8 +75,8 @@ void qemu_remove_exit_notifier(Notifier *notify);
 void qemu_add_machine_init_done_notifier(Notifier *notify);
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
 
-int save_vmstate(const char *name);
-int load_vmstate(const char *name);
+int save_vmstate(const char *name, Error **errp);
+int load_vmstate(const char *name, Error **errp);
 
 void qemu_announce_self(void);
 
migration/savevm.c +25 -26

145 lines not on this page · raw message

replay/replay-snapshot.c +6 -2
index 8cced46..c75cd38 100644
@@ -62,14 +62,18 @@ void replay_vmstate_register(void)
 
 void replay_vmstate_init(void)
 {
+    Error *err = NULL;
+
     if (replay_snapshot) {
         if (replay_mode == REPLAY_MODE_RECORD) {
-            if (save_vmstate(replay_snapshot) != 0) {
+            if (save_vmstate(replay_snapshot, &err) != 0) {
+                error_report_err(err);
                 error_report("Could not create snapshot for icount record");
                 exit(1);
             }
         } else if (replay_mode == REPLAY_MODE_PLAY) {
-            if (load_vmstate(replay_snapshot) != 0) {
+            if (load_vmstate(replay_snapshot, &err) != 0) {
+                error_report_err(err);
                 error_report("Could not load snapshot for icount replay");
                 exit(1);
             }
vl.c +3 -1
index ce2b392..b48f308 100644
@@ -4687,7 +4687,9 @@ int main(int argc, char **argv, char **envp)
     if (replay_mode != REPLAY_MODE_NONE) {
         replay_vmstate_init();
     } else if (loadvm) {
-        if (load_vmstate(loadvm) < 0) {
+        Error *local_err = NULL;
+        if (load_vmstate(loadvm, &local_err) < 0) {
+            error_report_err(local_err);
             autostart = 0;
         }
     }
Signature · 1 line
2.9.3
#5 lore raw

[Qemu-devel] [PULL 5/5] migration: Create migration/blocker.h

In reply to Juan Quintela

This allows us to remove lots of includes of migration/migration.h

---
 block/qcow.c                  |  2 +-
 block/vdi.c                   |  2 +-
 block/vhdx.c                  |  2 +-
 block/vmdk.c                  |  2 +-
 block/vpc.c                   |  2 +-
 block/vvfat.c                 |  2 +-
 hw/9pfs/9p.c                  |  2 +-
 hw/display/qxl.c              |  2 +-
 hw/display/virtio-gpu.c       |  2 +-
 hw/intc/arm_gic_kvm.c         |  2 +-
 hw/intc/arm_gicv3_its_kvm.c   |  2 +-
 hw/intc/arm_gicv3_kvm.c       |  2 +-
 hw/misc/ivshmem.c             |  2 +-
 hw/scsi/vhost-scsi.c          |  2 +-
 hw/virtio/vhost.c             |  2 +-
 include/migration/blocker.h   | 35 +++++++++++++++++++++++++++++++++++
 include/migration/migration.h | 18 ------------------
 migration/migration.c         |  1 +
 stubs/migr-blocker.c          |  2 +-
 target/i386/kvm.c             |  2 +-
 20 files changed, 53 insertions(+), 35 deletions(-)
 create mode 100644 include/migration/blocker.h
block/qcow.c +1 -1
index 5d147b9..95ab123 100644
@@ -32,7 +32,7 @@
 #include <zlib.h>
 #include "qapi/qmp/qerror.h"
 #include "crypto/cipher.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 
 /**************************************************************/
 /* QEMU COW block driver with compression and encryption support */
block/vdi.c +1 -1
index d12d9cd..79af477 100644
@@ -55,7 +55,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/coroutine.h"
 #include "qemu/cutils.h"
 #include "qemu/uuid.h"
block/vhdx.c +1 -1
index e8fe3fb..8b270b5 100644
@@ -24,7 +24,7 @@
 #include "qemu/crc32c.h"
 #include "qemu/bswap.h"
 #include "block/vhdx.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/uuid.h"
 
 /* Options for VHDX creation */
block/vmdk.c +1 -1
index c61b9cc..55581b0 100644
@@ -31,7 +31,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/cutils.h"
 #include <zlib.h>
 
block/vpc.c +1 -1
index ecfee77..4240ba9 100644
@@ -28,7 +28,7 @@
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/bswap.h"
 #include "qemu/uuid.h"
 
block/vvfat.c +1 -1
index 9c82371..426ca70 100644
@@ -28,7 +28,7 @@
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qstring.h"
hw/9pfs/9p.c +1 -1
index c80ba67..ab3e22f 100644
@@ -23,7 +23,7 @@
 #include "9p-xattr.h"
 #include "coth.h"
 #include "trace.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 
 int open_fd_hw;
 int total_open_fd;
hw/display/qxl.c +1 -1
index 4d94cec..ad09bb9 100644
@@ -26,7 +26,7 @@
 #include "qemu/queue.h"
 #include "qemu/atomic.h"
 #include "sysemu/sysemu.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "trace.h"
 
 #include "qxl.h"
hw/display/virtio-gpu.c +1 -1
index e1056f3..8ad27f3 100644
@@ -19,7 +19,7 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-bus.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/log.h"
 #include "qapi/error.h"
 
hw/intc/arm_gic_kvm.c +1 -1
index ec952ec..af5cd36 100644
@@ -24,7 +24,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/sysbus.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
 #include "gic_internal.h"
hw/intc/arm_gicv3_its_kvm.c +1 -1
index bd4f3aa..a0441d6 100644
@@ -24,7 +24,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 
 #define TYPE_KVM_ARM_ITS "arm-its-kvm"
 #define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_ITS)
hw/intc/arm_gicv3_kvm.c +1 -1
index 19aab56..4ee2baa 100644
@@ -28,7 +28,7 @@
 #include "kvm_arm.h"
 #include "gicv3_internal.h"
 #include "vgic_common.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 
 #ifdef DEBUG_GICV3_KVM
 #define DPRINTF(fmt, ...) \
hw/misc/ivshmem.c +1 -1
index 82ce837..475e36a 100644
@@ -25,7 +25,7 @@
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 #include "sysemu/kvm.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "qemu/error-report.h"
 #include "qemu/event_notifier.h"
 #include "qom/object_interfaces.h"
hw/scsi/vhost-scsi.c +1 -1
index 8f53ac3..cd4ab05 100644
@@ -21,7 +21,7 @@
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
 #include "monitor/monitor.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "hw/virtio/vhost-scsi.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/virtio-scsi.h"
hw/virtio/vhost.c +1 -1
index 0001e60..03a46a7 100644
@@ -25,7 +25,7 @@
 #include "exec/address-spaces.h"
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "sysemu/dma.h"
 
 /* enabled until disconnected backend stabilizes */
include/migration/blocker.h new file +35 -0
new file mode 100644
index 0000000..acd2701
@@ -0,0 +1,35 @@
+/*
+ * QEMU migration blockers
+ *
+ * Copyright IBM, Corp. 2008
+ *
+ * Authors:
+ *  Anthony Liguori   <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef MIGRATION_BLOCKER_H
+#define MIGRATION_BLOCKER_H
+
+/**
+ * @migrate_add_blocker - prevent migration from proceeding
+ *
+ * @reason - an error to be returned whenever migration is attempted
+ *
+ * @errp - [out] The reason (if any) we cannot block migration right now.
+ *
+ * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set.
+ */
+int migrate_add_blocker(Error *reason, Error **errp);
+
+/**
+ * @migrate_del_blocker - remove a blocking error from migration
+ *
+ * @reason - the error blocking migration
+ */
+void migrate_del_blocker(Error *reason);
+
+#endif
include/migration/migration.h +0 -18
index 465d8ce..258e4ff 100644
@@ -275,24 +275,6 @@ int ram_discard_range(const char *block_name, uint64_t start, size_t length);
 int ram_postcopy_incoming_init(MigrationIncomingState *mis);
 void ram_postcopy_migrated_memory_release(MigrationState *ms);
 
-/**
- * @migrate_add_blocker - prevent migration from proceeding
- *
- * @reason - an error to be returned whenever migration is attempted
- *
- * @errp - [out] The reason (if any) we cannot block migration right now.
- *
- * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set.
- */
-int migrate_add_blocker(Error *reason, Error **errp);
-
-/**
- * @migrate_del_blocker - remove a blocking error from migration
- *
- * @reason - the error blocking migration
- */
-void migrate_del_blocker(Error *reason);
-
 int check_migratable(Object *obj, Error **err);
 
 bool migrate_release_ram(void);
migration/migration.c +1 -0
index 250e3e3..78102eb 100644
@@ -17,6 +17,7 @@
 #include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
+#include "migration/blocker.h"
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
 #include "sysemu/sysemu.h"
stubs/migr-blocker.c +1 -1
index a5ba18f..2b64ac9 100644
@@ -1,6 +1,6 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 
 int migrate_add_blocker(Error *reason, Error **errp)
 {
target/i386/kvm.c +1 -1
index 55865db..011d4a5 100644
@@ -43,7 +43,7 @@
 #include "standard-headers/asm-x86/hyperv.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
-#include "migration/migration.h"
+#include "migration/blocker.h"
 #include "exec/memattrs.h"
 #include "trace.h"
 
Signature · 1 line
2.9.3
#6 lore raw
In reply to Juan Quintela
Quoted 58 lines · Juan Quintela

Hi

This pull contains:
- Fix regression with compression threads (mea culpa)
- start of includes migration (creating of blocker.h header)
- Use Error** correctly after several iterations
- Rename of RAM_SAVE_FLAG_COMPRESS
- Create block capabilities for shared and enable

Please, apply.

The following changes since commit ecc1f5adeec4e3324d1b695a7c54e3967c526949:

maintainers: Add myself as linux-user reviewer (2017-05-11 13:31:11 -0400)

are available in the git repository at:

git://github.com/juanquintela/qemu.git tags/migration/20170512

for you to fetch changes up to f15e5850905dea6a09e29ef14df508ec236321d9:

migration: Create migration/blocker.h (2017-05-12 17:10:57 +0200)

----------------------------------------------------------------
migration/next for 20170512

----------------------------------------------------------------
Juan Quintela (5):
migration: Fix regression with compression threads
migration: Pass Error ** argument to {save,load}_vmstate
ram: Rename RAM_SAVE_FLAG_COMPRESS to RAM_SAVE_FLAG_ZERO
migration: Create block capabilities for shared and enable
migration: Create migration/blocker.h

 block/qcow.c                  |  2 +-
 block/vdi.c                   |  2 +-
 block/vhdx.c                  |  2 +-
 block/vmdk.c                  |  2 +-
 block/vpc.c                   |  2 +-
 block/vvfat.c                 |  2 +-
 hmp.c                         |  9 ++++++--
 hw/9pfs/9p.c                  |  2 +-
 hw/display/qxl.c              |  2 +-
 hw/display/virtio-gpu.c       |  2 +-
 hw/intc/arm_gic_kvm.c         |  2 +-
 hw/intc/arm_gicv3_its_kvm.c   |  2 +-
 hw/intc/arm_gicv3_kvm.c       |  2 +-
 hw/misc/ivshmem.c             |  2 +-
 hw/scsi/vhost-scsi.c          |  2 +-
 hw/virtio/vhost.c             |  2 +-
 include/migration/block.h     |  3 +++
 include/migration/blocker.h   | 35 +++++++++++++++++++++++++++++
 include/migration/migration.h | 21 +++---------------
 include/sysemu/sysemu.h       |  4 ++--
 migration/migration.c         | 37 +++++++++++++++++++++++++++++++
 migration/ram.c               | 35 +++++++++++++++++------------
Quoted 9 lines
 migration/savevm.c            | 51 +++++++++++++++++++++----------------------
 qapi-schema.json              |  7 +++++-
 replay/replay-snapshot.c      |  8 +++++--
 stubs/migr-blocker.c          |  2 +-
 target/i386/kvm.c             |  2 +-
 vl.c                          |  4 +++-
 28 files changed, 165 insertions(+), 83 deletions(-)
 create mode 100644 include/migration/blocker.h

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan

#7 lore raw
Quoted 6 lines · Stefan Hajnoczi
Quoted 6 lines

----------------------------------------------------------------
Juan Quintela (5):
migration: Fix regression with compression threads
migration: Pass Error ** argument to {save,load}_vmstate
ram: Rename RAM_SAVE_FLAG_COMPRESS to RAM_SAVE_FLAG_ZERO
migration: Create block capabilities for shared and enable

We may still end up changing our representation of these capabilities (I don't think the design discussion has completed) - but as long as we get it done before 2.10, I don't see a reason to have to unstage the pull request.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#8 lore raw
In reply to Stefan Hajnoczi
Quoted 7 lines · Stefan Hajnoczi
Quoted 3 lines · Juan Quintela

Hi

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Hi

As fast as I sent the PULL request, more comments appeared.

What do you preffer?
- drop the whole PULL request?
- drop the patch: migration: Create block capabilities for shared and enable it has zero conflicts with the other patches
- let the PULL alone and I will sent fixes on top of that?

I would preffer option two, but that is up to you.

Sorry for the inconvenience.

Later, Juan.

#9 lore raw
In reply to Juan Quintela
Quoted 10 lines · Juan Quintela

Hi

This pull contains:
- Fix regression with compression threads (mea culpa)
- start of includes migration (creating of blocker.h header)
- Use Error** correctly after several iterations
- Rename of RAM_SAVE_FLAG_COMPRESS
- Create block capabilities for shared and enable

Please, apply.

I have reverted the pull request at Juan's request.

Stefan