[PATCH v10 6/8] io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown

2020-10-30 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe and can be called from qmp oob handler. Document this after checking the code. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- include/io/channel.h | 5 - 1 file changed, 4

[PATCH v10 7/8] MAINTAINERS: Add myself as maintainer for yank feature

2020-10-30 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8c744a9bdf..81288fd219 100644

[PATCH v10 3/8] chardev/char-socket.c: Add yank feature

2020-10-30 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- chardev/char-socket.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 95e45812d5

[PATCH v10 4/8] migration: Add yank feature

2020-10-30 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Acked-by: Dr. David Alan Gilbert --- migration/channel.c | 13 + migration/migration.c | 25 + migration/multifd.c | 10

[PATCH v10 5/8] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-10-30 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b

[PATCH v10 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- include/qemu/yank.h | 95 +++ qapi/meson.build | 1 + qapi/qapi-schema.json | 1 + qapi/yank.json| 115 ++ util/meson.build | 1 + u

[PATCH v10 2/8] block/nbd.c: Add yank feature

2020-10-30 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- block/nbd.c | 154 +++- 1 file changed,

[PATCH v10 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-10-30 Thread Lukas Straub
out-of-band qmp command to recover from these kinds of hangs. The different subsystems register callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regar

Re: [PATCH v9 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
On Fri, 30 Oct 2020 15:02:09 +0100 Markus Armbruster wrote: > Lukas Straub writes: > > > On Thu, 29 Oct 2020 17:36:14 +0100 > > Markus Armbruster wrote: > > > >> Nothing major, looks almost ready to me. > >> > >> Lukas Straub writes: >

Re: [PATCH v9 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
On Thu, 29 Oct 2020 17:36:14 +0100 Markus Armbruster wrote: > Nothing major, looks almost ready to me. > > Lukas Straub writes: > > > The yank feature allows to recover from hanging qemu by "yanking" > > at various parts. Other qemu systems can registe

[PATCH v9 7/8] MAINTAINERS: Add myself as maintainer for yank feature

2020-10-28 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ef6f5c7399

[PATCH v9 5/8] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-10-28 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b

[PATCH v9 6/8] io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown

2020-10-28 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe and can be called from qmp oob handler. Document this after checking the code. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- include/io/channel.h | 5 - 1 file changed, 4

[PATCH v9 4/8] migration: Add yank feature

2020-10-28 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Acked-by: Dr. David Alan Gilbert --- migration/channel.c | 13 + migration/migration.c | 25 + migration/multifd.c | 10

[PATCH v9 3/8] chardev/char-socket.c: Add yank feature

2020-10-28 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- chardev/char-socket.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 95e45812d5

[PATCH v9 8/8] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

2020-10-28 Thread Lukas Straub
yank_register_instance will abort, because the yank instance is already/still registered. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- tests/test-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-char.c b/tests/test-char.c index 9196e566e9..aedb5c9eda 100644 --- a/tests

[PATCH v9 2/8] block/nbd.c: Add yank feature

2020-10-28 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- block/nbd.c | 154 +++- 1 file changed,

[PATCH v9 1/8] Introduce yank feature

2020-10-28 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- include/qemu/yank.h | 95 qapi/misc.json | 106 ++ util/meson.build| 1 + util/yank.c | 213 4 fil

[PATCH v9 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-10-28 Thread Lukas Straub
ntended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub Lukas Straub (8): Introduce yank feature block/nbd.c: Add yank feature chardev/char-socket.c: Add yank feature migration: Add yank feature io/channel-tls.c: make qio_channel_tls_shutd

Re: [Bug 1894818] [NEW] COLO's guest VNC client hang after failover

2020-09-08 Thread Lukas Straub
EMU networking device > ``` > -device virtio-net-pci,id=e0,netdev=hn0 \ > -netdev > tap,id=hn0,br=br0,vhost=off,helper=/usr/local/libexec/qemu-bridge-helper \ > ``` > > Thanks. > > Regards, > Derek > > ** Affects: qemu > Importance: Undecided >

Re: [PATCH v7 1/8] Introduce yank feature

2020-09-04 Thread Lukas Straub
On Thu, 27 Aug 2020 14:37:00 +0200 Markus Armbruster wrote: > I apologize for not reviewing this much earlier. > > Lukas Straub writes: > > > The yank feature allows to recover from hanging qemu by "yanking" > > at various parts. Other qemu systems can re

[PATCH v8 7/8] MAINTAINERS: Add myself as maintainer for yank feature

2020-09-01 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5a22c8be42

[PATCH v8 8/8] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

2020-09-01 Thread Lukas Straub
yank_register_instance will abort, because the yank instance is already/still registered. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- tests/test-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-char.c b/tests/test-char.c index d35cc839bc..2ced07de69 100644 --- a/tests

[PATCH v8 5/8] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-09-01 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b

[PATCH v8 2/8] block/nbd.c: Add yank feature

2020-09-01 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- block/nbd.c |

[PATCH v8 6/8] io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown

2020-09-01 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe and can be called from qmp oob handler. Document this after checking the code. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- include/io/channel.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v8 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-09-01 Thread Lukas Straub
these kinds of hangs. The different subsystems register callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub Lukas Straub (8): Introduce

[PATCH v8 4/8] migration: Add yank feature

2020-09-01 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Acked-by: Dr. David Alan Gilbert --- migration/channel.c | 12 migration/migration.c | 25 + migration/multifd.c | 10

[PATCH v8 3/8] chardev/char-socket.c: Add yank feature

2020-09-01 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- chardev/char-socket.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char

[PATCH v8 1/8] Introduce yank feature

2020-09-01 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- include/qemu/yank.h | 81 +++ qapi/misc.json | 62 +++ util/meson.build| 1 + util/yank.c | 187 4 files ch

Re: [PATCH v7 1/8] Introduce yank feature

2020-08-28 Thread Lukas Straub
On Thu, 27 Aug 2020 14:37:00 +0200 Markus Armbruster wrote: > I apologize for not reviewing this much earlier. > > Lukas Straub writes: > > > The yank feature allows to recover from hanging qemu by "yanking" > > at various parts. Other qemu systems can re

Re: [PATCH v7 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-08-27 Thread Lukas Straub
On Tue, 18 Aug 2020 14:26:31 +0200 Lukas Straub wrote: > On Tue, 4 Aug 2020 10:11:22 +0200 > Lukas Straub wrote: > > > Hello Everyone, > > In many cases, if qemu has a network connection (qmp, migration, chardev, > > etc.) > > to some other server and that ser

Re: [PATCH v3 0/7] colo: Introduce resource agent and test suite/CI

2020-08-27 Thread Lukas Straub
On Tue, 18 Aug 2020 14:27:01 +0200 Lukas Straub wrote: > On Tue, 4 Aug 2020 12:46:29 +0200 > Lukas Straub wrote: > > > Hello Everyone, > > So here is v3. Patch 1 can already be merged independently of the others. > > Please review. > > > > R

Re: [PATCH v3 0/7] colo: Introduce resource agent and test suite/CI

2020-08-18 Thread Lukas Straub
On Tue, 4 Aug 2020 12:46:29 +0200 Lukas Straub wrote: > Hello Everyone, > So here is v3. Patch 1 can already be merged independently of the others. > Please review. > > Regards, > Lukas Straub > > Based-on: > "Introduce 'yank' oob qmp command to recover

Re: [PATCH v7 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-08-18 Thread Lukas Straub
On Tue, 4 Aug 2020 10:11:22 +0200 Lukas Straub wrote: > Hello Everyone, > In many cases, if qemu has a network connection (qmp, migration, chardev, > etc.) > to some other server and that server dies or hangs, qemu hangs too. > These patches introduce the new 'yank' out-of-b

[PATCH v3 7/7] MAINTAINERS: Add myself as maintainer for COLO resource agent

2020-08-04 Thread Lukas Straub
While I'm not going to have much time for this, I'll still try to test and review patches. Signed-off-by: Lukas Straub --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0886eb3d2b..02090a728b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v3 6/7] configure,Makefile: Install colo resource-agent

2020-08-04 Thread Lukas Straub
Optionally install the resouce-agent so it gets picked up by pacemaker. Signed-off-by: Lukas Straub --- Makefile | 5 + configure | 10 ++ 2 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index c2120d8d48..dccc20b120 100644 --- a/Makefile +++ b/Makefile

[PATCH v3 4/7] colo: Introduce resource agent

2020-08-04 Thread Lukas Straub
Introduce a resource agent which can be used to manage qemu COLO in a pacemaker cluster. Signed-off-by: Lukas Straub --- scripts/colo-resource-agent/colo | 1501 ++ 1 file changed, 1501 insertions(+) create mode 100755 scripts/colo-resource-agent/colo diff --git

[PATCH v3 3/7] boot_linux.py: Use pick_qemu_util

2020-08-04 Thread Lukas Straub
Replace duplicate code with pick_qemu_util. Signed-off-by: Lukas Straub --- tests/acceptance/boot_linux.py | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 0055dc7cee..0d3629cabb 100644

[PATCH v3 2/7] avocado_qemu: Introduce pick_qemu_util to pick qemu utility binaries

2020-08-04 Thread Lukas Straub
This introduces a generic function to pick qemu utility binaries from the build dir, system or via test parameter. Signed-off-by: Lukas Straub --- tests/acceptance/avocado_qemu/__init__.py | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tests/acceptance/avocado_qemu

[PATCH v3 5/7] colo: Introduce high-level test suite

2020-08-04 Thread Lukas Straub
Add high-level test relying on the colo resource-agent to test all failover cases while checking guest network connectivity. Signed-off-by: Lukas Straub --- scripts/colo-resource-agent/crm_master | 44 ++ scripts/colo-resource-agent/crm_resource | 12 + tests/acceptance/colo.py

[PATCH v3 1/7] block/quorum.c: stable children names

2020-08-04 Thread Lukas Straub
If we remove the child with the highest index from the quorum, decrement s->next_child_index. This way we get stable children names as long as we only remove the last child. Signed-off-by: Lukas Straub Fixes: https://bugs.launchpad.net/bugs/1881231 Reviewed-by: Zhang Chen Reviewed-by: Albe

[PATCH v3 0/7] colo: Introduce resource agent and test suite/CI

2020-08-04 Thread Lukas Straub
Hello Everyone, So here is v3. Patch 1 can already be merged independently of the others. Please review. Regards, Lukas Straub Based-on: "Introduce 'yank' oob qmp command to recover from hanging qemu" Changes: v3: -resource-agent: Don't determine local qemu state by remote ma

[PATCH v7 8/8] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

2020-08-04 Thread Lukas Straub
yank_register_instance will abort, because the yank instance is already/still registered. Signed-off-by: Lukas Straub --- tests/test-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-char.c b/tests/test-char.c index d35cc839bc..2ced07de69 100644 --- a/tests/test-char.c +++ b/tests/test

[PATCH v7 7/8] MAINTAINERS: Add myself as maintainer for yank feature

2020-08-04 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0886eb3d2b

[PATCH v7 6/8] io: Document thread-safety of qio_channel_shutdown

2020-08-04 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe. Document this after checking the code. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- include/io/channel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/io

[PATCH v7 4/8] migration: Add yank feature

2020-08-04 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- migration/channel.c | 12 migration/migration.c | 25 - migration/multifd.c | 10 ++ migration/qemu-file

[PATCH v7 2/8] block/nbd.c: Add yank feature

2020-08-04 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- block/nbd.c | 129 1 file changed,

[PATCH v7 5/8] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-08-04 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b

[PATCH v7 3/8] chardev/char-socket.c: Add yank feature

2020-08-04 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- chardev/char-socket.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index ef62dbf3d7

[PATCH v7 1/8] Introduce yank feature

2020-08-04 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- include/qemu/yank.h | 80 +++ qapi/misc.json | 45 +++ util/Makefile.objs | 1 + util/yank.c | 184 4 files ch

[PATCH v7 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-08-04 Thread Lukas Straub
callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub v7: -yank_register_instance now returns error via Error **errp instead

Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev

2020-07-31 Thread Lukas Straub
On Fri, 31 Jul 2020 10:37:34 +0100 Daniel P. Berrangé wrote: > On Fri, Jul 31, 2020 at 11:27:04AM +0200, Lukas Straub wrote: > > yank_register_instance (called when creating the new chardev object) > > aborts if the instance already exists. So check for duplicate id before >

[PATCH v6 7/9] MAINTAINERS: Add myself as maintainer for yank feature

2020-07-31 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0886eb3d2b

[PATCH v6 6/9] io: Document thread-safety of qio_channel_shutdown

2020-07-31 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe. Document this after checking the code. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- include/io/channel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/io

[PATCH v6 5/9] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-07-31 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b

[PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev

2020-07-31 Thread Lukas Straub
yank_register_instance (called when creating the new chardev object) aborts if the instance already exists. So check for duplicate id before creating the new chardev to prevent this. Signed-off-by: Lukas Straub --- chardev/char.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions

[PATCH v6 3/9] chardev/char-socket.c: Add yank feature

2020-07-31 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- chardev/char-socket.c | 24 1 file changed, 24 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c

[PATCH v6 9/9] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

2020-07-31 Thread Lukas Straub
yank_register_instance will abort, because the yank instance is already/still registered. Signed-off-by: Lukas Straub --- tests/test-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-char.c b/tests/test-char.c index d35cc839bc..2ced07de69 100644 --- a/tests/test-char.c +++ b/tests/test

[PATCH v6 4/9] migration: Add yank feature

2020-07-31 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- migration/channel.c | 12 migration/migration.c | 18 +- migration/multifd.c | 10

[PATCH v6 1/9] Introduce yank feature

2020-07-31 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé Acked-by: Stefan Hajnoczi --- include/qemu/yank.h | 79 +++ qapi/misc.json | 45 +++ util/Makefile.objs | 1 + util/yank.c

[PATCH v6 0/9] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-07-31 Thread Lukas Straub
callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub v6: -add Reviewed-by and Acked-by tags -rebase on master -lots of changes

[PATCH v6 2/9] block/nbd.c: Add yank feature

2020-07-31 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- block/nbd.c | 123 +++- 1 file changed,

Re: [PATCH v1 0/1] COLO: migrate dirty ram pages before colo checkpoint

2020-07-31 Thread Lukas Straub
.zhanghaili...@huawei.com/T/#u Hailang, are you ok with that? Regards, Lukas Straub pgpWMhtdQOKzT.pgp Description: OpenPGP digital signature

[PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread

2020-07-30 Thread Lukas Straub
s->iothread is checked for NULL on object creation in colo_compare_complete, so it's guaranteed not to be NULL. This resolves a false alert from Coverity (CID 1429969). Signed-off-by: Lukas Straub --- net/colo-compare.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --

Re: [PATCH v2 0/7] colo: Introduce resource agent and test suite/CI

2020-07-05 Thread Lukas Straub
On Sat, 6 Jun 2020 21:17:32 +0200 Lukas Straub wrote: > Hello Everyone, > So here is v2. Patch 1 can already be merged independently of the others. > > Regards, > Lukas Straub > > Changes: > v2: > -use new yank api > -drop disk_size parameter > -introduc

Re: [PATCH v5 0/7] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-07-05 Thread Lukas Straub
On Wed, 24 Jun 2020 21:47:46 +0200 Lukas Straub wrote: > On Tue, 23 Jun 2020 16:42:30 +0200 > Lukas Straub wrote: > > > Hello Everyone, > > In many cases, if qemu has a network connection (qmp, migration, chardev, > > etc.) > > to some other server and that

Re: [PULL V2 29/33] net/colo-compare.c: Correct ordering in complete and finalize

2020-07-03 Thread Lukas Straub
On Thu, 25 Jun 2020 10:30:24 +0100 Peter Maydell wrote: > On Thu, 18 Jun 2020 at 14:23, Jason Wang wrote: > > > > From: Lukas Straub > > > > In colo_compare_complete, insert CompareState into net_compares > > only after everything has been initialized. >

Re: [PATCH v5 0/7] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-06-24 Thread Lukas Straub
On Tue, 23 Jun 2020 16:42:30 +0200 Lukas Straub wrote: > Hello Everyone, > In many cases, if qemu has a network connection (qmp, migration, chardev, > etc.) > to some other server and that server dies or hangs, qemu hangs too. > These patches introduce the new 'yank' out-of-b

[PATCH v5 6/7] io: Document thread-safety of qio_channel_shutdown

2020-06-23 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe. Document this after checking the code. Signed-off-by: Lukas Straub --- include/io/channel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/io/channel.h b/include/io/channel.h index d4557f0930..6b8a2b87b8

[PATCH v5 7/7] MAINTAINERS: Add myself as maintainer for yank feature

2020-06-23 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 955cc8dd5c..a403d59190 100644 --- a/MAINTAINERS +++ b

[PATCH v5 5/7] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-06-23 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c b/io/channel-tls.c index 7ec8ceff2f..b350c84640 100644 --- a

[PATCH v5 3/7] chardev/char-socket.c: Add yank feature

2020-06-23 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub --- chardev/char-socket.c | 24 1 file changed, 24 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index afebeec5c3..4e7a7e9ae4 100644 --- a/chardev/char

[PATCH v5 4/7] migration: Add yank feature

2020-06-23 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub --- migration/channel.c | 12 migration/migration.c | 18 +- migration/multifd.c | 10 ++ migration/qemu-file-channel.c | 6 ++ migration

[PATCH v5 1/7] Introduce yank feature

2020-06-23 Thread Lukas Straub
be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub --- include/qemu/yank.h | 79 +++ qapi/misc.json | 45 +++ util/Makefile.objs | 1 + util/yank.c | 179 4 files changed, 304 insertions(+) create m

[PATCH v5 2/7] block/nbd.c: Add yank feature

2020-06-23 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub --- block/nbd.c | 101 +--- 1 file changed, 64 insertions(+), 37 deleti

[PATCH v5 0/7] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-06-23 Thread Lukas Straub
register callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub v5: -move yank.c to util/ -move yank.h to include/qemu/ -add license to yank.h

Re: [PATCH v4 2/4] block/nbd.c: Add yank feature

2020-06-19 Thread Lukas Straub
On Wed, 17 Jun 2020 16:09:09 +0100 Stefan Hajnoczi wrote: > On Mon, May 25, 2020 at 05:44:26PM +0200, Lukas Straub wrote: > > @@ -1395,6 +1407,15 @@ static int nbd_client_reopen_prepare(BDRVReopenState > > *state, > > return 0; > > } > > >

Re: [PATCH 0/2] net/colo-compare.c: Expose "max_queue_size" to users and clean up

2020-06-19 Thread Lukas Straub
++- > > qemu-options.hx| 33 + > > 2 files changed, 59 insertions(+), 17 deletions(-) > > > Queued for 5.1. > > Thanks > > Hi, It looks like this hasn't been merged. Regards, Lukas Straub pgprnYzxxtUsU.pgp Description: OpenPGP digital signature

Re: [PATCH v4 1/4] Introduce yank feature

2020-06-19 Thread Lukas Straub
On Fri, 19 Jun 2020 17:52:40 +0100 Daniel P. Berrangé wrote: > On Fri, Jun 19, 2020 at 06:29:24PM +0200, Lukas Straub wrote: > > On Wed, 17 Jun 2020 16:12:40 +0100 > > Stefan Hajnoczi wrote: > > > > > On Mon, May 25, 2020 at 05:44:23PM +0200, Lukas Straub w

Re: [PATCH v4 1/4] Introduce yank feature

2020-06-19 Thread Lukas Straub
On Wed, 17 Jun 2020 16:12:40 +0100 Stefan Hajnoczi wrote: > On Mon, May 25, 2020 at 05:44:23PM +0200, Lukas Straub wrote: > > +static struct YankInstance *yank_find_instance(char *name) > > There are const char * -> char * casts in later patches. Please use > const

Re: [PATCH v2 1/4] Introduce yank feature

2020-06-19 Thread Lukas Straub
On Wed, 17 Jun 2020 15:39:36 +0100 Stefan Hajnoczi wrote: > On Thu, May 21, 2020 at 04:48:06PM +0100, Daniel P. Berrangé wrote: > > On Thu, May 21, 2020 at 05:42:41PM +0200, Lukas Straub wrote: > > > On Thu, 21 May 2020 16:03:35 +0100 > > > Stefan Hajnoczi wrote: &

Re: [PATCH v4 2/4] block/nbd.c: Add yank feature

2020-06-19 Thread Lukas Straub
On Tue, 16 Jun 2020 15:44:06 +0100 Daniel P. Berrangé wrote: > On Mon, May 25, 2020 at 05:44:26PM +0200, Lukas Straub wrote: > > Register a yank function which shuts down the socket and sets > > s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an > > error

Re: [PATCH v4 1/4] Introduce yank feature

2020-06-19 Thread Lukas Straub
On Tue, 16 Jun 2020 15:39:57 +0100 Daniel P. Berrangé wrote: > On Mon, May 25, 2020 at 05:44:23PM +0200, Lukas Straub wrote: > > The yank feature allows to recover from hanging qemu by "yanking" > > at various parts. Other qemu systems can register themselves and &g

Re: [PATCH 0/5] colo: Introduce resource agent and test suite/CI

2020-06-19 Thread Lukas Straub
On Tue, 16 Jun 2020 01:42:45 + "Zhang, Chen" wrote: > > -Original Message- > > From: Lukas Straub > > Sent: Sunday, June 7, 2020 3:00 AM > > To: Zhang, Chen > > Cc: qemu-devel ; Alberto Garcia > > ; Dr. David Alan Gilbert ; Jas

Re: [PATCH V3 3/3] migration/migration.c: Remove MIGRATION_STATUS_ACTIVE in migration_iteration_finish

2020-06-08 Thread Lukas Straub
On Mon, 8 Jun 2020 03:46:11 +0800 Zhang Chen wrote: > From: Zhang Chen > > MIGRATION_STATUS_ACTIVE is invalid here, handle it by default case. > > Suggested-by: Lukas Straub > Signed-off-by: Zhang Chen > --- Looks good and works well in my tests. Reviewed-by:

Re: [PATCH V3 1/3] migration/colo: Optimize COLO boot code path

2020-06-08 Thread Lukas Straub
On Mon, 8 Jun 2020 03:46:09 +0800 Zhang Chen wrote: > From: Zhang Chen > > No need to reuse MIGRATION_STATUS_ACTIVE boot COLO. > > Signed-off-by: Zhang Chen > Reviewed-by: zhanghailiang > --- Looks good and works well in my tests. Reviewed-by: Lukas Straub Te

Re: [PATCH V2 1/2] migration/colo: Optimize COLO boot code path

2020-06-06 Thread Lukas Straub
o matter its old running state. > * After exited COLO, we will keep running. > */ > +case MIGRATION_STATUS_ACTIVE: > +/* > + * We should really assert here, but since it's during > + * migration, let's try to reduce the usage of

Re: [PATCH V2 2/2] migration/colo: Update checkpoint time lately

2020-06-06 Thread Lukas Straub
wed-by: zhanghailiang > --- Hi, Looks good and works well in my tests. Reviewed-by: Lukas Straub Tested-by: Lukas Straub Regards, Lukas Straub pgpGIA0kOhJ53.pgp Description: OpenPGP digital signature

Re: [PATCH v3 08/20] migration/colo: Use ram_block_discard_disable()

2020-06-06 Thread Lukas Straub
r. David Alan Gilbert" > Signed-off-by: David Hildenbrand > --- Hi, This works well in my colo tests. Tested-by: Lukas Straub Regards, Lukas Straub pgplYuRWlINxS.pgp Description: OpenPGP digital signature

[PATCH v2 7/7] MAINTAINERS: Add myself as maintainer for COLO resource agent

2020-06-06 Thread Lukas Straub
While I'm not going to have much time for this, I'll still try to test and review patches. Signed-off-by: Lukas Straub --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8cbc1fac2b..4c623a96e1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v2 5/7] colo: Introduce high-level test suite

2020-06-06 Thread Lukas Straub
Add high-level test relying on the colo resource-agent to test all failover cases while checking guest network connectivity. Signed-off-by: Lukas Straub --- scripts/colo-resource-agent/crm_master | 44 ++ scripts/colo-resource-agent/crm_resource | 12 + tests/acceptance/colo.py

Re: [PATCH v4 0/4] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-06-06 Thread Lukas Straub
On Mon, 25 May 2020 17:44:12 +0200 Lukas Straub wrote: > Hello Everyone, > In many cases, if qemu has a network connection (qmp, migration, chardev, > etc.) > to some other server and that server dies or hangs, qemu hangs too. > These patches introduce the new 'yank' out-of-b

[PATCH v2 6/7] configure,Makefile: Install colo resource-agent

2020-06-06 Thread Lukas Straub
Optionally install the resouce-agent so it gets picked up by pacemaker. Signed-off-by: Lukas Straub --- Makefile | 5 + configure | 10 ++ 2 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 8a9113e666..2ebffc4465 100644 --- a/Makefile +++ b/Makefile

[PATCH v2 4/7] colo: Introduce resource agent

2020-06-06 Thread Lukas Straub
Introduce a resource agent which can be used to manage qemu COLO in a pacemaker cluster. Signed-off-by: Lukas Straub --- scripts/colo-resource-agent/colo | 1466 ++ 1 file changed, 1466 insertions(+) create mode 100755 scripts/colo-resource-agent/colo diff --git

[PATCH v2 3/7] boot_linux.py: Use pick_qemu_util

2020-06-06 Thread Lukas Straub
Replace duplicate code with pick_qemu_util. Signed-off-by: Lukas Straub --- tests/acceptance/boot_linux.py | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 075a386300..6b99112cad 100644

[PATCH v2 2/7] avocado_qemu: Introduce pick_qemu_util to pick qemu utility binaries

2020-06-06 Thread Lukas Straub
This introduces a generic function to pick qemu utility binaries from the build dir, system or via test parameter. Signed-off-by: Lukas Straub --- tests/acceptance/avocado_qemu/__init__.py | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tests/acceptance/avocado_qemu

[PATCH v2 1/7] block/quorum.c: stable children names

2020-06-06 Thread Lukas Straub
If we remove the child with the highest index from the quorum, decrement s->next_child_index. This way we get stable children names as long as we only remove the last child. Signed-off-by: Lukas Straub Fixes: https://bugs.launchpad.net/bugs/1881231 Reviewed-by: Zhang Chen Reviewed-by: Albe

[PATCH v2 0/7] colo: Introduce resource agent and test suite/CI

2020-06-06 Thread Lukas Straub
Hello Everyone, So here is v2. Patch 1 can already be merged independently of the others. Regards, Lukas Straub Changes: v2: -use new yank api -drop disk_size parameter -introduce pick_qemu_util function and use it Overview: Hello Everyone, These patches introduce a resource agent for fully

Re: [PATCH 0/5] colo: Introduce resource agent and test suite/CI

2020-06-06 Thread Lukas Straub
On Mon, 18 May 2020 09:38:24 + "Zhang, Chen" wrote: > > -Original Message- > > From: Lukas Straub > > Sent: Monday, May 11, 2020 8:27 PM > > To: qemu-devel > > Cc: Alberto Garcia ; Dr. David Alan Gilbert > > ; Zhang, Chen > >

<    1   2   3   4   5   6   7   >