Re: [RFC PATCH 0/1] Removing RAMBlocks during migration

2020-01-13 Thread Yury Kotov
Hi! 07.01.2020, 23:08, "Michael S. Tsirkin" : > On Fri, Jan 03, 2020 at 11:44:27AM +, Dr. David Alan Gilbert wrote: >>  > 1) Guest: writes to slot's pci config >>  > 2) QEMU: pcie_cap_slot_write_config -> pcie_unplug_device >>  > >>  > So, it's only guest driven action and qdev_unplug doesn't

[RFC PATCH] pcie: Defer hot unplug until migration is complete

2020-01-13 Thread Yury Kotov
off-by: Yury Kotov --- hw/pci-bridge/gen_pcie_root_port.c | 7 hw/pci-bridge/ioh3420.c| 7 hw/pci-bridge/xio3130_downstream.c | 7 hw/pci/pcie.c | 54 +++--- hw/pci/pcie_port.c |

Re: [PATCH 0/2] Speed up QMP stream reading

2019-12-23 Thread Yury Kotov
Hi! 20.12.2019, 19:09, "Markus Armbruster" : > Yury Kotov writes: > >> Hi, >> >> This series is continuation of another one: >> [PATCH] monitor: Fix slow reading >> https://lists.gnu.org/archive/html/qemu-devel/2019-11/msg03722.html >>

Re: [RFC PATCH 0/1] Removing RAMBlocks during migration

2019-12-23 Thread Yury Kotov
Hi! 11.12.2019, 14:17, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  Hi, >> >>  I found that it's possible to remove a RAMBlock during migration. >>  E.g. device hot-unplugging initiated by a guest (how to reproduce is belo

[PATCH 1/2] monitor: Split monitor_can_read for QMP and HMP

2019-12-19 Thread Yury Kotov
This patch itself doesn't make sense, it is needed for the next patch. Signed-off-by: Yury Kotov --- monitor/hmp.c | 7 +++ monitor/monitor-internal.h | 1 - monitor/monitor.c | 7 --- monitor/qmp.c | 11 +-- 4 files changed, 16 insertions

[PATCH 0/2] Speed up QMP stream reading

2019-12-19 Thread Yury Kotov
/qemu-devel/2019-11/msg05018.html This series is an attempt to fix problems described. Regards, Yury Yury Kotov (2): monitor: Split monitor_can_read for QMP and HMP monitor: Add an input buffer for QMP reading monitor/hmp.c | 7 +++ monitor/monitor-internal.h | 12

[PATCH 2/2] monitor: Add an input buffer for QMP reading

2019-12-19 Thread Yury Kotov
of the main loop are required to handle a command. This patch adds an input buffer to speed up reading and to keep the guarantee of executing one command at a time. Signed-off-by: Yury Kotov --- monitor/monitor-internal.h | 11 +++ monitor/monitor.c | 27

[RFC PATCH 1/1] migration: Remove vmstate_unregister_ram

2019-12-08 Thread Yury Kotov
of this function are just before MemoryRegion deletion. Thus, there is no effect of this function actually. Signed-off-by: Yury Kotov --- hw/block/pflash_cfi01.c | 1 - hw/block/pflash_cfi02.c | 1 - hw/mem/pc-dimm.c| 5 - hw/misc/ivshmem.c | 2 -- hw/pci/pci.c

[RFC PATCH 0/1] Removing RAMBlocks during migration

2019-12-08 Thread Yury Kotov
ns for removing RAMBlock. Regards, Yury Yury Kotov (1): migration: Remove vmstate_unregister_ram hw/block/pflash_cfi01.c | 1 - hw/block/pflash_cfi02.c | 1 - hw/mem/pc-dimm.c| 5 - hw/misc/ivshmem.c | 2 -- hw/pci/pci.c| 1 - include/migration/vm

Re: [PATCH] monitor: Fix slow reading

2019-12-03 Thread Yury Kotov
02.12.2019, 23:50, "Markus Armbruster" : > Yury Kotov writes: > >>  Hi! >> >>  29.11.2019, 11:22, "Markus Armbruster" : >>>  Yury Kotov writes: >>> >>>>   The monitor_can_read (as a callback of qemu_chr_fe_set_handlers)

Re: [PATCH] monitor: Fix slow reading

2019-12-02 Thread Yury Kotov
Hi! 29.11.2019, 11:22, "Markus Armbruster" : > Yury Kotov writes: > >>  The monitor_can_read (as a callback of qemu_chr_fe_set_handlers) >>  should return size of buffer which monitor_qmp_read or monitor_read >>  can process. >>  Currently, monitor_c

[PATCH v2] migration/ram: Yield periodically to the main loop

2019-11-25 Thread Yury Kotov
and for instance, it doesn't respond to QMP commands. For this case, yield periodically, but not too often, so as not to affect the speed of migration. Signed-off-by: Yury Kotov --- migration/ram.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration

[PATCH] migration/ram: Yield periodically to the main loop

2019-11-25 Thread Yury Kotov
, it doesn't respond to QMP commands. For this case, yield periodically, but not too often, so as not to affect the speed of migration. Signed-off-by: Yury Kotov --- migration/ram.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c

[PATCH] monitor: Fix slow reading

2019-11-22 Thread Yury Kotov
to handle a command. In fact, these both functions can process any buffer size. So, return 1024 as a reasonable size which is enough to process the most QMP commands, but not too big to block the main loop for a long time. Signed-off-by: Yury Kotov --- monitor/monitor.c | 9 - 1 file changed, 8

[PATCH] monitor: Remove unused define

2019-11-19 Thread Yury Kotov
Remove the definition of QMP_ACCEPT_UNKNOWNS as it is unused since refactoring 5c678ee8d940 Signed-off-by: Yury Kotov --- monitor/misc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/monitor/misc.c b/monitor/misc.c index 3baa15f3bf..6680734ea1 100644 --- a/monitor/misc.c +++ b/monitor

[PATCH] migration: Fix the re-run check of the migrate-incoming command

2019-11-13 Thread Yury Kotov
The current check sets an error but doesn't fail the command. This may cause a problem if new connection attempt by the same URI affects the first connection. Signed-off-by: Yury Kotov --- migration/migration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/migration.c b

Re: [Qemu-devel] [PULL v2 00/29] Misc patches for 2019-09-16

2019-09-17 Thread Yury Kotov
(5): >   exec.c: replace hwaddr with uint64_t for better understanding >   exec.c: get nodes_nb_alloc with one MAX calculation >   exec.c: subpage->sub_section is already initialized to 0 >   exec.c: correct the maximum skip value during compact >   exec.c: add a c

Re: [Qemu-devel] [PATCH] migration: Fix use-after-free during process exit

2019-09-13 Thread Yury Kotov
Hi Vladimir! 13.09.2019, 16:43, "Vladimir Sementsov-Ogievskiy" : > Hi! > > 08.04.2019 14:33, Yury Kotov wrote: >>  It fixes heap-use-after-free which was found by clang's ASAN. >> >>  Control flow of this use-after-free: >>  main_thread: >

Re: [Qemu-devel] [PATCH v6 0/3] High downtime with 95+ throttle pct

2019-09-09 Thread Yury Kotov
nzini" : > On 09/09/19 12:49, Yury Kotov wrote: >>  Hi, >> >>  V6: >>  * Fix "Add qemu_cond_timedwait" patch: >>    - Changed return type for qemu_cond_timedwait (void -> bool) >>    - Added details in commit message >> >>  V5: &

[Qemu-devel] [PATCH v7 0/3] High downtime with 95+ throttle pct

2019-09-09 Thread Yury Kotov
tle_thread() function sleeps for 100ms+ for high throttle percentage (>=95%) in VCPU thread. And it sleeps even after a cpu kick. Fixed it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwai

[Qemu-devel] [PATCH v7 3/3] tests/migration: Add a test for auto converge

2019-09-09 Thread Yury Kotov
Signed-off-by: Yury Kotov Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 130 + 1 file changed, 119 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index a9f81cc185..966d458d72 100644

[Qemu-devel] [PATCH v7 2/3] cpus: Fix throttling during vm_stop

2019-09-09 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov Reviewed-by: Eric Blake --- cpus.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 85cd451a86

[Qemu-devel] [PATCH v7 1/3] qemu-thread: Add qemu_cond_timedwait

2019-09-09 Thread Yury Kotov
-by: Yury Kotov --- include/qemu/thread.h| 19 +++ util/qemu-thread-posix.c | 41 util/qemu-thread-win32.c | 17 + util/qsp.c | 20 4 files changed, 85 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH v6 1/3] qemu-thread: Add qemu_cond_timedwait

2019-09-09 Thread Yury Kotov
-by: Yury Kotov --- include/qemu/thread.h| 19 +++ util/qemu-thread-posix.c | 41 util/qemu-thread-win32.c | 17 + util/qsp.c | 20 4 files changed, 85 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH v6 3/3] tests/migration: Add a test for auto converge

2019-09-09 Thread Yury Kotov
Signed-off-by: Yury Kotov Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 120 + 1 file changed, 109 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index a9f81cc185..7064b341e7 100644

[Qemu-devel] [PATCH v6 2/3] cpus: Fix throttling during vm_stop

2019-09-09 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov Reviewed-by: Eric Blake --- cpus.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 85cd451a86

[Qemu-devel] [PATCH v6 0/3] High downtime with 95+ throttle pct

2019-09-09 Thread Yury Kotov
gh throttle percentage (>=95%) in VCPU thread. And it sleeps even after a cpu kick. Fixed it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop tests

[Qemu-devel] [PATCH v2 0/3] UUID validation during migration

2019-09-03 Thread Yury Kotov
validate-uuid only affects the source so that it sends its UUID to the target. The target will validate the received UUID and stop the migration if UUIDs are not equal. Regards, Yury Yury Kotov (3): migration: Add validate-uuid capability tests/libqtest: Allow setting expected exit status tests

[Qemu-devel] [PATCH v2 3/3] tests/migration: Add a test for validate-uuid capability

2019-09-03 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/migration-test.c | 140 - 1 file changed, 110 insertions(+), 30 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index b87ba99a9e..524caf773f 100644 --- a/tests/migration-test.c +++ b/tests

[Qemu-devel] [PATCH v2 2/3] tests/libqtest: Allow setting expected exit status

2019-09-03 Thread Yury Kotov
Add qtest_set_expected_status function to set expected exit status of child process. By default expected exit status is 0. Signed-off-by: Yury Kotov --- tests/libqtest.c | 36 +--- tests/libqtest.h | 9 + 2 files changed, 30 insertions(+), 15 deletions

Re: [Qemu-devel] [PATCH 1/3] migration: Add x-validate-uuid capability

2019-09-03 Thread Yury Kotov
03.09.2019, 14:25, "Dr. David Alan Gilbert" : > * Eric Blake (ebl...@redhat.com) wrote: >>  On 8/27/19 10:36 AM, Yury Kotov wrote: >>  > 27.08.2019, 17:02, "Eric Blake" : >>  >> On 8/27/19 7:02 AM, Yury Kotov wrote: >>  >>>  This ca

[Qemu-devel] [PATCH v2 1/3] migration: Add validate-uuid capability

2019-09-03 Thread Yury Kotov
This capability realizes simple source validation by UUID. It's useful for live migration between hosts. Signed-off-by: Yury Kotov --- migration/migration.c | 9 + migration/migration.h | 1 + migration/savevm.c| 45 +++ qapi/migration.json

Re: [Qemu-devel] [PATCH 2/3] tests/libqtest: Allow to set expected exit status

2019-08-27 Thread Yury Kotov
27.08.2019, 17:04, "Eric Blake" : > On 8/27/19 7:02 AM, Yury Kotov wrote: > > In the subject: 'Allow to $verb' is not idiomatic; either 'Allow > $subject to $verb' or 'Allow ${verb}ing' sound better. In this case, > I'd go with: > > tests/libqtest: Allow setting exp

Re: [Qemu-devel] [PATCH 2/3] tests/libqtest: Allow to set expected exit status

2019-08-27 Thread Yury Kotov
27.08.2019, 16:53, "Marc-André Lureau" : > Hi > > On Tue, Aug 27, 2019 at 4:09 PM Yury Kotov wrote: >>  Add qtest_set_expected_status function to set expected exit status of >>  child process. By default expected exit status is 0. >> >>  Signed-off-by

Re: [Qemu-devel] [PATCH 1/3] migration: Add x-validate-uuid capability

2019-08-27 Thread Yury Kotov
27.08.2019, 17:02, "Eric Blake" : > On 8/27/19 7:02 AM, Yury Kotov wrote: >>  This capability realizes simple source validation by UUID. >>  It's useful for live migration between hosts. >> >>  Signed-off-by: Yury Kotov >>  --- >>   migration/mig

[Qemu-devel] [PATCH 2/3] tests/libqtest: Allow to set expected exit status

2019-08-27 Thread Yury Kotov
Add qtest_set_expected_status function to set expected exit status of child process. By default expected exit status is 0. Signed-off-by: Yury Kotov --- tests/libqtest.c | 14 +++--- tests/libqtest.h | 9 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests

[Qemu-devel] [PATCH 3/3] tests/migration: Add a test for x-validate-uuid capability

2019-08-27 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/migration-test.c | 140 - 1 file changed, 110 insertions(+), 30 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index b87ba99a9e..adac1c01a2 100644 --- a/tests/migration-test.c +++ b/tests

[Qemu-devel] [PATCH 1/3] migration: Add x-validate-uuid capability

2019-08-27 Thread Yury Kotov
This capability realizes simple source validation by UUID. It's useful for live migration between hosts. Signed-off-by: Yury Kotov --- migration/migration.c | 9 + migration/migration.h | 1 + migration/savevm.c| 45 +++ qapi/migration.json

[Qemu-devel] [PATCH 0/3] UUID validation during migration

2019-08-27 Thread Yury Kotov
the received UUID and stop the migration if UUIDs are not equal. Regards, Yury Yury Kotov (3): migration: Add x-validate-uuid capability tests/libqtest: Allow to set expected exit status tests/migration: Add a test for x-validate-uuid capability migration/migration.c | 9 +++ migration

Re: [Qemu-devel] [PATCH v5 3/3] tests/migration: Add a test for auto converge

2019-08-26 Thread Yury Kotov
David, I kept your Reviewed-by, but could you take another look at the test? I've made many changes in it. Thanks! 26.08.2019, 13:39, "Yury Kotov" : > Signed-off-by: Yury Kotov > Reviewed-by: Dr. David Alan Gilbert > --- >  tests/

[Qemu-devel] [PATCH v5 2/3] cpus: Fix throttling during vm_stop

2019-08-26 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov --- cpus.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 85cd451a86..d2c61ff155 100644 --- a/cpus.c

[Qemu-devel] [PATCH v5 1/3] qemu-thread: Add qemu_cond_timedwait

2019-08-26 Thread Yury Kotov
Signed-off-by: Yury Kotov --- include/qemu/thread.h| 18 ++ util/qemu-thread-posix.c | 40 util/qemu-thread-win32.c | 16 util/qsp.c | 18 ++ 4 files changed, 80 insertions(+), 12

[Qemu-devel] [PATCH v5 3/3] tests/migration: Add a test for auto converge

2019-08-26 Thread Yury Kotov
Signed-off-by: Yury Kotov Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 120 + 1 file changed, 109 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index b87ba99a9e..e5caf93dfa 100644

[Qemu-devel] [PATCH v5 0/3] High downtime with 95+ throttle pct

2019-08-26 Thread Yury Kotov
ond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop tests/migration: Add a test for auto converge cpus.c | 25 +--- include/qemu/thread.h| 18 ++ tests/migrat

Re: [Qemu-devel] [PATCH v4 0/3] High downtime with 95+ throttle pct

2019-08-23 Thread Yury Kotov
Hi, 19.08.2019, 20:11, "Paolo Bonzini" : > On 19/08/19 18:39, Paolo Bonzini wrote: >>  On 15/08/19 11:13, Yury Kotov wrote: >>>  Ping ping >> >>  Hi, >> >>  sorry for the delay, I was waiting for the 4.1 release. >> >>  I w

Re: [Qemu-devel] [PATCH v4 0/3] High downtime with 95+ throttle pct

2019-08-15 Thread Yury Kotov
Ping ping 07.08.2019, 10:42, "Yury Kotov" : > Ping > > 23.07.2019, 16:42, "Yury Kotov" : >>  Hi, >> >>  V4: >>  * The test was simplified to prevent false fails. >> >>  V3: >>  * Rebase fixes (migrate_set_parameter

Re: [Qemu-devel] [PATCH v4 0/3] High downtime with 95+ throttle pct

2019-08-07 Thread Yury Kotov
Ping 23.07.2019, 16:42, "Yury Kotov" : > Hi, > > V4: > * The test was simplified to prevent false fails. > > V3: > * Rebase fixes (migrate_set_parameter -> migrate_set_parameter_int) > > V2: > * Added a test > * Fixed qemu_cond_timedwait for qsp

[Qemu-devel] [PATCH v4 3/3] tests/migration: Add a test for auto converge

2019-07-23 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/migration-test.c | 103 - 1 file changed, 92 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index a4feb9545d..b783ae47b3 100644 --- a/tests/migration-test.c +++ b/tests

[Qemu-devel] [PATCH v4 1/3] qemu-thread: Add qemu_cond_timedwait

2019-07-23 Thread Yury Kotov
Signed-off-by: Yury Kotov --- include/qemu/thread.h| 18 ++ util/qemu-thread-posix.c | 40 util/qemu-thread-win32.c | 16 util/qsp.c | 18 ++ 4 files changed, 80 insertions(+), 12

[Qemu-devel] [PATCH v4 2/3] cpus: Fix throttling during vm_stop

2019-07-23 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov --- cpus.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 927a00aa90..3baedd554c 100644

[Qemu-devel] [PATCH v4 0/3] High downtime with 95+ throttle pct

2019-07-23 Thread Yury Kotov
read() function sleeps for 100ms+ for high throttle percentage (>=95%) in VCPU thread. And it sleeps even after a cpu kick. Fixed it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cp

Re: [Qemu-devel] [PATCH v3 3/3] tests/migration: Add a test for auto converge

2019-07-23 Thread Yury Kotov
22.07.2019, 20:35, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  Signed-off-by: Yury Kotov > > This looks OK to me, but have you tried it on a really really overloaded > host? > I worry that you might skip some of the percentage s

[Qemu-devel] [PATCH v3 3/3] tests/migration: Add a test for auto converge

2019-07-18 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/migration-test.c | 119 + 1 file changed, 108 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index a4feb9545d..bb69517fc8 100644 --- a/tests/migration-test.c +++ b/tests

[Qemu-devel] [PATCH v3 1/3] qemu-thread: Add qemu_cond_timedwait

2019-07-18 Thread Yury Kotov
Signed-off-by: Yury Kotov --- include/qemu/thread.h| 18 ++ util/qemu-thread-posix.c | 40 util/qemu-thread-win32.c | 16 util/qsp.c | 18 ++ 4 files changed, 80 insertions(+), 12

[Qemu-devel] [PATCH v3 0/3] High downtime with 95+ throttle pct

2019-07-18 Thread Yury Kotov
ercentage (>=95%) in VCPU thread. And it sleeps even after a cpu kick. Fixed it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop tests/migration: A

[Qemu-devel] [PATCH v3 2/3] cpus: Fix throttling during vm_stop

2019-07-18 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov --- cpus.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 927a00aa90..3baedd554c 100644

Re: [Qemu-devel] [PATCH] migration: Add error_desc for file channel errors

2019-07-17 Thread Yury Kotov
Hi, I'm a bit worried that this patch might have been forgotten. Is it queued? Thanks! 14.06.2019, 19:56, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  Currently, there is no information about error if outgoing migration was >> f

[Qemu-devel] [PATCH v2 1/3] qemu-thread: Add qemu_cond_timedwait

2019-07-16 Thread Yury Kotov
Signed-off-by: Yury Kotov --- include/qemu/thread.h| 18 ++ util/qemu-thread-posix.c | 40 util/qemu-thread-win32.c | 16 util/qsp.c | 18 ++ 4 files changed, 80 insertions(+), 12

[Qemu-devel] [PATCH v2 3/3] tests/migration: Add a test for auto converge

2019-07-16 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/migration-test.c | 119 + 1 file changed, 108 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index e0407576cb..8a755dfaf2 100644 --- a/tests/migration-test.c +++ b/tests

[Qemu-devel] [PATCH v2 2/3] cpus: Fix throttling during vm_stop

2019-07-16 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov --- cpus.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index ffc57119ca..c8817c9da7 100644

[Qemu-devel] [PATCH v2 0/3] High downtime with 95+ throttle pct

2019-07-16 Thread Yury Kotov
I tried to fix it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop tests/migration: Add a test for auto converge cpus.c | 27 ++--

Re: [Qemu-devel] [RFC PATCH 2/2] cpus: Fix throttling during vm_stop

2019-07-15 Thread Yury Kotov
15.07.2019, 14:00, "Paolo Bonzini" : > On 15/07/19 11:40, Yury Kotov wrote: >>  Hi, >> >>  10.07.2019, 12:26, "Yury Kotov" : >>>  Throttling thread sleeps in VCPU thread. For high throttle percentage >>>  this sleep is more than 10ms. E.g

Re: [Qemu-devel] [RFC PATCH 2/2] cpus: Fix throttling during vm_stop

2019-07-15 Thread Yury Kotov
Hi, 10.07.2019, 12:26, "Yury Kotov" : > Throttling thread sleeps in VCPU thread. For high throttle percentage > this sleep is more than 10ms. E.g. for 60% - 15ms, for 99% - 990ms. > vm_stop() kicks all VCPUs and waits for them. It's called at the end of > migration and bec

Re: [Qemu-devel] [RFC PATCH 0/2] High downtime with 95+ throttle pct

2019-07-10 Thread Yury Kotov
10.07.2019, 12:57, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  Hi, >> >>  I wrote a test for migration auto converge and found out a strange thing: >>  1. Enable auto converge >>  2. Set max-bandwidth 1Gb/s >>  3

[Qemu-devel] [RFC PATCH 2/2] cpus: Fix throttling during vm_stop

2019-07-10 Thread Yury Kotov
even for downtime-limit 1ms. Use qemu_cond_timedwait for high percentage to wake up during vm_stop. Signed-off-by: Yury Kotov --- cpus.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index ffc57119ca..3c069cdc33 100644

[Qemu-devel] [RFC PATCH 0/2] High downtime with 95+ throttle pct

2019-07-10 Thread Yury Kotov
mutex_lock_func function which could be anything. This is why the series is RFC. What do you think? Thanks! Yury Kotov (2): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop cpus.c | 27 +++ include/qemu/thread.h| 12

[Qemu-devel] [RFC PATCH 1/2] qemu-thread: Add qemu_cond_timedwait

2019-07-10 Thread Yury Kotov
Signed-off-by: Yury Kotov --- include/qemu/thread.h| 12 util/qemu-thread-posix.c | 40 util/qemu-thread-win32.c | 16 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/include/qemu/thread.h b/include/qemu

[Qemu-devel] Question about bdrv_co_invalidate_cache

2019-07-01 Thread Yury Kotov
Hi, I just want to clarify the purpose of bdrv_co_invalidate_cache callback. IIUC on of the purposes of this callback is to "activate" BDRV (opposite of the bdrv_inactivate callback) on migration end, right? E.g, if we have a custom BDRV which is backed by some network block storage with

[Qemu-devel] [PATCH] kvm-all: Add/update fprintf's for kvm_*_ioeventfd_del

2019-06-07 Thread Yury Kotov
Signed-off-by: Yury Kotov --- accel/kvm/kvm-all.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 524c4ddfbd..e4ac3386cb 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -864,8 +864,8 @@ static void

Re: [Qemu-devel] [PATCH] migration: Add error_desc for file channel errors

2019-06-07 Thread Yury Kotov
Ping 22.04.2019, 13:50, "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&qu

[Qemu-devel] [PATCH v2 0/2] Deferred incoming migration through fd

2019-05-28 Thread Yury Kotov
uot;fd:" protocol expects an integer, not the name of fd. Yury Kotov (2): migration: Fix fd protocol for incoming defer migration-test: Add a test for fd protocol migration/fd.c | 8 ++-- migration/fd.h | 2 +- tests/libqtest.c | 80 +++

[Qemu-devel] [PATCH v2 1/2] migration: Fix fd protocol for incoming defer

2019-05-28 Thread Yury Kotov
. To work with getfd in incoming defer it's enough to use monitor_fd_param instead of strtol. monitor_fd_param supports both cases: * fd:123 * fd:fd_name (added by getfd). And also the use of monitor_fd_param improves error messages. Signed-off-by: Yury Kotov Reviewed-by: Juan Quintela ---

[Qemu-devel] [PATCH v2 2/2] migration-test: Add a test for fd protocol

2019-05-28 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/libqtest.c | 80 ++-- tests/libqtest.h | 51 - tests/migration-test.c | 101 + 3 files changed, 227 insertions(+), 5 deletions(-) diff --git a/tests

Re: [Qemu-devel] [PATCH 2/2] migration-test: Add a test for fd protocol

2019-05-27 Thread Yury Kotov
27.05.2019, 12:35, "Yury Kotov" : > Signed-off-by: Yury Kotov > --- >  tests/libqtest.c | 83 ++-- >  tests/libqtest.h | 51 +++- >  tests/migration-test.c | 107 +++-- >  3 files c

[Qemu-devel] [PATCH 2/2] migration-test: Add a test for fd protocol

2019-05-27 Thread Yury Kotov
Signed-off-by: Yury Kotov --- tests/libqtest.c | 83 ++-- tests/libqtest.h | 51 +++- tests/migration-test.c | 107 +++-- 3 files changed, 233 insertions(+), 8 deletions(-) diff --git a/tests

[Qemu-devel] [PATCH 1/2] migration: Fix fd protocol for incoming defer

2019-05-27 Thread Yury Kotov
. To work with getfd in incoming defer it's enough to use monitor_fd_param instead of strtol. monitor_fd_param supports both cases: * fd:123 * fd:fd_name (added by getfd). Signed-off-by: Yury Kotov --- migration/fd.c | 8 +--- migration/fd.h | 2 +- 2 files changed, 6 insertions(+), 4

[Qemu-devel] [PATCH 0/2] Deferred incoming migration through fd

2019-05-27 Thread Yury Kotov
uot;) 4. Source VM: getfd("fd-mig") 5. Source VM: migrate("fd-mig") Currently, it's not possible to do the step 3, because for incoming migration "fd:" protocol expects an integer, not the name of fd. Yury Kotov (2): migration: Fix fd protocol for incoming defer

Re: [Qemu-devel] [PATCH v3] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-27 Thread Yury Kotov
Ping 23.05.2019, 12:45, "Yury Kotov" : > monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() > return mon_fdset->id which is int64_t. Downcasting from int64_t to int > leads to a bug with removing fd from fdset with id >= 2^32. > So, fix return types fo

[Qemu-devel] [PATCH v3] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-23 Thread Yury Kotov
monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() return mon_fdset->id which is int64_t. Downcasting from int64_t to int leads to a bug with removing fd from fdset with id >= 2^32. So, fix return types for these function. Signed-off-by: Yury Kotov Reviewed-by: Markus Armb

Re: [Qemu-devel] [PATCH v2] monitor: Fix fdset_id & fd types for corresponding QMP commands

2019-05-23 Thread Yury Kotov
22.05.2019, 19:40, "Markus Armbruster" : > Yury Kotov writes: > >>  Now, fdset_id is int64, but in some places we work with it as int. >>  It seems that there is no sense to use int64 for fdset_id, so it's >>  better to fix inconsistency by changing fdse

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-05-21 Thread Yury Kotov
Ping 14.05.2019, 12:36, "Yury Kotov" : > Ping > > 18.04.2019, 20:46, "Yury Kotov" : >>  18.04.2019, 20:01, "Dr. David Alan Gilbert" : >>>   * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>>>    18.04.2019, 19:03, "Dr.

Re: [Qemu-devel] [PATCH v2] monitor: Fix fdset_id & fd types for corresponding QMP commands

2019-05-21 Thread Yury Kotov
Ping 14.05.2019, 18:20, "Yury Kotov" : > Now, fdset_id is int64, but in some places we work with it as int. > It seems that there is no sense to use int64 for fdset_id, so it's > better to fix inconsistency by changing fdset_id type to int and by > fixing the referenc

Re: [Qemu-devel] [RFC PATCH] QEMU may write to system_memory before guest starts

2019-05-20 Thread Yury Kotov
ses in > the future? > > On Tue, May 14, 2019 at 12:42:14PM +0300, Yury Kotov wrote: >>  Ping ping >> >>  17.04.2019, 15:46, "Yury Kotov" : >>  > Ping >>  > >>  > 04.04.2019, 13:01, "Yury Kotov" : >>  >>  I s

[Qemu-devel] [PATCH v2] monitor: Fix fdset_id & fd types for corresponding QMP commands

2019-05-14 Thread Yury Kotov
-by: Yury Kotov --- include/monitor/monitor.h | 6 +++--- monitor.c | 18 +- qapi/misc.json| 10 +- stubs/fdset.c | 4 ++-- util/osdep.c | 4 ++-- vl.c | 2 +- 6 files changed, 22 insertions

Re: [Qemu-devel] [Qemu-trivial] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
14.05.2019, 17:01, "Markus Armbruster" : > Yury Kotov writes: > >>  monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() >>  returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads >> to > > Grammar nits: > >  

Re: [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
14.05.2019, 17:05, "Eric Blake" : > On 5/14/19 8:15 AM, Yury Kotov wrote: >>  monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() >>  returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads >> to >>  a bug with removing fd

[Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to a bug with removing fd from fdset which id >= 2^32. So, fix return types for these function. Signed-off-by: Yury Kotov --- include/monitor/mon

Re: [Qemu-devel] [RFC PATCH] QEMU may write to system_memory before guest starts

2019-05-14 Thread Yury Kotov
Ping ping 17.04.2019, 15:46, "Yury Kotov" : > Ping > > 04.04.2019, 13:01, "Yury Kotov" : >>  I saw Catherine Ho's patch series and it seems ok to me, but in this RFC I >> asked >>  about a way how to detect other writes which may not be c

Re: [Qemu-devel] [PATCH] migration: Fix use-after-free during process exit

2019-05-14 Thread Yury Kotov
Ping ping 17.04.2019, 15:44, "Yury Kotov" : > Ping > > 08.04.2019, 14:34, "Yury Kotov" : >>  It fixes heap-use-after-free which was found by clang's ASAN. >> >>  Control flow of this use-after-free: >>  main_thread: >>  * Got SIGTERM

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-05-14 Thread Yury Kotov
Ping 18.04.2019, 20:46, "Yury Kotov" : > 18.04.2019, 20:01, "Dr. David Alan Gilbert" : >>  * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>>   18.04.2019, 19:03, "Dr. David Alan Gilbert" : >>>   > * Yury Kotov (yury-ko...@yandex-

[Qemu-devel] [PATCH] trace: fix runstate tracing

2019-04-26 Thread Yury Kotov
Signed-off-by: Yury Kotov --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index ff5dfb6fbc..ad9b181e57 100644 --- a/vl.c +++ b/vl.c @@ -725,7 +725,7 @@ void runstate_set(RunState new_state) assert(new_state < RUN_STATE__

[Qemu-devel] [PATCH] migration: Add error_desc for file channel errors

2019-04-22 Thread Yury Kotov
u_file_set_error_obj 3) And finally using of qemu_file_get_error_obj in migration.c And now, the status for the mentioned fail will be: -> { "execute": "query-migrate" } <- { "return": { "status": "failed", "error-desc&quo

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-18 Thread Yury Kotov
18.04.2019, 20:01, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  18.04.2019, 19:03, "Dr. David Alan Gilbert" : >>  > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  >>  18.04.2019, 17:20, "Dr. David Al

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-18 Thread Yury Kotov
18.04.2019, 19:03, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  18.04.2019, 17:20, "Dr. David Alan Gilbert" : >>  > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  >>  15.04.2019, 14:30, "Dr. Davi

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-18 Thread Yury Kotov
18.04.2019, 17:20, "Dr. David Alan Gilbert" : > * Yury Kotov (yury-ko...@yandex-team.ru) wrote: >>  15.04.2019, 14:30, "Dr. David Alan Gilbert" : >>  > * Daniel P. Berrangé (berra...@redhat.com) wrote: >>  >>  On Mon, Apr 15, 2019

Re: [Qemu-devel] [RFC PATCH] QEMU may write to system_memory before guest starts

2019-04-17 Thread Yury Kotov
Ping 04.04.2019, 13:01, "Yury Kotov" : > I saw Catherine Ho's patch series and it seems ok to me, but in this RFC I > asked > about a way how to detect other writes which may not be covered by particular > fixes. > Perhaps this is excessive caution... > > Regard

Re: [Qemu-devel] [PATCH] migration: Fix use-after-free during process exit

2019-04-17 Thread Yury Kotov
Ping 08.04.2019, 14:34, "Yury Kotov" : > It fixes heap-use-after-free which was found by clang's ASAN. > > Control flow of this use-after-free: > main_thread: > * Got SIGTERM and completes main loop > * Calls migration_shutdown >   - migrate_fd_canc

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-16 Thread Yury Kotov
15.04.2019, 14:30, "Dr. David Alan Gilbert" : > * Daniel P. Berrangé (berra...@redhat.com) wrote: >>  On Mon, Apr 15, 2019 at 12:15:12PM +0100, Dr. David Alan Gilbert wrote: >>  > * Daniel P. Berrangé (berra...@redhat.com) wrote: >>  > > On Mon, Apr 15, 20

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-16 Thread Yury Kotov
15.04.2019, 15:21, "Yury Kotov" : > 15.04.2019, 14:30, "Dr. David Alan Gilbert" : >>  * Daniel P. Berrangé (berra...@redhat.com) wrote: >>>   On Mon, Apr 15, 2019 at 12:15:12PM +0100, Dr. David Alan Gilbert wrote: >>>   > * Daniel P. Berrangé (be

Re: [Qemu-devel] [PATCH] migration: Fix handling fd protocol

2019-04-15 Thread Yury Kotov
15.04.2019, 14:30, "Dr. David Alan Gilbert" : > * Daniel P. Berrangé (berra...@redhat.com) wrote: >>  On Mon, Apr 15, 2019 at 12:15:12PM +0100, Dr. David Alan Gilbert wrote: >>  > * Daniel P. Berrangé (berra...@redhat.com) wrote: >>  > > On Mon, Apr 15, 20

  1   2   >