[PATCH 091/104] libvhost-user: Fix some memtable remap cases

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If a new setmemtable command comes in once the vhost threads are running, it will remap the guests address space and the threads will now be looking in the wrong place. Fortunately we're running this command under lock, so we can update the queue mappings so that t

[PATCH 095/104] virtiofsd: convert more fprintf and perror to use fuse log infra

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Eryu Guan Signed-off-by: Eryu Guan --- tools/virtiofsd/fuse_signals.c | 6 +- tools/virtiofsd/helper.c | 9 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c index 10a6f88088..edabf24e0d 1006

[PATCH 097/104] virtiofsd: Fix data corruption with O_APPEND wirte in writeback mode

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Misono Tomohiro When writeback mode is enabled (-o writeback), O_APPEND handling is done in kernel. Therefore virtiofsd clears O_APPEND flag when open. Otherwise O_APPEND flag takes precedence over pwrite() and write data may corrupt. Currently clearing O_APPEND flag is done in lo_open(),

[PATCH 093/104] virtiofsd: introduce inode refcount to prevent use-after-free

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi If thread A is using an inode it must not be deleted by thread B when processing a FUSE_FORGET request. The FUSE protocol itself already has a counter called nlookup that is used in FUSE_FORGET messages. We cannot trust this counter since the untrusted client can manipulat

[PATCH 098/104] virtiofsd: add definition of fuse_buf_writev()

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: piaojun Define fuse_buf_writev() which use pwritev and writev to improve io bandwidth. Especially, the src bufs with 0 size should be skipped as their mems are not *block_size* aligned which will cause writev failed in direct io mode. Signed-off-by: Jun Piao Suggested-by: Stefan Hajnoczi

[PATCH 100/104] virtiofsd: process requests in a thread pool

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Introduce a thread pool so that fv_queue_thread() just pops VuVirtqElements and hands them to the thread pool. For the time being only one worker thread is allowed since passthrough_ll.c is not thread-safe yet. Future patches will lift this restriction so that multiple FUS

[PULL 1/2] vhost-user-fs: remove "vhostfd" property

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: Marc-André Lureau The property doesn't make much sense for a vhost-user device. Signed-off-by: Marc-André Lureau Message-Id: <20191116112016.14872-1-marcandre.lur...@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/vhost-user-fs.c | 1

[PULL 0/2] virtiofs queue

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit b0ca999a43a22b38158a33d3f5881648bb4f: Update version for v4.2.0 release (2019-12-12 16:45:57 +) are available in the Git repository at: git://github.com/dagrh/qemu.git tags/pull-virtiofs-20191213a for you to fetch c

[PULL 2/2] virtio-fs: fix MSI-X nvectors calculation

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi The following MSI-X vectors are required: * VIRTIO Configuration Change * hiprio virtqueue * requests virtqueues Fix the calculation to reserve enough MSI-X vectors. Otherwise guest drivers fall back to a sub-optional configuration where all virtqueues share a single ve

[PATCH 0/2] rcu_read auto macro use

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, A couple more uses of the rcu_read macros; in qsp and hyperv (neither of which list maintainers, so I guess best through RCU). The hyperv case saves a temporary. The qsp case uses an rcu_read_lock around the lifetime of a snapshot and carefully comments that;

[PATCH 2/2] qsp: Use WITH_RCU_READ_LOCK_GUARD

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The automatic rcu read lock maintenance works quite nicely in this case where it previously relied on a comment to delimit the lifetime and now has a block. Signed-off-by: Dr. David Alan Gilbert --- util/qsp.c | 22 ++ 1 file changed, 10 inser

[PATCH 1/2] hyperv: Use auto rcu_read macros

2019-12-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Use RCU_READ_LOCK_GUARD and WITH_RCU_READ_LOCK_GUARD to replace the manual rcu_read_(un)lock calls. Signed-off-by: Dr. David Alan Gilbert --- hw/hyperv/hyperv.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/hyperv/

[PATCH] usbredir: Prevent recursion in usbredir_write

2019-12-18 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I've got a case where usbredir_write manages to call back into itself via spice; this patch causes the recursion to fail (0 bytes) the write; this seems to avoid the deadlock I was previously seeing. I can't say I fully understand the interaction of usbredir and sp

[PATCH] kvm: Reallocate dirty_bmap when we change a slot

2019-11-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" kvm_set_phys_mem can be called to reallocate a slot by something the guest does (e.g. writing to PAM and other chipset registers). This can happen in the middle of a migration, and if we're unlucky it can now happen between the split 'sync' and 'clear'; the clear as

[PATCH] vmstate-static-checker: Fix for current python

2019-11-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Python 3.7.5 on f31 doesn't seem to like the old type=file syntax on argparse. Signed-off-by: Dr. David Alan Gilbert --- scripts/vmstate-static-checker.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/vmstate-static-checker.py

[PATCH] ci: Use libcap-ng

2019-11-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We currently enable libcap-dev in build-clang to pick up the 9p proxy helper. Paolo's patch changes that to use libcap-ng, so switch to using it. This also means we'll be testing the scsi pr manager and the bridge helper. Signed-off-by: Dr. David Alan Gilbert --

[Qemu-devel] [PATCH 0/2] Fix MemoryRegionSection alignment and comparison

2019-08-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This fixes a symptom I've seen on vhost-user on aarch64 where the daemon would be falsely notified of memory region changes that didn't exist. The underlying problem was me memcmp'ing MemoryRegionSections even though they had padding in. (Discovered while getting v

[Qemu-devel] [PATCH 2/2] vhost: Fix memory region section comparison

2019-08-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Using memcmp to compare structures wasn't safe, as I found out on ARM when I was getting false miscompares. Use the helper function for comparing the MRSs. Fixes: ade6d081fc33948e56e6 Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/vhost.c | 9 +++-- 1

[Qemu-devel] [PATCH 1/2] memory: Align and add helper for comparing MemoryRegionSections

2019-08-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" MemoryRegionSection includes an Int128 'size' field; on some platforms the compiler causes an alignment of this to a 128bit boundary, leaving 8 bytes of dead space. This deadspace can be filled with junk. Move the size field to the top avoiding unnecsssary alignmen

[Qemu-devel] [PATCH v2 2/3] memory: Provide an equality function for MemoryRegionSections

2019-08-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Provide a comparison function that checks all the fields are the same. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 12 1 file changed, 12 insertions(+) diff --git a/include/exec/memory.h b/i

[Qemu-devel] [PATCH v2 0/3] Fix MemoryRegionSection alignment and comparison

2019-08-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This fixes a symptom I've seen on vhost-user on aarch64 where the daemon would be falsely notified of memory region changes that didn't exist. The underlying problem was me memcmp'ing MemoryRegionSections even though they had padding in. (Discovered while getting v

[Qemu-devel] [PATCH v2 1/3] memory: Align MemoryRegionSections fields

2019-08-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" MemoryRegionSection includes an Int128 'size' field; on some platforms the compiler causes an alignment of this to a 128bit boundary, leaving 8 bytes of dead space. This deadspace can be filled with junk. Move the size field to the top avoiding unnecessary alignmen

[Qemu-devel] [PATCH v2 3/3] vhost: Fix memory region section comparison

2019-08-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Using memcmp to compare structures wasn't safe, as I found out on ARM when I was getting falce miscompares. Use the helper function for comparing the MRSs. Fixes: ade6d081fc33948e56e6 Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/vhost.c | 9 +++-- 1

[Qemu-devel] [PULL 05/33] migration/postcopy: break the loop when there is no more page to discard

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang When one is equal or bigger then end, it means there is no page to discard. Just break the loop in this case instead of processing it. No functional change, just refactor it a little. Signed-off-by: Wei Yang Message-Id: <20190627020822.15485-3-richardw.y...@linux.intel.com> Revi

[Qemu-devel] [PULL 02/33] hw/net: fix vmxnet3 live migration

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Marcel Apfelbaum At some point vmxnet3 live migration stopped working and git-bisect didn't help finding a working version. The issue is the PCI configuration space is not being migrated successfully and MSIX remains masked at destination. Remove the migration differentiation between PCI a

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

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit f28ed74fd116491e31329044d140fde4aa23b2a0: Update version for v4.1.0-rc5 release (2019-08-13 15:38:38 +0100) are available in the Git repository at: git://github.com/dagrh/qemu.git tags/pull-migration-20190814a for you to fe

[Qemu-devel] [PULL 14/33] migration: use migration_in_postcopy() to check POSTCOPY_ACTIVE

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Use common helper function to check the state. Signed-off-by: Wei Yang Message-Id: <20190719071129.11880-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/rdma.c | 6 +++--- 1 file changed, 3 insertions(+),

[Qemu-devel] [PULL 01/33] migration: Add error_desc for file channel errors

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Yury Kotov Currently, there is no information about error if outgoing migration was failed because of file channel errors. Example (QMP session): -> { "execute": "migrate", "arguments": { "uri": "exec:head -c 1" }} <- { "return": {} } ... -> { "execute": "query-migrate" } <- { "return": { "

[Qemu-devel] [PULL 04/33] migration/postcopy: the valid condition is one less then end

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang If one equals end, it means we have gone through the whole bitmap. Use a more restrict check to skip a unnecessary condition. Signed-off-by: Wei Yang Message-Id: <20190627020822.15485-2-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David

[Qemu-devel] [PULL 03/33] migration: consolidate time info into populate_time_info

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Consolidate time information fill up into its function for better readability. Signed-off-by: Wei Yang Message-Id: <20190716005411.4156-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 40 +++

[Qemu-devel] [PULL 19/33] migration/postcopy: make PostcopyDiscardState a static variable

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang In postcopy-ram.c, we provide three functions to discard certain RAMBlock range: * postcopy_discard_send_init() * postcopy_discard_send_range() * postcopy_discard_send_finish() Currently, we allocate/deallocate PostcopyDiscardState for each RAMBlock on sending discard infor

[Qemu-devel] [PULL 09/33] migration/savevm: flush file for iterable_only case

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang It would be proper to flush file even for iterable_only case. Signed-off-by: Wei Yang Message-Id: <20190709140924.13291-2-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 3 ++- 1 file changed, 2

[Qemu-devel] [PULL 06/33] migration/postcopy: discard_length must not be 0

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Since we break the loop when there is no more page to discard, we are sure the following process would find some page to discard. It is not necessary to check it again. Signed-off-by: Wei Yang Message-Id: <20190627020822.15485-4-richardw.y...@linux.intel.com> Reviewed-by: Dr. Da

[Qemu-devel] [PULL 20/33] migration/postcopy: simplify calculation of run_start and fixup_start_addr

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang The purpose of the calculation is to find a HostPage which is partially dirty. * fixup_start_addr points to the start of the HostPage to discard * run_start points to the next HostPage to check While in the middle stage, there would two cases for run_start: * aligned with

[Qemu-devel] [PULL 08/33] migration/postcopy: do_fixup is true when host_offset is non-zero

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang This means it is not necessary to spare an extra variable to hold this condition. Use host_offset directly is fine. Signed-off-by: Wei Yang Message-Id: <20190710050814.31344-3-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilber

[Qemu-devel] [PULL 07/33] migration/postcopy: reduce one operation to calculate fixup_start_addr

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Use the same way for run_end to calculate run_start, which saves one operation. Signed-off-by: Wei Yang Message-Id: <20190710050814.31344-2-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 10 ++-

[Qemu-devel] [PULL 11/33] migration/savevm: move non SaveStateEntry condition check out of iteration

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang in_postcopy and iterable_only are not SaveStateEntry specific, it would be more proper to check them out of iteration. Signed-off-by: Wei Yang Message-Id: <20190709140924.13291-4-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gil

[Qemu-devel] [PULL 21/33] migration/postcopy: use QEMU_IS_ALIGNED to replace host_offset

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Use QEMU_IS_ALIGNED for the check, it would be more consistent with other align calculations. Signed-off-by: Wei Yang Message-Id: <20190806004648.8659-3-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c

[Qemu-devel] [PULL 12/33] migration/postcopy: PostcopyState is already set in loadvm_postcopy_handle_advise()

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang PostcopyState is already set to ADVISE at the beginning of loadvm_postcopy_handle_advise(). Remove the redundant set. Signed-off-by: Wei Yang Message-Id: <20190711080816.6405-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilb

[Qemu-devel] [PULL 15/33] migration: just pass RAMBlock is enough

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang RAMBlock->used_length is always passed to migration_bitmap_sync_range(), which could be retrieved from RAMBlock. Suggested-by: Paolo Bonzini Signed-off-by: Wei Yang Message-Id: <20190718012547.16373-1-richardw.y...@linux.intel.com> Reviewed-by: Peter Xu Reviewed-by: Paolo Bonzi

[Qemu-devel] [PULL 10/33] migration/savevm: split qemu_savevm_state_complete_precopy() into two parts

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang This is a preparation patch for further cleanup. No functional change, just wrap two major part of qemu_savevm_state_complete_precopy() into function. Signed-off-by: Wei Yang Message-Id: <20190709140924.13291-3-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PULL 22/33] hmp: Remove migration capabilities from "info migrate"

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang With the growth of migration capabilities, it is not proper to display them in "info migrate". Users are recommended to use "info migrate_capabiltiies" to list them. Signed-off-by: Wei Yang Suggested-by: Dr. David Alan Gilbert Message-Id: <20190806003645.8426-1-richardw.y...@li

[Qemu-devel] [PULL 18/33] migration: extract ram_load_precopy

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang After cleanup, it would be clear to audience there are two cases ram_load: * precopy * postcopy And it is not necessary to check postcopy_running on each iteration for precopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190725002023.2335-3-

[Qemu-devel] [PULL 26/33] migration: add speed limit for multifd migration

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Ivan Ren Limit the speed of multifd migration through common speed limitation qemu file. Signed-off-by: Ivan Ren Message-Id: <1564464816-21804-3-git-send-email-ivan...@tencent.com> Reviewed-by: Wei Yang Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/ram

[Qemu-devel] [PULL 13/33] migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true. So start_postcopy is true implies the other one. Signed-off-by: Wei Yang Message-Id: <20190718083747.5859

[Qemu-devel] [PULL 23/33] migration: remove unused field bytes_xfer

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang MigrationState->bytes_xfer is only set to 0 in migrate_init(). Remove this unnecessary field. Signed-off-by: Wei Yang Message-Id: <20190402003106.17614-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/mig

[Qemu-devel] [PULL 25/33] migration: add qemu_file_update_transfer interface

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Ivan Ren Add qemu_file_update_transfer for just update bytes_xfer for speed limitation. This will be used for further migration feature such as multifd migration. Signed-off-by: Ivan Ren Reviewed-by: Wei Yang Reviewed-by: Juan Quintela Message-Id: <1564464816-21804-2-git-send-email-ivan

[Qemu-devel] [PULL 16/33] migration: equation is more proper than and to check LOADVM_QUIT

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang LOADVM_QUIT allows a command to quit all layers of nested loadvm loops, while current return value check is not that proper even it works now. Current return value check "ret & LOADVM_QUIT" would return true if bit[0] is 1. This would be true when ret is -1 which is used to indica

[Qemu-devel] [PULL 33/33] migration: add some multifd traces

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela Signed-off-by: Juan Quintela Message-Id: <20190814020218.1868-6-quint...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c| 3 +++ migration/trace-events | 4 2 files changed, 7 insertions(+) diff --git

[Qemu-devel] [PULL 29/33] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang For migration incoming side, it either quit in precopy or postcopy. It is safe to use the mis->bh for both instead of allocating a dedicated QEMUBH for postcopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190805053146.32326-1-richardw.y...@linux.

[Qemu-devel] [PULL 17/33] migration: return -EINVAL directly when version_id mismatch

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang It is not reasonable to continue when version_id mismatch. Signed-off-by: Wei Yang Message-Id: <20190722075339.25121-2-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 inserti

[Qemu-devel] [PULL 32/33] migration: Make global sem_sync semaphore by channel

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela This makes easy to debug things because when you want for all threads to arrive at that semaphore, you know which one your are waiting for. Signed-off-by: Juan Quintela Message-Id: <20190814020218.1868-3-quint...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by

[Qemu-devel] [PULL 24/33] migration: always initialise ram_counters for a new migration

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Ivan Ren This patch fix a multifd migration bug in migration speed calculation, this problem can be reproduced as follows: 1. start a vm and give a heavy memory write stress to prevent the vm be successfully migrated to destination 2. begin a migration with multifd 3. migrate for a long

[Qemu-devel] [PULL 27/33] migration: update ram_counters for multifd sync packet

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Ivan Ren Multifd sync will send MULTIFD_FLAG_SYNC flag info to destination, add these bytes to ram_counters record. Signed-off-by: Ivan Ren Suggested-by: Wei Yang Message-Id: <1564464816-21804-4-git-send-email-ivan...@tencent.com> Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan

[Qemu-devel] [PULL 28/33] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Rename for better understanding of the code. Suggested-by: Paolo Bonzini Signed-off-by: Wei Yang Message-Id: <20190808033155.30162-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 6 +++--- 1 file

[Qemu-devel] [PULL 30/33] qemu-file: move qemu_{get, put}_counted_string() declarations

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Marc-André Lureau Move migration helpers for strings under include/, so they can be used outside of migration/ Signed-off-by: Marc-André Lureau Reviewed-by: Juan Quintela Message-Id: <20190808150325.21939-2-marcandre.lur...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- include/

[Qemu-devel] [PULL 31/33] migration: Add traces for multifd terminate threads

2019-08-15 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela Signed-off-by: Juan Quintela Message-Id: <20190814020218.1868-2-quint...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c| 4 migration/trace-events | 2 ++ 2 files changed, 6 insertions(+) diff --git a

[Qemu-devel] [PATCH 1/2] virtio: add vhost-user-fs base device

2019-08-16 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The virtio-fs virtio device provides shared file system access using the FUSE protocol carried ovew virtio. The actual file server is implemented in an external vhost-user-fs device backend process. Signed-off-by: Stefan Hajnoczi Signed-off-by: Sebastien Boeuf Si

[Qemu-devel] [PATCH 0/2] Add virtio-fs (experimental)

2019-08-16 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This pair of patches adds the core of the virtio-fs support to qemu; it's marked experimental since the kernel patch and spec changes aren't in yet; but they're bubbling along. While the spec change is still in progress; the ID number is already reserved.

[Qemu-devel] [PATCH 2/2] virtio: add vhost-user-fs-pci device

2019-08-16 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add the PCI version of vhost-user-fs. Launch QEMU like this: qemu -chardev socket,path=/tmp/vhost-fs.sock,id=chr0 -device x-vhost-user-fs-pci,tag=myfs,chardev=chr0 Signed-off-by: Stefan Hajnoczi Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David A

[Qemu-devel] [for 4.1 PATCH] Revert "hw: report invalid disable-legacy|modern usage for virtio-1-only devs"

2019-07-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This reverts commit f2784eed306449c3d04a71a05ed6463b8289aedf since that accidentally removes the PCIe capabilities from virtio devices because virtio_pci_dc_realize is called before the new 'mode' flag is set. I keep the expanded hw_compat entry because we've lost t

[Qemu-devel] [PATCH v2 1/2] Revert "Revert "globals: Allow global properties to be optional""

2019-07-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This reverts commit 8fa70dbd8bb478d9483c1da3e9976a2d86b3f9a0. Because we're about to revert it's neighbour and thus uses an optional again. Signed-off-by: Dr. David Alan Gilbert --- include/hw/qdev-core.h | 3 +++ qom/object.c | 3 +++ 2 files changed,

[Qemu-devel] [For 4.1 PATCH v2 0/2] Reversions to fix PCIe in virtio

2019-07-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Revert a couple of patches that break PCIe capabilities in virtio devices. The 'optional' revert is just reverted to make the main reversion trivial. Symptom: Loss of PCIe capabilities in virtio devices hung off PCIe bridges Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH v2 2/2] Revert "hw: report invalid disable-legacy|modern usage for virtio-1-only devs"

2019-07-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This reverts commit f2784eed306449c3d04a71a05ed6463b8289aedf since that accidentally removes the PCIe capabilities from virtio devices because virtio_pci_dc_realize is called before the new 'mode' flag is set. Signed-off-by: Dr. David Alan Gilbert --- hw/core/mac

[Qemu-devel] [PATCH 2/2] pcie_root_port: Disable ACS on older machines

2019-07-30 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" ACS got added in 4.0 unconditionally, that broke older<->4.0 migration where there was a PCIe root port. Fix this by turning it off for 3.1 and older machines; note this fixes compatibility for older QEMUs but breaks compatibility with 4.0 for older machine types.

[Qemu-devel] [for 4.1 PATCH 0/2] Disable PCIe ACS on older machines

2019-07-30 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" PCIe ACS (Access Control services) got added in 4.0 and broke migration to and from 3.1 and earlier. Fix it here for older machine types, at the cost of breaking that compatibility with 4.0. Signed-off-by: Dr. David Alan Gilbert Dr. David Alan Gilbert (2): pc

[Qemu-devel] [PATCH 1/2] pcie_root_port: Allow ACS to be disabled

2019-07-30 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" ACS was added in 4.0 unconditionally, this breaks migration compatibility. Allow ACS to be disabled by adding a property that's checked by pcie_root_port. Unfortunately pcie-root-port doesn't have any instance data, so there's no where for that flag to live, so stu

[PATCH 0/4] virtiofsd coverity fixes

2020-02-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a set of fixes that fixes things that coverity pointed out. Only the last one (the NULL check in do_read) is probably important. Dave Dr. David Alan Gilbert (4): virtiofsd: Remove fuse_req_getgroups virtiofsd: fv_create_listen_socket error path s

[PATCH 3/4] virtiofsd: load_capng missing unlock

2020-02-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Missing unlock in error path. Fixes: Covertiy CID 1413123 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index e6f2

[PATCH 2/4] virtiofsd: fv_create_listen_socket error path socket leak

2020-02-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If we fail when bringing up the socket we can leak the listen_fd; in practice the daemon will exit so it's not really a problem. Fixes: Coverity CID 1413121 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 2 ++ 1 file changed, 2 insertio

[PATCH 1/4] virtiofsd: Remove fuse_req_getgroups

2020-02-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Remove fuse_req_getgroups that's unused in virtiofsd; it came in from libfuse but we don't actually use it. It was called from fuse_getgroups which we previously removed (but had left it's header in). Coverity had complained about null termination in it, but remov

[PATCH 4/4] virtiofsd: do_read missing NULL check

2020-02-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Missing a NULL check if the argument fetch fails. Fixes: Coverity CID 1413119 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_

[PULL 0/5] virtiofs queue

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 2b8a51cdb3e8d15a5c35de7a2e76a813ae7358f0: Merge remote-tracking branch 'remotes/gkurz/tags/9p-next-2020-02-08' into staging (2020-02-10 16:07:29 +) are available in the Git repository at: https://gitlab.com/dagrh/qemu.g

[PULL 2/5] virtiofsd: fv_create_listen_socket error path socket leak

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If we fail when bringing up the socket we can leak the listen_fd; in practice the daemon will exit so it's not really a problem. Fixes: Coverity CID 1413121 Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --

[PULL 3/5] virtiofsd: load_capng missing unlock

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Missing unlock in error path. Fixes: Covertiy CID 1413123 Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virti

[PULL 5/5] docs: add virtiofsd(1) man page

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Document the virtiofsd(1) program and its command-line options. This man page is a rST conversion of the original texi documentation that I wrote. Reviewed-by: Liam Merwick Signed-off-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan

[PULL 4/5] virtiofsd: do_read missing NULL check

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Missing a NULL check if the argument fetch fails. Fixes: Coverity CID 1413119 Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd/fuse_lowlevel.c | 4 1 file changed, 4 insertions(+) d

[PULL 1/5] virtiofsd: Remove fuse_req_getgroups

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Remove fuse_req_getgroups that's unused in virtiofsd; it came in from libfuse but we don't actually use it. It was called from fuse_getgroups which we previously removed (but had left it's header in). Coverity had complained about null termination in it, but remov

[PATCH] migration/rdma: rdma_accept_incoming_migration fix error handling

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" rdma_accept_incoming_migration is called from an fd handler and can't return an Error * anywhere. Currently it's leaking Error's in errp/local_err - there's no point putting them in there unless we can report them. Turn most into fprintf's, and the last into an err

[PATCH] tests/migration: Add some slack to auto converge

2020-02-10 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" There's an assert in autoconverge that checks that we quit the iteration when we go below the expected threshold. Philippe saw a case where this assert fired with the measured value slightly over the threshold. (about 3k out of a few million). I can think of two r

[PATCH 3/3] virtiofsd: Swing deprecated message to removed-features

2023-01-18 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Move the deprecation message, since it's now gone. Signed-off-by: Dr. David Alan Gilbert --- docs/about/deprecated.rst | 18 -- docs/about/removed-features.rst | 13 + 2 files changed, 13 insertions(+), 18 deletions(-) diff --gi

[PATCH 1/3] virtiofsd: Remove build and docs glue

2023-01-18 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Remove all the virtiofsd build and docs infrastructure. Signed-off-by: Dr. David Alan Gilbert --- MAINTAINERS| 2 -- docs/conf.py | 4 docs/meson.build | 1

[PATCH 0/3] Remove C virtiofsd

2023-01-18 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We deprecated the C virtiofsd in commit 34deee7b6a1418f3d62a in v7.0 in favour of the Rust implementation at https://gitlab.com/virtio-fs/virtiofsd since then, the Rust version has had more development and has held up well. It's time to say goodbye to the C ver

[PATCH] MAINTAINERS: Remove and change David Gilbert maintainer entries

2023-03-30 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I'm leaving Red Hat next week, so clean up the maintainer entries. 'virtiofs' is just the device code now, so is pretty small, and Stefan is still a maintainer there. 'migration' still has Juan. For 'HMP' I'll swing that over to my personal email. Signed-off-by:

[PULL 02/33] QIOChannelSocket: Introduce assert and reduce ifdefs to improve readability

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Leonardo Bras During implementation of MSG_ZEROCOPY feature, a lot of #ifdefs were introduced, particularly at qio_channel_socket_writev(). Rewrite some of those changes so it's easier to read. Also, introduce an assert to help detect incorrect zero-copy usage is when it's disabled on bui

[PULL 01/33] migration: Remove RDMA_UNREGISTRATION_EXAMPLE

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela Nobody has ever showed up to unregister individual pages, and another set of patches written by Daniel P. Berrangé just remove qemu_rdma_signal_unregister() function needed here. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan

[PULL 03/33] QIOChannelSocket: Fix zero-copy send so socket flush works

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Leonardo Bras Somewhere between v6 and v7 the of the zero-copy-send patchset a crucial part of the flushing mechanism got missing: incrementing zero_copy_queued. Without that, the flushing interface becomes a no-op, and there is no guarantee the buffer is really sent. This can go as bad a

[PULL 13/33] migration: introduce a QIOChannel impl for BlockDriverState VMState

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé Introduce a QIOChannelBlock class that exposes the BlockDriverState VMState region for I/O. This is kept in the migration/ directory rather than io/, to avoid a mutual dependancy between block/ <-> io/ directories. Also the VMState should only be used by the migration co

[PULL 10/33] migration: rename qemu_ftell to qemu_file_total_transferred

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The name 'ftell' gives the misleading impression that the QEMUFile objects are seekable. This is not the case, as in general we just have an opaque stream. The users of this method are only interested in the total bytes processed. This switches to a new name that reflects

[PULL 04/33] migration: Change zero_copy_send from migration parameter to migration capability

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Leonardo Bras When originally implemented, zero_copy_send was designed as a Migration paramenter. But taking into account how is that supposed to work, and how the difference between a capability and a parameter, it only makes sense that zero-copy-send would work better as a capability. T

[PULL 00/33] migration queue

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 2b049d2c8dc01de750410f8f1a4eac498c04c723: Merge tag 'pull-aspeed-20220622' of https://github.com/legoater/qemu into staging (2022-06-22 07:27:06 -0700) are available in the Git repository at: https://gitlab.com/dagrh/qemu.g

[PULL 12/33] migration: rename qemu_file_update_transfer to qemu_file_acct_rate_limit

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The qemu_file_update_transfer name doesn't give a clear guide on what its purpose is, and how it differs from the qemu_file_credit_transfer method. The latter is specifically for accumulating for total migration traffic, while the former is specifically for accounting in

[PULL 05/33] io: add a QIOChannelNull equivalent to /dev/null

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé This is for code which needs a portable equivalent to a QIOChannelFile connected to /dev/null. Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- include/io/channel-null.h | 55

[PULL 08/33] migration: rename rate limiting fields in QEMUFile

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé This renames the following QEMUFile fields * bytes_xfer -> rate_limit_used * xfer_limit -> rate_limit_max The intent is to make it clear that 'bytes_xfer' is specifically related to rate limiting of data and applies to data queued, which need not have been transferred

[PULL 06/33] migration: switch to use QIOChannelNull for dummy channel

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé This removes one further custom impl of QEMUFile, in favour of a QIOChannel based impl. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 7 +

[PULL 26/33] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Hyman Huang(黄勇) Add a non-required argument 'CPUState' to kvm_dirty_ring_reap so that it can cover single vcpu dirty-ring-reaping scenario. Signed-off-by: Hyman Huang(黄勇) Reviewed-by: Peter Xu Message-Id: Signed-off-by: Dr. David Alan Gilbert --- accel/kvm/kvm-all.c | 23

[PULL 07/33] migration: remove unreachble RDMA code in save_hook impl

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The QEMUFile 'save_hook' callback has a 'size_t size' parameter. The RDMA impl of this has logic that takes different actions depending on whether the value is zero or non-zero. It has commented out logic that would have taken further actions if the value was negative.

[PULL 16/33] migration: hardcode assumption that QEMUFile is backed with QIOChannel

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The only callers of qemu_fopen_ops pass 'true' for the 'has_ioc' parameter, so hardcode this assumption in QEMUFile, by passing in the QIOChannel object as a non-opaque parameter. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Q

[PULL 14/33] migration: convert savevm to use QIOChannelBlock for VMState

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé With this change, all QEMUFile usage is backed by QIOChannel at last. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert dgilbert: Wrap long lines ---

[PULL 28/33] migration/dirtyrate: Refactor dirty page rate calculation

2022-06-22 Thread Dr. David Alan Gilbert (git)
From: Hyman Huang(黄勇) abstract out dirty log change logic into function global_dirty_log_change. abstract out dirty page rate calculation logic via dirty-ring into function vcpu_calculate_dirtyrate. abstract out mathematical dirty page rate calculation into do_calculate_dirtyrate, decouple it f

<    5   6   7   8   9   10   11   12   13   14   >