[Qemu-devel] [PULL 12/14] migration: Add VMSTATE_WITH_TMP

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_WITH_TMP is for handling structures where some calculation or rearrangement of the data needs to be performed before the data hits the wire. For example, where the value on the wire is an offset from a non-migrated base, but the data in the structure is the

[Qemu-devel] [PULL 09/14] COLO: Shutdown related socket fd while do failover

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang If the net connection between primary host and secondary host breaks while COLO/COLO incoming threads are doing read() or write(). It will block until connection is timeout, and the failover process will be blocked because of it. So it is necessary to shutdown all the socket

[Qemu-devel] [PULL 13/14] tests/migration: Add test for VMSTATE_WITH_TMP

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a test for VMSTATE_WITH_TMP to tests/test-vmstate.c Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Message-Id: <20170203160651.19917-4-dgilb...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/test-vmstate.c | 98 +++

[Qemu-devel] [PULL 00/14] migration queue

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit df96bfab49dab2d0373e49b51bbb51ce72e1601e: Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20170213-1' into staging (2017-02-13 10:54:49 +) are available in the git repository at: git://github.com/dagrh/qemu.g

[Qemu-devel] [PULL 10/14] COLO: Don't process failover request while loading VM's state

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang We should not do failover work while the main thread is loading VM's state. Otherwise the consistent of VM's memory and device state will be broken. We will restart the loading process after jump over the stage, The new failover status 'RELAUNCH' will help to record if we nee

[Qemu-devel] [PULL 01/14] migration: remove myself as maintainer

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: Amit Shah I'm switching jobs, and I'm not sure I can continue maintaining migration. Signed-off-by: Amit Shah Message-Id: <1486120416-11566-1-git-send-email-amit.s...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- M

[Qemu-devel] [PULL 03/14] migration: add MigrationState arg for ram_save_/compressed_/page()

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: Pavel Butsykin Cosmetic patch. The use of ms variable instead of migrate_get_current() looks nicer, especially when there reuse. Signed-off-by: Pavel Butsykin Message-Id: <20170203152321.19739-2-pbutsy...@virtuozzo.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gi

[Qemu-devel] [PULL 06/14] migrate: Introduce zero RAM checks to skip RAM migration

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya Migration of a "none" machine with no RAM crashes abruptly as bitmap_new() fails and thus aborts. Instead place zero RAM checks at appropriate places to skip migration of RAM in this case and complete migration successfully for devices only. Signed-off-by: Ashijeet Acharya

[Qemu-devel] [PULL 07/14] migration: consolidate VMStateField.start

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: Halil Pasic The member VMStateField.start is used for two things, partial data migration for VBUFFER data (basically provide migration for a sub-buffer) and for locating next in QTAILQ. The implementation of the VBUFFER feature is broken when VMSTATE_ALLOC is used. This however goes unnoti

[Qemu-devel] [PULL 14/14] virtio/migration: Migrate virtio-net to VMState

2017-02-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael S. Tsirkin Message-Id: <20170203160651.19917-5-dgilb...@redhat.com> Signed-off-by: Dr. David Alan Gilbert Merge fix against Halil's removal of the '_start' field in VMSTATE_VBUFFER_MULTIPLY --- hw/

[Qemu-devel] [PATCH v3 4/5] slirp: VMStatify socket level

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Working up the stack, this replaces the slirp_socket_load/save with VMState definitions. A place holder for IPv6 support is added as a comment; it needs testing once the rest of the IPv6 code is there. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quint

[Qemu-devel] [PATCH v3 0/5] SLIRP VMStatification

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is an update to my previous SLIRP vmstatification, but finally the dependent patches have gone in, so this can now follow. The only real change since v2 is adding in the commented out IPv6 migration state as suggested in the review code. Dave Dr. Dav

[Qemu-devel] [PATCH v3 5/5] slirp: VMStatify remaining except for loop

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This converts the remaining components, except for the top level loop, to VMState. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 48 +++- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/slirp

[Qemu-devel] [PATCH v3 1/5] slirp: VMState conversion; tcpcb

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the migration of the struct tcpcb to use a VMStateDescription, the rest of it will come later. Mostly mechanical, except for conversion of some 'char' to uint8_t to ensure portability. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Samuel Thibault Re

[Qemu-devel] [PATCH v3 2/5] slirp: VMStatify sbuf

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the sbuf structure to a VMStateDescription. Note this uses the VMSTATE_WITH_TMP mechanism to calculate and reload the offsets based on the pointers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: David Gibson Reviewed-by: Juan Quintela Acked-by: Samu

[Qemu-devel] [PATCH v3 3/5] slirp: Common lhost/fhost union

2017-02-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The socket structure has a pair of unions for lhost and fhost addresses; the unions are identical so split them out into a separate union declaration. Signed-off-by: Dr. David Alan Gilbert --- slirp/socket.h | 18 -- 1 file changed, 8 insertions(+

[Qemu-devel] [PATCH v4 0/5] SLIRP VMStatification

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is an update to my previous SLIRP vmstatification, but finally the dependent patches have gone in, so this can now follow. Dave v4 Fix 'VMStatify socket level' for mingw64 build; it has some different choices for the type of IPv4 addresses. Dr. D

[Qemu-devel] [PATCH v4 5/5] slirp: VMStatify remaining except for loop

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This converts the remaining components, except for the top level loop, to VMState. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 48 +++- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/slirp

[Qemu-devel] [PATCH v4 1/5] slirp: VMState conversion; tcpcb

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the migration of the struct tcpcb to use a VMStateDescription, the rest of it will come later. Mostly mechanical, except for conversion of some 'char' to uint8_t to ensure portability. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Samuel Thibault Re

[Qemu-devel] [PATCH v4 2/5] slirp: VMStatify sbuf

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the sbuf structure to a VMStateDescription. Note this uses the VMSTATE_WITH_TMP mechanism to calculate and reload the offsets based on the pointers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: David Gibson Reviewed-by: Juan Quintela Acked-by: Samu

[Qemu-devel] [PATCH v4 4/5] slirp: VMStatify socket level

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Working up the stack, this replaces the slirp_socket_load/save with VMState definitions. A place holder for IPv6 support is added as a comment; it needs testing once the rest of the IPv6 code is there. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 1

[Qemu-devel] [PATCH v4 3/5] slirp: Common lhost/fhost union

2017-02-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The socket structure has a pair of unions for lhost and fhost addresses; the unions are identical so split them out into a separate union declaration. Signed-off-by: Dr. David Alan Gilbert --- slirp/socket.h | 18 -- 1 file changed, 8 insertions(+

[Qemu-devel] [PATCH] libvhost-user: Fix VHOST_USER_NET_SET_MTU entry

2017-05-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VHOST_USER_'s 20th entry is defined as VHOST_USER_INPUT_GET_CONFIG but should be VHOST_USER_NET_SET_MTU. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 2 +- contrib/libvhost-user/libvhost-user.h | 2 +- 2 files changed, 2 inser

[Qemu-devel] [PATCH v2] block migration: Allow compile time disable

2017-05-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Many users now prefer to use drive_mirror over NBD as an alternative to the older migrate -b option; drive_mirror is more complex to setup but gives you more options (e.g. only migrating some of the disks if some of them are shared). Allow the large chunk of block

[Qemu-devel] [PATCH 0/2] Migration+huge page fixes

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, The attached patch-pair fix migration in the case where you are using huge pages but you have a RAM size which is not a multiple of the huge page size. It's unfortunately legal so there might be VMs out there that already have it, and it turns out it used to w

[Qemu-devel] [PATCH 2/2] postcopy: Require RAMBlocks that are whole pages

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" It turns out that it's legal to create a VM with RAMBlocks that aren't a multiple of the pagesize in use; e.g. a 1025M main memory using 2M host pages. That breaks postcopy's atomic placement of pages, so disallow it. Signed-off-by: Dr. David Alan Gilbert --- mi

[Qemu-devel] [PATCH 1/2] migration: Fix non-multiple of page size migration

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Unfortunately it's legal to create a VM with a RAM size that's not a multiple of the underlying host page or huge page size. Recently I'd changed things to always send host sized pages, and that breaks if we have say a 1025MB guest on 2MB hugepages. Unfortunately w

[Qemu-devel] [PULL 1/3] ramblock: add RAMBLOCK_FOREACH()

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: Peter Xu So that it can simplifies the iterators. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <1494562661-9063-2-git-send-email-pet...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- exec.c | 22 +++--- include/exec/raml

[Qemu-devel] [PULL 0/3] hmp queue

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit cdece0467c7cf8e3f4b3c3f0b13bf2c4fea9: block/win32: fix 'ret not initialized' warning (2017-05-16 15:34:18 +0100) are available in the git repository at: git://github.com/dagrh/qemu.git tags/pull-hmp-20170517 for you to

[Qemu-devel] [PULL 2/3] utils: provide size_to_str()

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: Peter Xu Moving the algorithm from print_type_size() into size_to_str() so that other component can also leverage it. With that, refactor print_type_size(). The assert() in that logic is removed though, since even UINT64_MAX would not overflow. Signed-off-by: Peter Xu Message-Id: <149456

[Qemu-devel] [PULL 3/3] ramblock: add new hmp command "info ramblock"

2017-05-17 Thread Dr. David Alan Gilbert (git)
From: Peter Xu To dump information about ramblocks. It looks like: (qemu) info ramblock Block NamePSize Offset Used Total /objects/mem2 MiB 0x 0x8000 0x8000 vga.vr

[Qemu-devel] [PATCH] MAINTAINERS: Add myself as a migration submaintainer

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ad10004..c4b00ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1413,6 +1413,7 @@ F: scripts/checkpatch.pl Migration M: Juan

[Qemu-devel] [PULL 01/15] MAINTAINERS: Add myself as a migration submaintainer

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah Reviewed-by: Juan Quintela Message-Id: <20170124100437.18200-1-dgilb...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINER

[Qemu-devel] [PULL 06/15] block/vvfat: Remove the undesirable comment

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya Remove the "// assert(is_consistent(s))" comment in block/vvfat.c Signed-off-by: Ashijeet Acharya Message-Id: <1484566314-3987-2-git-send-email-ashijeetacha...@gmail.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- block/vvfat.c | 1 -

[Qemu-devel] [PULL 00/15] migration queue

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit a678502e4f7580a6f143f680404aaee57ac3f4b5: Merge remote-tracking branch 'remotes/ehabkost/tags/x86-and-machine-pull-request' into staging (2017-01-24 15:39:09 +) are available in the git repository at: git://github.com/

[Qemu-devel] [PULL 04/15] tests/migration: Add test for QTAILQ migration

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Jianjun Duan Add a test for QTAILQ migration to tests/test-vmstate.c. Signed-off-by: Jianjun Duan Message-Id: <1484852453-12728-4-git-send-email-du...@linux.vnet.ibm.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tests/test-vmstate.c | 147 ++

[Qemu-devel] [PULL 12/15] migration: Change name of live migration thread

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Pankaj Gupta Change the name of live migration thread from 'migration' to 'live_migration' to identify it clearly. 'migration' is a generic word and kernel also has tasks for process migration with the name 'migration/cpu#'. Signed-off-by: Pankaj Gupta Message-Id: <1485178976-15225-1-git

[Qemu-devel] [PULL 05/15] migration: add error_report

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Jianjun Duan Added error_report where version_ids do not match in vmstate_load_state. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jianjun Duan Message-Id: <1484852453-12728-5-git-send-email-du...@linux.vnet.ibm.com> Signed-off-by: Dr. David Alan Gilbert --- migration/vmstate.c

[Qemu-devel] [PULL 02/15] migration: extend VMStateInfo

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Jianjun Duan Current migration code cannot handle some data structures such as QTAILQ in qemu/queue.h. Here we extend the signatures of put/get in VMStateInfo so that customized handling is supported. put now will return int type. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jianju

[Qemu-devel] [PULL 14/15] migration: transform remaining DPRINTF into trace_

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela So we can remove DPRINTF() macro Signed-off-by: Juan Quintela Message-Id: <1485207141-1941-2-git-send-email-quint...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Dr. David Alan Gilbert Fixed up 'remained/remaining' as requested by Eric --- migration/ram.c|

[Qemu-devel] [PULL 10/15] migration: Fail migration blocker for --only-migratable

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya migrate_add_blocker should rightly fail if the '--only-migratable' option was specified and the device in use should not be able to perform the action which results in an unmigratable VM. Make migrate_add_blocker return -EACCES in this case. Signed-off-by: Ashijeet Achary

[Qemu-devel] [PULL 03/15] migration: migrate QTAILQ

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Jianjun Duan Currently we cannot directly transfer a QTAILQ instance because of the limitation in the migration code. Here we introduce an approach to transfer such structures. We created VMStateInfo vmstate_info_qtailq for QTAILQ. Similar VMStateInfo can be created for other data structure

[Qemu-devel] [PULL 13/15] PCI/migration merge vmstate_pci_device and vmstate_pcie_device

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The vmstate_pci_device and vmstate_pcie_devices differ just in the size of one buffer; combine the two using a _TEST macro. I think this is safe as long as everywhere which currently uses either of these two uses the right type. One thing that concerns me is that

[Qemu-devel] [PULL 07/15] migration: Add a new option to enable only-migratable

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya Add a new option "--only-migratable" in qemu which will allow to add only those devices which will not fail qemu after migration. Devices set with the flag 'unmigratable' cannot be added when this option will be used. Signed-off-by: Ashijeet Acharya Message-Id: <148456631

[Qemu-devel] [PULL 08/15] migration: Allow "device add" options to only add migratable devices

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya Introduce checks for the unmigratable flag in the VMStateDescription structs of respective devices when user attempts to add them. If the "--only-migratable" was specified, all unmigratable devices will rightly fail to add. This feature is made compatible for both "-device"

[Qemu-devel] [PULL 15/15] migration/tracing: Add tracing on save

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add some tracing to vmstate_subsection_save and vmstate_save_state to help in debugging when you're not sure if a conditional piece of data is being saved. In vmstate_subsection_save I renamed the inner vmsd to avoid the aliasing and be able to print both names. S

[Qemu-devel] [PULL 11/15] migration: re-active images while migration been canceled after inactive them

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang commit fe904ea8242cbae2d7e69c052c754b8f5f1ba1d6 fixed a case which migration aborted QEMU because it didn't regain the control of images while some errors happened. Actually, there are another two cases can trigger the same error reports: " bdrv_co_do_pwritev: Assertion `!(bs

[Qemu-devel] [PULL 09/15] migration: disallow migrate_add_blocker during migration

2017-01-24 Thread Dr. David Alan Gilbert (git)
From: Ashijeet Acharya If a migration is already in progress and somebody attempts to add a migration blocker, this should rightly fail. Add an errp parameter and a retcode return value to migrate_add_blocker. Signed-off-by: John Snow Signed-off-by: Ashijeet Acharya Message-Id: <1484566314-39

[Qemu-devel] [PATCH v2 1/3] vmstate_register_with_alias_id: Take an Error **

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I'll be adding an error to it in a subsequent patch. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- hw/core/qdev.c | 3 ++- hw/intc/apic_common.c | 2 +- include/migration/vmstate.h | 5 +++-- migration/savevm.c

[Qemu-devel] [PATCH v2 2/3] migration: Check for ID length

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The qdev id of a device can be huge if it's on the end of a chain of bridges; in reality such chains shouldn't occur but they can be made to by chaining PCIe bridges together. The migration format has a number of 256 character long format limits; check we don't hit

[Qemu-devel] [PATCH v2 0/3] Protect against long IDs

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" QEMU currently asserts if you try and create a PCI device on the end of a very long chain, because the ID string exceeds the maximum length, and ends up aliasing. Fail with a clean error in this common case; there's lots of other places that call the various regis

[Qemu-devel] [PATCH v2 3/3] vmstate registration: check return values

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Check qdev's call to vmstate_register_with_alias_id; that gets most of the common uses; there's hundreds of calls via vmstate_register which could get fixed over time. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- hw/core/qdev.c | 10 +

[Qemu-devel] [PATCH 1/2] Postcopy: Reset state to avoid cleanup assert

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" On a destination host with no userfault support an incoming postcopy would cause the state to enter ADVISE before it realised there was no support, and because it was in ADVISE state it would perform a cleanup at the end. Since there was no support the cleanup func

[Qemu-devel] [PATCH 0/2] Postcopy fixes

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, These are a couple of postcopy fixes for failure paths; The first is a pretty harmless assert, it happens on the destination when it discovers that it's got an incoming postcopy but it can't support it - it was going to exit anyway. The second is more useful

[Qemu-devel] [PATCH 2/2] postcopy: Recover block devices on early failure

2017-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" An early postcopy failure can be recovered from as long as we know we haven't sent the command to run the destination. We have to undo the bdrv_inactivate_all by calling bdrv_invalidate_cache_all Note that I'm not using ms->block_inactive because once we've sent th

[Qemu-devel] [PATCH 0/4] virtio-net VMState conversion and new VMSTATE macros

2017-02-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This set converts the virtio-net device to VMState; it uses a couple of new VMSTATE macros I've added, of which the VMSTATE_WITH_TMP is a bit unusual, but is intended for dealing with migration data that doesn't quite look like the data structure we have in me

[Qemu-devel] [PATCH 1/4] migration: Add VMSTATE_UNUSED_VARRAY_UINT32

2017-02-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_UNUSED_VARRAY_UINT32 is used to skip a chunk of the stream that's an n-element array; note the array size and the dynamic value read never get multiplied so there's no overflow risk. Signed-off-by: Dr. David Alan Gilbert --- include/migration/vmstate.h |

[Qemu-devel] [PATCH 3/4] tests/migration: Add test for VMSTATE_WITH_TMP

2017-02-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a test for VMSTATE_WITH_TMP to tests/test-vmstate.c Signed-off-by: Dr. David Alan Gilbert --- tests/test-vmstate.c | 98 1 file changed, 92 insertions(+), 6 deletions(-) diff --git a/tests/test-vmstate.c b

[Qemu-devel] [PATCH 4/4] virtio/migration: Migrate virtio-net to VMState

2017-02-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- hw/net/virtio-net.c| 316 +++-- include/hw/virtio/virtio-net.h | 4 +- 2 files changed, 213 insertions(+), 107 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virti

[Qemu-devel] [PATCH 2/4] migration: Add VMSTATE_WITH_TMP

2017-02-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_WITH_TMP is for handling structures where some calculation or rearrangement of the data needs to be performed before the data hits the wire. For example, where the value on the wire is an offset from a non-migrated base, but the data in the structure is the

[Qemu-devel] [PATCH v2 03/16] postcopy: Chunk discards for hugepages

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" At the start of the postcopy phase, partially sent huge pages must be discarded. The code for dealing with host page sizes larger than the target page size can be reused for this case. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migrati

[Qemu-devel] [PATCH v2 02/16] postcopy: Transmit and compare individual page sizes

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When using postcopy with hugepages, we require the source and destination page sizes for any RAMBlock to match; note that different RAMBlocks in the same VM can have different page sizes. Transmit them as part of the RAM information header and fail if there's a dif

[Qemu-devel] [PATCH v2 05/16] postcopy: enhance ram_block_discard_range for hugepages

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Unfortunately madvise DONTNEED doesn't work on hugepagetlb so use fallocate(FALLOC_FL_PUNCH_HOLE) qemu_fd_getpagesize only sets the page based off a file if the file is from hugetlbfs. Signed-off-by: Dr. David Alan Gilbert --- exec.c | 13 - 1 file ch

[Qemu-devel] [PATCH v2 01/16] postcopy: Transmit ram size summary word

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Replace the host page-size in the 'advise' command by a pagesize summary bitmap; if the VM is just using normal RAM then this will be exactly the same as before, however if they're using huge pages they'll be different, and thus: a) Migration from/to old qemu's t

[Qemu-devel] [PATCH v2 08/16] postcopy: Plumb pagesize down into place helpers

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Now we deal with normal size pages and huge pages we need to tell the place handlers the size we're dealing with and make sure the temporary page is large enough. Signed-off-by: Dr. David Alan Gilbert --- include/migration/postcopy-ram.h | 6 +++-- migration/pos

[Qemu-devel] [PATCH v2 06/16] Fold postcopy_ram_discard_range into ram_discard_range

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Using the previously created ram_block_discard_range, kill off postcopy_ram_discard_range. ram_discard_range is just a wrapper that does the name lookup. Signed-off-by: Dr. David Alan Gilbert --- include/migration/postcopy-ram.h | 7 --- migration/postcopy-r

[Qemu-devel] [PATCH v2 04/16] exec: ram_block_discard_range

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Create ram_block_discard_range in exec.c to replace postcopy_ram_discard_range and most of ram_discard_range. Those two routines are a bit of a weird combination, and ram_discard_range is about to get more complex for hugepages. It's OS dependent code (so shouldn't

[Qemu-devel] [PATCH v2 00/16] Postcopy: Hugepage support

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, The existing postcopy code, and the userfault kernel code that supports it, only works for normal anonymous memory. Kernel support for userfault on hugetlbfs is working it's way upstream; it's in the linux-mm tree, You can get a version at: git://git.kernel

[Qemu-devel] [PATCH v2 11/16] postcopy: Mask fault addresses to huge page boundary

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Currently the fault address received by userfault is rounded to the host page boundary and a host page is requested from the source. Use the current RAMBlock page size instead of the general host page size so that for RAMBlocks backed by huge pages we request the wh

[Qemu-devel] [PATCH v2 10/16] postcopy: Load huge pages in one go

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The existing postcopy RAM load loop already ensures that it glues together whole host-pages from the target page size chunks sent over the wire. Modify the definition of host page that it uses to be the RAM block page size and thus be huge pages where appropriate.

[Qemu-devel] [PATCH v2 16/16] postcopy: Add doc about hugepages and postcopy

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- docs/migration.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 6503c17..b462ead 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -482,3 +482,1

[Qemu-devel] [PATCH v2 07/16] postcopy: Record largest page size

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Record the largest page size in use; we'll need it soon for allocating temporary buffers. Signed-off-by: Dr. David Alan Gilbert --- exec.c| 13 + include/exec/cpu-common.h | 1 + include/migration/migration.h | 1 + migra

[Qemu-devel] [PATCH v2 15/16] postcopy: Check for userfault+hugepage feature

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We need extra Linux kernel support (~4.11) to support userfaults on hugetlbfs; check for them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/postcopy-ram.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff

[Qemu-devel] [PATCH v2 14/16] postcopy: Update userfaultfd.h header

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We use a new userfaultfd define, so update the header. (Not needed if someone just runs the update script once it's gone into the main kernel). Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- linux-headers/linux/userfaultfd.h | 81 ++

[Qemu-devel] [PATCH v2 13/16] postcopy: Allow hugepages

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow huge pages in postcopy. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/postcopy-ram.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcop

[Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The RAM save code uses ram_save_host_page to send whole host pages at a time; change this to use the host page size associated with the RAM Block which may be a huge page. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/ram.c | 6

[Qemu-devel] [PATCH v2 09/16] postcopy: Use temporary for placing zero huge pages

2017-02-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The kernel can't do UFFDIO_ZEROPAGE for huge pages, so we have to allocate a temporary (always zero) page and use UFFDIO_COPYPAGE on it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- include/migration/migration.h | 1 + migration/postcopy

[Qemu-devel] [PULL 2/5] monitor: Check whether TCG is enabled before running the "info jit" code

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: Thomas Huth The "info jit" command currently aborts on Mac OS X with the message "qemu_mutex_lock: Invalid argument" when running with "-M accel=qtest". We should only call into the TCG code here if TCG has really been enabled and initialized. Signed-off-by: Thomas Huth Message-Id: <14931

[Qemu-devel] [PULL 3/5] libqtest: Ignore QMP events when parsing the response for HMP commands

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: Thomas Huth When running certain HMP commands (like "device_del") via QMP, we can sometimes get a QMP event in the response first, so that the "g_assert(ret)" statement in qtest_hmp() triggers and the test fails. Fix this by ignoring such QMP events while looking for the real return value f

[Qemu-devel] [PULL 5/5] tests: Add a tester for HMP commands

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: Thomas Huth HMP commands do not get any automatic testing yet, so on certain QEMU machines, some HMP commands were causing crashes in the past. Thus we should test HMP commands in our test suite, too, to avoid that such problems creep in again in the future. Signed-off-by: Thomas Huth Mes

[Qemu-devel] [PULL 0/5] hmp queue

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit dcaed66cbe2803f9378f3a043c2e482bf8035dfd: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170426' into staging (2017-04-26 13:17:11 +0100) are available in the git repository at: git://github.com/dagrh/qem

[Qemu-devel] [PULL 1/5] hmp: gpa2hva and gpa2hpa hostaddr command

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: Paolo Bonzini These commands are useful when testing machine-check passthrough. gpa2hva is useful to inject a MADV_HWPOISON madvise from gdb, while gpa2hpa is useful to inject an error with the mce-inject kernel module. Signed-off-by: Paolo Bonzini Message-Id: <1490021158-4469-1-git-send-

[Qemu-devel] [PULL 4/5] libqtest: Add a generic function to run a callback function for every machine

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: Thomas Huth Some tests need to run single tests for every available machine of the current QEMU binary. To avoid code duplication, let's extract this code that deals with 'query-machines' into a separate function. Signed-off-by: Thomas Huth Message-Id: <1490860207-8302-3-git-send-email-th

[Qemu-devel] [PATCH 1/2] Postcopy: Force allocation of all-zero precopy pages

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When an all-zero page is received during the precopy phase of a postcopy-enabled migration we must force allocation otherwise accesses to the page will still get blocked by userfault. Symptom: a) If the page is accessed by a device during device-load then we

[Qemu-devel] [PATCH 0/2] Postcopy fix and traces

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a small postcopy fix for a bug that Christian ran into, and a couple of extra traces that would have made finding it easier. Dave Dr. David Alan Gilbert (2): Postcopy: Force allocation of all-zero precopy pages migration: Extra tracing include/

[Qemu-devel] [PATCH 2/2] migration: Extra tracing

2017-04-26 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" A couple more traces that would have made fixing that postcopy bug a bit easier. Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c| 2 ++ migration/trace-events | 2 ++ 2 files changed, 4 insertions(+) diff --git a/migration/ram.c b/migration/ram

[Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Glib commit a6a875068779 (from 2013) made many of the glib assert macros non-fatal if a flag is set. This causes two problems: a) Compilers moan that your code is unsafe even though you've put an assert in before the point of use. b) Someone evil could, in

[Qemu-devel] [PATCH] block migration: Allow compile time disable

2017-05-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Many users now prefer to use drive_mirror over NBD as an alternative to the older migrate -b option; drive_mirror is more complex to setup but gives you more options (e.g. only migrating some of the disks if some of them are shared). Allow the large chunk of block

[Qemu-devel] [PATCH 05/13] virtio-blk: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/block/virtio-blk.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio

[Qemu-devel] [PATCH 03/13] virtio: Migration helper function and macro

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" To make conversion of virtio devices to VMState simple at first add a helper function for the simple virtio_save case and a helper macro that defines the VMState structure. These will probably go away or change as more of the virtio code gets converted. Signed-off-

[Qemu-devel] [PATCH 01/13] virtio-net: Remove old migration version support

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" virtio-net has had version 11 since 0ce0e8f4 in 2009 (v0.11.0-rc0-1480-g0ce0e8f) - remove the code to support loading anything earlier. Signed-off-by: Dr. David Alan Gilbert --- hw/net/virtio-net.c | 87 + 1 fil

[Qemu-devel] [PATCH 00/13] virtio migration: Flip outer layer to vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This series converts the outer most layer of virtio to use VMState macros; this is the easy bit, but I'm hoping that having done that, the next trick is to nibble away at the virtio_save/load functions and all of the zillions of device/bus helpers. I think t

[Qemu-devel] [PATCH 10/13] 9pfs: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/9pfs/virtio-9p-device.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/

[Qemu-devel] [PATCH 07/13] virtio-balloon: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio-balloon.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw

[Qemu-devel] [PATCH 08/13] virtio-net: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/net/virtio-net.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.

[Qemu-devel] [PATCH 04/13] virtio-scsi: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/scsi/virtio-scsi.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/vi

[Qemu-devel] [PATCH 11/13] virtio-input: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/input/virtio-input.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/hw/input/virtio-input.c b/h

[Qemu-devel] [PATCH 09/13] virtio-serial: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/char/virtio-serial-bus.c | 27 ++- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/hw/char/virtio-serial-

[Qemu-devel] [PATCH 06/13] virtio-rng: Wrap in vmstate

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio-rng.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio

[Qemu-devel] [PATCH 02/13] virtio-serial: Remove old migration version support

2016-06-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" virtio-serial-bus has had version 3 since 37f95bf3d0 in 0.13-rc0; it's time to clean it up a bit. Signed-off-by: Dr. David Alan Gilbert --- hw/char/virtio-serial-bus.c | 37 +++-- 1 file changed, 15 insertions(+), 22 deletions(-)

<    2   3   4   5   6   7   8   9   10   11   >