[PATCH v2 2/3] virtiofsd: Check capability calls

2020-06-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Check the capability calls worked. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c

[PATCH v2 3/3] virtiofsd: Allow addition or removal of capabilities

2020-06-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow capabilities to be added or removed from the allowed set for the daemon; e.g. default: CapPrm: 88df CapEff: 88df -o modcaps=+sys_admin CapPrm: 882000df CapEff: 882000df -o modcaps=+sys_admin:-chown CapPrm:

[PATCH v2 0/3] virtiofsd capability changes and addition

2020-06-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a set of changes relating to the capability restirctions introduced in virtiofsd back in a59feb483b8. The first one is a potentially important fix; the missing terminator could mean extra capabilities are added based on junk on the stack; although

[PATCH v2 1/3] virtiofsd: Terminate capability list

2020-06-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" capng_updatev is a varargs function that needs a -1 to terminate it, but it was missing. In practice what seems to have been happening is that it's added the capabilities we asked for, then runs into junk on the stack, so if we're unlucky it might be adding some

[PATCH 2/3] virtiofsd: Check capability calls

2020-06-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Check the capability calls worked. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c

[PATCH 3/3] virtiofsd: Allow addition or removal of capabilities

2020-06-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow capabilities to be added or removed from the allowed set for the daemon; e.g. default: CapPrm: 88df CapEff: 88df -o modcaps=+sys_admin CapPrm: 882000df CapEff: 882000df -o modcaps=+sys_admin:-chown CapPrm:

[PATCH 0/3] virtiofsd capability changes and addition

2020-06-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a set of changes relating to the capability restirctions introduced in virtiofsd back in a59feb483b8. The first one is a potentially important fix; the missing terminator could mean extra capabilities are added based on junk on the stack; although

[PATCH 1/3] virtiofsd: Terminate capability list

2020-06-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" capng_updatev is a varargs function that needs a -1 to terminate it, but it was missing. In practice what seems to have been happening is that it's added the capabilities we asked for, then runs into junk on the stack, so if we're unlucky it might be adding some

[PATCH] virtiofsd: Allow capability restriction to be turned off

2020-06-19 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Commit a59feb483b8fae24d043 dropped most capabilities at startup, since in most cases virtiofsd doesn't need them. Unfortunately we found a case that needs CAP_SYS_ADMIN - setting trusted extended attributes. It's rare to need it, and the clean fix for it is going

[PULL 11/12] docs/xbzrle: update 'cache miss rate' and 'encoding rate' to docs

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Signed-off-by: Mao Zhongyi Message-Id: <20200603080904.997083-9-maozhon...@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- docs/xbzrle.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PULL 09/12] monitor/hmp-cmds: add 'goto end' to reduce duplicate code.

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Signed-off-by: Mao Zhongyi Message-Id: <20200603080904.997083-7-maozhon...@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PULL 12/12] migration: fix multifd_send_pages() next channel

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Laurent Vivier multifd_send_pages() loops around the available channels, the next channel to use between two calls to multifd_send_pages() is stored inside a local static variable, next_channel. It works well, except if the number of channels decreases between two calls to

[PULL 08/12] monitor/hmp-cmds: delete redundant Error check before invoke hmp_handle_error()

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi hmp_handle_error() does Error check internally. Signed-off-by: Mao Zhongyi Message-Id: <20200603080904.997083-6-maozhon...@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 5 ++--- 1 file changed, 2

[PULL 10/12] monitor/hmp-cmds: improvements for the 'info migrate'

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi When running: (qemu) info migrate globals: store-global-state: on only-migratable: off ... xbzrle transferred: 640892 kbytes xbzrle pages: 16645936 pages xbzrle cache miss: 1525426 xbzrle cache miss rate: 0.09 xbzrle encoding rate: 91.42 xbzrle overflow: 40896 ... compression

[PULL 02/12] qom-hmp-cmds: fix a memleak in hmp_qom_get

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan 'obj' forgot to free at the end of hmp_qom_get(). Fix that. The leak stack: Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f4e3a779ae8 in __interceptor_malloc (/lib64/libasan.so.5+0xefae8) #1 0x7f4e398f91d5 in g_malloc (/lib64/libglib-2.0.so.0+0x531d5)

[PULL 05/12] tests/migration: fix unreachable path in stress test

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi If stressone() or stress() exits it's because of a failure because the test runs forever otherwise, so change stressone and stress type to void to make the exit_failure() as the exit function of main(). Signed-off-by: Mao Zhongyi Reviewed-by: Laurent Vivier Message-Id:

[PULL 07/12] monitor/hmp-cmds: don't silently output when running 'migrate_set_downtime' fails

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Although 'migrate_set_downtime' has been deprecated and replaced with 'migrate_set_parameter downtime_limit', it has not been completely eliminated, possibly due to compatibility with older versions. I think as long as this old parameter is running, we should report appropriate

[PULL 03/12] hmp: Make json format optional for qom-set

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: David Hildenbrand Commit 7d2ef6dcc1cf ("hmp: Simplify qom-set") switched to the json parser, making it possible to specify complex types. However, with this change it is no longer possible to specify proper sizes (e.g., 2G, 128M), turning the interface harder to use for properties that

[PULL 06/12] monitor/hmp-cmds: add units for migrate_parameters

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi When running: (qemu) info migrate_parameters announce-initial: 50 ms announce-max: 550 ms announce-step: 100 ms compress-wait-thread: on ... max-bandwidth: 33554432 bytes/second downtime-limit: 300 milliseconds x-checkpoint-delay: 2 ... xbzrle-cache-size: 67108864 add

[PULL 01/12] virtiofsd: Whitelist fchmod

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Max Reitz lo_setattr() invokes fchmod() in a rarely used code path, so it should be whitelisted or virtiofsd will crash with EBADSYS. Said code path can be triggered for example as follows: On the host, in the shared directory, create a file with the sticky bit set and a

[PULL 04/12] tests/migration: mem leak fix

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi ‘data’ has the possibility of memory leaks, so use the glib macros g_autofree recommended by CODING_STYLE.rst to automatically release the memory that returned from g_malloc(). Signed-off-by: Mao Zhongyi Reviewed-by: Alex Bennée Reviewed-by: Laurent Vivier Message-Id:

[PULL 00/12] migration, HMP and virtiofs queue

2020-06-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 26bf4a29213b432eb390726c698a1915550a9cf9: Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200617-pull-request' into staging (2020-06-17 16:24:24 +0100) are available in the Git repository at:

[PATCH 1/2] qmp: Add 'openfd' command

2020-06-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The existing 'getfd' command imports an fd from the monitor via SCM rights. This command allows qemu to open the file for itself; this is convenient primarily in testing, or with simple QMP clients. Signed-off-by: Dr. David Alan Gilbert --- monitor/misc.c | 48

[PATCH 0/2] monitor openfd commands

2020-06-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The monitors currently have a 'getfd' command that lets you pass an fd via the monitor socket. 'openfd' is a new command that opens a file and puts the fd in the same fd pool. The file is opened RW and created if it doesn't exist. It makes it easy to test

[PATCH 2/2] hmp: Add 'openfd' command

2020-06-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Wire up the hmp 'openfd' to open a file and add it to the monitor's fd stash. Example usage: (qemu) openfd mig "my.mig" (qemu) migrate -d "fd:mig" Signed-off-by: Dr. David Alan Gilbert --- hmp-commands.hx| 16 +++- include/monitor/hmp.h |

[PULL 12/12] migration/migration.c: Fix hang in ram_save_host_page

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub migration_rate_limit will erroneously ratelimit a shutdown socket, which causes the migration thread to hang in ram_save_host_page if the socket is shutdown. Fix this by explicitly testing if the socket has errors or was shutdown in migration_rate_limit. Signed-off-by: Lukas

[PULL 10/12] migration/colo.c: Relaunch failover even if there was an error

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub If vmstate_loading is true, secondary_vm_do_failover will set failover status to FAILOVER_STATUS_RELAUNCH and return success without initiating failover. However, if there is an error during the vmstate_loading section, failover isn't relaunched. Instead we then wait for

[PULL 07/12] migration/colo.c: Use event instead of semaphore

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub If multiple packets miscompare in a short timeframe, the semaphore value will be increased multiple times. This causes multiple checkpoints even if one would be sufficient. Fix this by using a event instead of a semaphore for triggering checkpoints. Now, checkpoint requests

[PULL 03/12] hmp: Implement qom-get HMP command

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This started off as Andreas Färber's implementation from March 2015, but after feedback from Paolo and Markus it morphed into using the json output which handles structs reasonably. Use with qom-list to find the members of an object. (qemu) qom-get

[PULL 11/12] migration/colo.c: Move colo_notify_compares_event to the right place

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub If the secondary has to failover during checkpointing, it still is in the old state (i.e. different state than primary). Thus we can't expose the primary state until after the checkpoint is sent. This fixes sporadic connection reset of client connections during failover.

[PULL 05/12] virtiofsd: remove symlink fallbacks

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Miklos Szeredi Path lookup in the kernel has special rules for looking up magic symlinks under /proc. If a filesystem operation is instructed to follow symlinks (e.g. via AT_SYMLINK_FOLLOW or lack of AT_SYMLINK_NOFOLLOW), and the final component is such a proc symlink, then the target of

[PULL 09/12] migration/colo.c: Flush ram cache only after receiving device state

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub If we suceed in receiving ram state, but fail receiving the device state, there will be a mismatch between the two. Fix this by flushing the ram cache only after the vmstate has been received. Signed-off-by: Lukas Straub Message-Id:

[PULL 01/12] migration/rdma: fix potential nullptr access in rdma_start_incoming_migration

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan 'rdma' is NULL when taking the first error branch in rdma_start_incoming_migration. And it will cause a null pointer access in label 'err'. Fix that. Fixes: 59c59c67ee6b0327ae932deb303caa47919aeb1e Signed-off-by: Pan Nengyuan Message-Id:

[PULL 00/12] migration/virtiofs/hmp queue

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 7ea32024c6b3ad9c88d6200e73dbf76c8e160024: Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-june-01-2020' into staging (2020-06-01 13:43:59 +0100) are available in the Git repository at:

[PULL 06/12] migration/vmstate: Remove unnecessary MemoryRegion forward declaration

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Philippe Mathieu-Daudé "migration/vmstate.h" only uses pointer to MemoryRegion, which is already forward declared in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200530165512.15225-1-f4...@amsat.org> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David

[PULL 08/12] migration/colo.c: Use cpu_synchronize_all_states()

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Lukas Straub cpu_synchronize_all_pre_loadvm() marks all vcpus as dirty, so the registers are loaded from CPUState before we continue running the vm. However if we failover during checkpoint, CPUState is not initialized and the registers are loaded with garbage. This causes guest hangs and

[PULL 04/12] hmp: Simplify qom-set

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Simplify qom_set by making it use qmp_qom_set and the JSON parser. (qemu) qom-get /machine smm "auto" (qemu) qom-set /machine smm "auto" Signed-off-by: Dr. David Alan Gilbert Message-Id: <20200520151108.160598-3-dgilb...@redhat.com> Reviewed-by: Philippe

[PULL 02/12] migration/rdma: cleanup rdma context before g_free to avoid memleaks

2020-06-01 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan When error happen in initializing 'rdma_return_path', we should cleanup rdma context before g_free(rdma) to avoid some memleaks. This patch fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Message-Id: <20200508100755.7875-3-pannengy...@huawei.com>

[PATCH] tests/acceptance/migration.py: Wait for both sides

2020-05-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When the source finishes migration the destination will still be receiving the data sent by the source, so it might not have quite finished yet, so won't quite have reached 'completed'. This lead to occasional asserts in the next few checks. After the source has

[PATCH 2/2] hmp: Simplify qom_set

2020-05-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Simplify qom_set by making it use qmp_qom_set and the JSON parser. Note that qom-set likes JSON strings quoted with ' not ", e.g.: (qemu) qom-get /machine smm "auto" (qemu) qom-set /machine smm 'auto' Signed-off-by: Dr. David Alan Gilbert ---

[PATCH 1/2] hmp: Implement qom-get HMP command

2020-05-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This started off as Andreas Färber's implementation from March 2015, but after feedback from Paolo and Markus it morphed into using the json output which handles structs reasonably. Use with qom-list to find the members of an object. (qemu) qom-get

[PATCH 0/2] HMP: qom-get and set

2020-05-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" HMP has had a qom-set for a long time, but not a matching qom-get; various attempts have been made to add one over the last 5 years. Here's another go. It's got simpler due to a suggestion by Markus to take the output from qmp's qom-get. While we're here, rework

[PULL 09/12] migration/rdma: fix a memleak on error path in rdma_start_incoming_migration

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan 'rdma->host' is malloced in qemu_rdma_data_init, but forgot to free on the error path in rdma_start_incoming_migration(), this patch fix that. The leak stack: Direct leak of 2 byte(s) in 1 object(s) allocated from: #0 0x7fb7add18ae8 in __interceptor_malloc

[PULL 11/12] migration/multifd: fix memleaks in multifd_new_send_channel_async

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan When error happen in multifd_new_send_channel_async, 'sioc' will not be used to create the multifd_send_thread. Let's free it to avoid a memleak. And also do error_free after migrate_set_error() to avoid another leak in the same place. The leak stack: Direct leak of 2880

[PULL 07/12] migration/throttle: Add cpu-throttle-tailslow migration parameter

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Keqian Zhu At the tail stage of throttling, the Guest is very sensitive to CPU percentage while the @cpu-throttle-increment is excessive usually at tail stage. If this parameter is true, we will compute the ideal CPU percentage used by the Guest, which may exactly make the dirty rate

[PULL 10/12] migration/xbzrle: add encoding rate

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Wei Wang Users may need to check the xbzrle encoding rate to know if the guest memory is xbzrle encoding-friendly, and dynamically turn off the encoding if the encoding rate is low. Signed-off-by: Yi Sun Signed-off-by: Wei Wang Message-Id:

[PULL 08/12] migration/ram: Consolidate variable reset after placement in ram_load_postcopy()

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: David Hildenbrand Let's consolidate resetting the variables. Cc: "Dr. David Alan Gilbert" Cc: Juan Quintela Cc: Peter Xu Signed-off-by: David Hildenbrand Message-Id: <20200421085300.7734-10-da...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert

[PULL 06/12] migration/colo: Add missing error-propagation code

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Philippe Mathieu-Daudé Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./migration/colo.c

[PULL 05/12] docs/devel/migration: start a debugging section

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Marc-André Lureau Explain how to use analyze-migration.py, this may help. Signed-off-by: Marc-André Lureau Message-Id: <20200330174852.456148-1-marcandre.lur...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrangé Signed-off-by: Dr. David Alan Gilbert ---

[PULL 12/12] migration/multifd: Do error_free after migrate_set_error to avoid memleaks

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan When error happen in multifd_send_thread, it use error_copy to set migrate error in multifd_send_terminate_threads(). We should call error_free after it. Similarly, fix another two places in multifd_recv_thread/multifd_save_cleanup. The leak stack: Direct leak of 48 byte(s)

[PULL 04/12] migration: move the units of migrate parameters from milliseconds to ms

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela Message-Id: <474bb6cf67defb8be9de5035c11aee57a680557a.1585641083.git.maozhon...@cmss.chinamobile.com> Reviewed-by: Stefano Garzarella Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 2 +-

[PULL 03/12] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed()

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela Message-Id: <305323f835436023c53d759f5ab18af3ec874183.1585641083.git.maozhon...@cmss.chinamobile.com> Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 5 - 1 file changed, 4 insertions(+), 1

[PULL 02/12] migration/migration: improve error reporting for migrate parameters

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi use QERR_INVALID_PARAMETER_VALUE instead of "Parameter '%s' expects" for consistency. Signed-off-by: Mao Zhongyi Message-Id: <4ce71da4a5f98ad6ead0806ec71043473dcb4c07.1585641083.git.maozhon...@cmss.chinamobile.com> Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan

[PULL 00/12] migration queue

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 3c7adbc67d9a5c3e992a4dd13b8704464daaad5b: Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into staging (2020-05-07 14:30:12 +0100) are available in the Git repository at:

[PULL 01/12] migration: fix bad indentation in error_report()

2020-05-07 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi bad indentation conflicts with CODING_STYLE doc. Signed-off-by: Mao Zhongyi Message-Id: <09f7529c665cac0c6a5e032ac6fdb6ca701f7e37.1585329482.git.maozhon...@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan

[PULL 5/6] virtiofsd: only retain file system capabilities

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi virtiofsd runs as root but only needs a subset of root's Linux capabilities(7). As a file server its purpose is to create and access files on behalf of a client. It needs to be able to access files with arbitrary uid/gid owners. It also needs to be create device nodes.

[PULL 6/6] virtiofsd: drop all capabilities in the wait parent process

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi All this process does is wait for its child. No capabilities are needed. Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 13 + 1 file changed, 13 insertions(+)

[PULL 2/6] virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi The system-wide fs.file-max sysctl value determines how many files can be open. It defaults to a value calculated based on the machine's RAM size. Previously virtiofsd would try to set RLIMIT_NOFILE to 1,000,000 and this allowed the FUSE client to exhaust the number of

[PULL 3/6] virtiofsd: jail lo->proc_self_fd

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Miklos Szeredi While it's not possible to escape the proc filesystem through lo->proc_self_fd, it is possible to escape to the root of the proc filesystem itself through "../..". Use a temporary mount for opening lo->proc_self_fd, that has it's root at /proc/self/fd/, preventing access to

[PULL 0/6] virtiofs queue

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 1c47613588ccff44422d4bdeea0dc36a0a308ec7: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2020-04-30 19:25:41 +0100) are available in the Git repository at: https://gitlab.com/dagrh/qemu.git

[PULL 4/6] virtiofsd: Show submounts

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Max Reitz Currently, setup_mounts() bind-mounts the shared directory without MS_REC. This makes all submounts disappear. Pass MS_REC so that the guest can see submounts again. Fixes: 5baa3b8e95064c2434bd9e2f312edd5e9ae275dc Signed-off-by: Max Reitz Message-Id:

[PULL 1/6] virtiofsd: add --rlimit-nofile=NUM option

2020-05-01 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Make it possible to specify the RLIMIT_NOFILE on the command-line. Users running multiple virtiofsd processes should allocate a certain number to each process so that the system-wide limit can never be exhausted. When this option is set to 0 the rlimit is left at its

[PATCH] serial: Fix double migration data

2020-03-30 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" After c9808d60281 we have both an object representing the serial-isa device and a separate object representing the underlying common serial uart. Both of these have vmsd's associated with them and thus the migration stream ends up with two copies of the migration

[PULL 8/9] migration/ram: fix use after free of local_err

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Vladimir Sementsov-Ogievskiy local_err is used again in migration_bitmap_sync_precopy() after precopy_notify(), so we must zero it. Otherwise try to set non-NULL local_err will crash. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[PULL 6/9] vl.c: fix migration failure for 3.1 and older machine types

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Igor Mammedov Migration from QEMU(v4.0) fails when using 3.1 or older machine type. For example if one attempts to migrate QEMU-2.12 started as qemu-system-ppc64 -nodefaults -M pseries-2.12 -m 4096 -mem-path /tmp/ to current master, it will fail with qemu-system-ppc64: Unknown ramblock

[PULL 3/9] tests/migration: Reduce autoconverge initial bandwidth

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Philippe Mathieu-Daudé When using max-bandwidth=~100Mb/s, this test fails on Travis-CI s390x when configured with --disable-tcg: $ make check-qtest TESTcheck-qtest-s390x: tests/qtest/boot-serial-test qemu-system-s390x: -accel tcg: invalid accelerator tcg qemu-system-s390x:

[PULL 9/9] migration: use "" instead of (null) for tls-authz

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi run: (qemu) info migrate_parameters announce-initial: 50 ms ... announce-max: 550 ms multifd-compression: none xbzrle-cache-size: 4194304 max-postcopy-bandwidth: 0 tls-authz: '(null)' Migration parameter 'tls-authz' is used to provide the QOM ID of a QAuthZ subclass instance

[PULL 4/9] hmp/vnc: Fix info vnc list leak

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We're iterating the list, and then freeing the iteration pointer rather than the list head. Fixes: 0a9667ecdb6d ("hmp: Update info vnc") Reported-by: Coverity (CID 1421932) Signed-off-by: Dr. David Alan Gilbert Message-Id:

[PULL 1/9] hmp-cmd: fix a missing_break warning

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Pan Nengyuan This fix coverity issues 94417686: 1260break; CID 94417686: (MISSING_BREAK) 1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement. 1261case

[PULL 5/9] tools/virtiofsd/passthrough_ll: Fix double close()

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Philippe Mathieu-Daudé On success, the fdopendir() call closes fd. Later on the error path we try to close an already-closed fd. This can lead to use-after-free. Fix by only closing the fd if the fdopendir() call failed. Cc: qemu-sta...@nongnu.org Fixes: b39bce121b (add dirp_map to hide

[PULL 0/9] migration queue

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 736cf607e40674776d752acc201f565723e86045: Update version for v5.0.0-rc0 release (2020-03-24 17:50:00 +) are available in the Git repository at: git://github.com/dagrh/qemu.git tags/pull-migration-20200325b for you to

[PULL 2/9] xbzrle: update xbzrle doc

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Mao Zhongyi Add new parameter description, also: 1. Remove unsociable space. 2. Nit picking: s/two/2 in report Signed-off-by: Mao Zhongyi Message-Id: <20200320143216.423374-1-maozhon...@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert ---

[PULL 7/9] migration/colo: fix use after free of local_err

2020-03-25 Thread Dr. David Alan Gilbert (git)
From: Vladimir Sementsov-Ogievskiy local_err is used again in secondary_vm_do_failover() after replication_stop_all(), so we must zero it. Otherwise try to set non-NULL local_err will crash. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[PATCH] hmp/vnc: Fix info vnc list leak

2020-03-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We're iterating the list, and then freeing the iteration pointer rather than the list head. Fixes: 0a9667ecdb6d ("hmp: Update info vnc") Reported-by: Coverity (CID 1421932) Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 5 +++-- 1 file changed, 3

[PATCH] vl.c/memdev: Error on bad memory backend

2020-03-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If memory-backend is a non-existent object, qemu crashes. Check that the backend actually resolves. e.g. ./qemu-system-x86_64 -machine pc,accel=kvm,memory-backend=foo Signed-off-by: Dr. David Alan Gilbert --- softmmu/vl.c | 5 + 1 file changed, 5

[PATCH v2] exec/rom_reset: Free rom data during inmigrate skip

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Commit 355477f8c73e9 skips rom reset when we're an incoming migration so as not to overwrite shared ram in the ignore-shared migration optimisation. However, it's got an unexpected side effect that because it skips freeing the ROM data, when rom_reset gets called

[PATCH] exec/rom_reset: Free rom data during inmigrate skip

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Commit 355477f8c73e9 skips rom reset when we're an incoming migration so as not to overwrite shared ram in the ignore-shared migration optimisation. However, it's got an unexpected side effect that because it skips freeing the ROM data, when rom_reset gets called

[PULL 5/5] migration: recognize COLO as part of activating process

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang We will migrate parts of dirty pages backgroud lively during the gap time of two checkpoints, without this modification, it will not work because ram_save_iterate() will check it before send RAM_SAVE_FLAG_EOS at the end of it. Signed-off-by: zhanghailiang Message-Id:

[PULL 4/5] ram/colo: only record bitmap of dirty pages in COLO stage

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang It is only need to record bitmap of dirty pages while goes into COLO stage. Signed-off-by: zhanghailiang Message-Id: <20200224065414.36524-6-zhang.zhanghaili...@huawei.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 9

[PULL 3/5] COLO: Optimize memory back-up process

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: zhanghailiang This patch will reduce the downtime of VM for the initial process, Previously, we copied all these memory in preparing stage of COLO while we need to stop VM, which is a time-consuming process. Here we optimize it by a trick, back-up every page while in migration process

[PULL 1/5] configure: Improve zstd test

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: Juan Quintela There were one error on the test (missing an s for --exists). But we really need a recent zstd (1.4.0). Thanks to Michal Privoznik to provide the right vension. Signed-off-by: Juan Quintela Reported-by: Richard Henderson Message-Id:

[PULL 2/5] migration/throttle: Add throttle-trig-thres migration parameter

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: Keqian Zhu Currently, if the bytes_dirty_period is more than the 50% of bytes_xfer_period, we start or increase throttling. If we make this percentage higher, then we can tolerate higher dirty rate during migration, which means less impact on guest. The side effect of higher percentage is

[PULL 0/5] migration queue

2020-03-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit d4f7d56759f7c75270c13d5f3f5f736a9558929c: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200312' into staging (2020-03-12 17:34:34 +) are available in the Git repository at:

[PULL 12/12] net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove'

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Thomas Huth It's been deprecated since QEMU v3.1.0. Time to finally remove it now. Signed-off-by: Thomas Huth Message-Id: <20191205104109.18680-1-th...@redhat.com> Signed-off-by: Dr. David Alan Gilbert Reworked Thomas's deprecated.texi to the rst --- docs/system/deprecated.rst | 15

[PULL 10/12] monitor/hmp: move hmp_info_block* to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-11-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 389 + include/block/block-hmp-cmds.h |

[PULL 08/12] monitor/hmp: move hmp_nbd_server* to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-9-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 101 + include/block/block-hmp-cmds.h |

[PULL 05/12] monitor/hmp: move hmp_drive_mirror and hmp_drive_backup to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Moved code was added after 2012-01-13, thus under GPLv2+ Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-6-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert Fixed commit message ---

[PULL 09/12] monitor/hmp: move remaining hmp_block* functions to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-10-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 140 + include/block/block-hmp-cmds.h |

[PULL 04/12] monitor/hmp: move hmp_drive_del and hmp_commit to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-5-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 108 - blockdev.c |

[PULL 02/12] monitor/hmp: inline add_init_drive

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky This function is only used by hmp_drive_add. The code is just a bit shorter this way. No functional changes Signed-off-by: Maxim Levitsky Reviewed-by: Markus Armbruster Message-Id: <20200308092440.23564-3-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert ---

[PULL 07/12] monitor/hmp: move hmp_snapshot_* to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky hmp_snapshot_blkdev is from GPLv2 version of the hmp-cmds.c thus have to change the licence to GPLv2 Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-8-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert ---

[PULL 06/12] monitor/hmp: move hmp_block_job* to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-7-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 52 ++ include/block/block-hmp-cmds.h |

[PULL 11/12] monitor/hmp: Move hmp_drive_add_node to block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200308092440.23564-12-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- block/monitor/block-hmp-cmds.c | 30 blockdev.c | 43

[PULL 00/12] hmp queue

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506: qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +) are available in the Git repository at: git://github.com/dagrh/qemu.git tags/pull-hmp-20200309 for you to fetch

[PULL 03/12] monitor/hmp: rename device-hotplug.c to block/monitor/block-hmp-cmds.c

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky These days device-hotplug.c only contains the hmp_drive_add In the next patch, rest of hmp_drive* functions will be moved there. Also add block-hmp-cmds.h to contain prototypes of these functions License for block-hmp-cmds.h since it contains the code moved from sysemu.h

[PULL 01/12] usb/dev-storage: remove unused include

2020-03-09 Thread Dr. David Alan Gilbert (git)
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200308092440.23564-2-mlevi...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- hw/usb/dev-storage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/dev-storage.c

[PULL 2/2] virtiofsd: Fix xattr operations

2020-03-03 Thread Dr. David Alan Gilbert (git)
From: Misono Tomohiro Current virtiofsd has problems about xattr operations and they does not work properly for directory/symlink/special file. The fundamental cause is that virtiofsd uses openat() + f...xattr() systemcalls for xattr operation but we should not open symlink/special file in the

[PULL 1/2] virtiofsd: passthrough_ll: cleanup getxattr/listxattr

2020-03-03 Thread Dr. David Alan Gilbert (git)
From: Misono Tomohiro This is a cleanup patch to simplify the following xattr fix and there is no functional changes. - Move memory allocation to head of the function - Unify fgetxattr/flistxattr call for both size == 0 and size != 0 case - Remove redundant lo_inode_put call in error path

[PULL 0/2] virtiofs queue

2020-03-03 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 104933c4a973960dea605b06fcd5d0d478255d77: Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2020-03-03 12:03:59 +) are available in the Git repository at:

[PULL 6/6] docs: Fix virtiofsd.1 location

2020-02-21 Thread Dr. David Alan Gilbert (git)
From: Miroslav Rezanina Patch 6a7e2bbee5 docs: add virtiofsd(1) man page introduced new man page virtiofsd.1. Unfortunately, wrong file location is used as source for install command. This cause installation of docs fail. Fixing wrong location so installation is successful. Signed-off-by:

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