* [PULL 0/9] migration queue
@ 2019-09-25 15:01 Dr. David Alan Gilbert (git)
2019-09-26 15:13 ` Peter Maydell
0 siblings, 1 reply; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-09-25 15:01 UTC (permalink / raw
To: qemu-devel, quintela, peterx, marcandre.lureau, richardw.yang,
alex.benee
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The following changes since commit 240ab11fb72049d6373cbbec8d788f8e411a00bc:
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190924' into staging (2019-09-24 15:36:31 +0100)
are available in the Git repository at:
git://github.com/dagrh/qemu.git tags/pull-migration-20190925a
for you to fetch changes up to 3748fef9b95a9bc1602f3c4ed2a329d8ef47e63c:
migration/postcopy: Recognise the recovery states as 'in_postcopy' (2019-09-25 15:51:19 +0100)
----------------------------------------------------------------
Migration pull 2019-09-25
me: test fixes from (should stop hangs in postcopy tests).
me: An RDMA cleanup hang fix
Wei: Tidy ups around postcopy
Marc-Andre: mem leak fix
----------------------------------------------------------------
Dr. David Alan Gilbert (5):
migration/rdma: Don't moan about disconnects at the end
migration/rdma.c: Swap synchronize_rcu for call_rcu
tests/migration: Fail on unexpected migration states
tests/migration/postcopy: trim migration bandwidth
migration/postcopy: Recognise the recovery states as 'in_postcopy'
Marc-André Lureau (1):
migration: fix vmdesc leak on vmstate_save() error
Wei Yang (3):
migration/postcopy: not necessary to do discard when canonicalizing bitmap
migration/postcopy: unsentmap is not necessary for postcopy
migration: remove sent parameter in get_queued_page_not_dirty
include/exec/ram_addr.h | 6 ----
migration/migration.c | 9 ++++-
migration/qjson.h | 2 ++
migration/ram.c | 94 ++++++++-----------------------------------------
migration/rdma.c | 51 ++++++++++++++++++---------
migration/savevm.c | 3 +-
migration/trace-events | 2 +-
tests/migration-test.c | 25 +++++++++----
8 files changed, 80 insertions(+), 112 deletions(-)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PULL 0/9] migration queue
2019-09-25 15:01 Dr. David Alan Gilbert (git)
@ 2019-09-26 15:13 ` Peter Maydell
0 siblings, 0 replies; 18+ messages in thread
From: Peter Maydell @ 2019-09-26 15:13 UTC (permalink / raw
To: Dr. David Alan Gilbert (git)
Cc: Juan Quintela, QEMU Developers, Peter Xu, alex.benee, Wei Yang,
Marc-André Lureau
On Wed, 25 Sep 2019 at 16:06, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
>
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit 240ab11fb72049d6373cbbec8d788f8e411a00bc:
>
> Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190924' into staging (2019-09-24 15:36:31 +0100)
>
> are available in the Git repository at:
>
> git://github.com/dagrh/qemu.git tags/pull-migration-20190925a
>
> for you to fetch changes up to 3748fef9b95a9bc1602f3c4ed2a329d8ef47e63c:
>
> migration/postcopy: Recognise the recovery states as 'in_postcopy' (2019-09-25 15:51:19 +0100)
>
> ----------------------------------------------------------------
> Migration pull 2019-09-25
>
> me: test fixes from (should stop hangs in postcopy tests).
> me: An RDMA cleanup hang fix
> Wei: Tidy ups around postcopy
> Marc-Andre: mem leak fix
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PULL 0/9] migration queue
@ 2020-03-25 13:16 Dr. David Alan Gilbert (git)
2020-03-26 10:46 ` Peter Maydell
0 siblings, 1 reply; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2020-03-25 13:16 UTC (permalink / raw
To: qemu-devel, pannengyuan, maozhongyi, vsementsov, imammedo, philmd
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The following changes since commit 736cf607e40674776d752acc201f565723e86045:
Update version for v5.0.0-rc0 release (2020-03-24 17:50:00 +0000)
are available in the Git repository at:
git://github.com/dagrh/qemu.git tags/pull-migration-20200325b
for you to fetch changes up to 7cd75cbdb8a45d9e2d5912f774d8194cbafdfa97:
migration: use "" instead of (null) for tls-authz (2020-03-25 12:31:38 +0000)
----------------------------------------------------------------
Combo Migration/HMP/virtiofs pull
Small fixes all around.
Ones that are noticeable:
a) Igor's migration compatibility fix affecting older machine types
has been seen in the wild
b) Philippe's autconverge fix should fix an intermittently
failing migration test.
c) Mao's makes a small change to the output of 'info
migrate_parameters' for tls-authz.
----------------------------------------------------------------
Dr. David Alan Gilbert (1):
hmp/vnc: Fix info vnc list leak
Igor Mammedov (1):
vl.c: fix migration failure for 3.1 and older machine types
Mao Zhongyi (2):
xbzrle: update xbzrle doc
migration: use "" instead of (null) for tls-authz
Pan Nengyuan (1):
hmp-cmd: fix a missing_break warning
Philippe Mathieu-Daudé (2):
tests/migration: Reduce autoconverge initial bandwidth
tools/virtiofsd/passthrough_ll: Fix double close()
Vladimir Sementsov-Ogievskiy (2):
migration/colo: fix use after free of local_err
migration/ram: fix use after free of local_err
docs/xbzrle.txt | 7 ++++++-
migration/colo.c | 1 +
migration/migration.c | 5 +++--
migration/ram.c | 1 +
monitor/hmp-cmds.c | 12 +++++++-----
softmmu/vl.c | 3 +++
tests/qtest/migration-test.c | 2 +-
tools/virtiofsd/passthrough_ll.c | 3 +--
8 files changed, 23 insertions(+), 11 deletions(-)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PULL 0/9] migration queue
2020-03-25 13:16 Dr. David Alan Gilbert (git)
@ 2020-03-26 10:46 ` Peter Maydell
0 siblings, 0 replies; 18+ messages in thread
From: Peter Maydell @ 2020-03-26 10:46 UTC (permalink / raw
To: Dr. David Alan Gilbert (git)
Cc: Vladimir Sementsov-Ogievskiy, Mao Zhongyi, Pan Nengyuan,
QEMU Developers, Igor Mammedov, Philippe Mathieu-Daudé
On Wed, 25 Mar 2020 at 13:17, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
>
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit 736cf607e40674776d752acc201f565723e86045:
>
> Update version for v5.0.0-rc0 release (2020-03-24 17:50:00 +0000)
>
> are available in the Git repository at:
>
> git://github.com/dagrh/qemu.git tags/pull-migration-20200325b
>
> for you to fetch changes up to 7cd75cbdb8a45d9e2d5912f774d8194cbafdfa97:
>
> migration: use "" instead of (null) for tls-authz (2020-03-25 12:31:38 +0000)
>
> ----------------------------------------------------------------
> Combo Migration/HMP/virtiofs pull
>
> Small fixes all around.
> Ones that are noticeable:
> a) Igor's migration compatibility fix affecting older machine types
> has been seen in the wild
> b) Philippe's autconverge fix should fix an intermittently
> failing migration test.
> c) Mao's makes a small change to the output of 'info
> migrate_parameters' for tls-authz.
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PULL 0/9] migration queue
@ 2021-06-09 14:45 Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 1/9] yank: Unregister function when using TLS migration Dr. David Alan Gilbert (git)
` (10 more replies)
0 siblings, 11 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The following changes since commit a4716fd8d7c877185652f5f8e25032dc7699d51b:
Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20210608-1' into staging (2021-06-08 13:54:23 +0100)
are available in the Git repository at:
https://gitlab.com/dagrh/qemu.git tags/pull-migration-20210609a
for you to fetch changes up to a4a571d97866d056787d7a654be5792765be8a60:
hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds (2021-06-08 20:18:26 +0100)
----------------------------------------------------------------
Migration pull for 2021-06-09
Yank crash fix from Leo
RDMA fix from Li
mptcp support from me
dirty-rate changes from Hyman and Peter
(Note I've switched to the gitlab I've been using for virtiofs pulls)
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
----------------------------------------------------------------
Dr. David Alan Gilbert (5):
channel-socket: Only set CLOEXEC if we have space for fds
io/net-listener: Call the notifier during finalize
migration: Add cleanup hook for inwards migration
migration/socket: Close the listener at the end
sockets: Support multipath TCP
Hyman Huang(黄勇) (1):
migration/dirtyrate: make sample page count configurable
Leonardo Bras (1):
yank: Unregister function when using TLS migration
Li Zhijian (1):
migration/rdma: Fix cm event use after free
Peter Xu (1):
hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds
hmp-commands-info.hx | 13 ++++++++
hmp-commands.hx | 14 ++++++++
include/monitor/hmp.h | 2 ++
io/channel-socket.c | 8 ++---
io/dns-resolver.c | 4 +++
io/net-listener.c | 3 ++
migration/channel.c | 26 ++++++++-------
migration/dirtyrate.c | 78 ++++++++++++++++++++++++++++++++++++++++---
migration/dirtyrate.h | 8 ++++-
migration/migration.c | 3 ++
migration/migration.h | 4 +++
migration/multifd.c | 8 ++++-
migration/qemu-file-channel.c | 4 ++-
migration/rdma.c | 11 ++++--
migration/socket.c | 24 +++++++++----
qapi/migration.json | 15 +++++++--
qapi/sockets.json | 5 ++-
util/qemu-sockets.c | 23 +++++++++++++
18 files changed, 217 insertions(+), 36 deletions(-)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PULL 1/9] yank: Unregister function when using TLS migration
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-14 5:14 ` Philippe Mathieu-Daudé
2021-06-09 14:45 ` [PULL 2/9] migration/rdma: Fix cm event use after free Dr. David Alan Gilbert (git)
` (9 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: Leonardo Bras <leobras.c@gmail.com>
After yank feature was introduced in migration, whenever migration
is started using TLS, the following error happens in both source and
destination hosts:
(qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance:
Assertion `QLIST_EMPTY(&entry->yankfns)' failed.
This happens because of a missing yank_unregister_function() when using
qio-channel-tls.
Fix this by also allowing TYPE_QIO_CHANNEL_TLS object type to perform
yank_unregister_function() in channel_close() and multifd_load_cleanup().
Also, inside migration_channel_connect() and
migration_channel_process_incoming() move yank_register_function() so
it only runs once on a TLS migration.
Fixes: b5eea99ec2f ("migration: Add yank feature", 2021-01-13)
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1964326
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Changes since v2:
- Dropped all references to ioc->master
- yank_register_function() and yank_unregister_function() now only run
once in a TLS migration.
Changes since v1:
- Cast p->c to QIOChannelTLS into multifd_load_cleanup()
Message-Id: <20210601054030.1153249-1-leobras.c@gmail.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/channel.c | 26 ++++++++++++++------------
migration/multifd.c | 3 ++-
migration/qemu-file-channel.c | 4 +++-
3 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/migration/channel.c b/migration/channel.c
index c9ee902021..01275a9162 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -38,18 +38,19 @@ void migration_channel_process_incoming(QIOChannel *ioc)
trace_migration_set_incoming_channel(
ioc, object_get_typename(OBJECT(ioc)));
- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
- yank_register_function(MIGRATION_YANK_INSTANCE,
- migration_yank_iochannel,
- QIO_CHANNEL(ioc));
- }
-
if (s->parameters.tls_creds &&
*s->parameters.tls_creds &&
!object_dynamic_cast(OBJECT(ioc),
TYPE_QIO_CHANNEL_TLS)) {
migration_tls_channel_process_incoming(s, ioc, &local_err);
} else {
+ if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) ||
+ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS)) {
+ yank_register_function(MIGRATION_YANK_INSTANCE,
+ migration_yank_iochannel,
+ QIO_CHANNEL(ioc));
+ }
+
migration_ioc_process_incoming(ioc, &local_err);
}
@@ -76,12 +77,6 @@ void migration_channel_connect(MigrationState *s,
ioc, object_get_typename(OBJECT(ioc)), hostname, error);
if (!error) {
- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
- yank_register_function(MIGRATION_YANK_INSTANCE,
- migration_yank_iochannel,
- QIO_CHANNEL(ioc));
- }
-
if (s->parameters.tls_creds &&
*s->parameters.tls_creds &&
!object_dynamic_cast(OBJECT(ioc),
@@ -99,6 +94,13 @@ void migration_channel_connect(MigrationState *s,
} else {
QEMUFile *f = qemu_fopen_channel_output(ioc);
+ if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) ||
+ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS)) {
+ yank_register_function(MIGRATION_YANK_INSTANCE,
+ migration_yank_iochannel,
+ QIO_CHANNEL(ioc));
+ }
+
qemu_mutex_lock(&s->qemu_file_lock);
s->to_dst_file = f;
qemu_mutex_unlock(&s->qemu_file_lock);
diff --git a/migration/multifd.c b/migration/multifd.c
index 0a4803cfcc..2e8f001bc0 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -987,7 +987,8 @@ int multifd_load_cleanup(Error **errp)
for (i = 0; i < migrate_multifd_channels(); i++) {
MultiFDRecvParams *p = &multifd_recv_state->params[i];
- if (object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET)
+ if ((object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET) ||
+ object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_TLS))
&& OBJECT(p->c)->ref == 1) {
yank_unregister_function(MIGRATION_YANK_INSTANCE,
migration_yank_iochannel,
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index 876d05a540..fad340ea7a 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -26,6 +26,7 @@
#include "qemu-file-channel.h"
#include "qemu-file.h"
#include "io/channel-socket.h"
+#include "io/channel-tls.h"
#include "qemu/iov.h"
#include "qemu/yank.h"
#include "yank_functions.h"
@@ -106,7 +107,8 @@ static int channel_close(void *opaque, Error **errp)
int ret;
QIOChannel *ioc = QIO_CHANNEL(opaque);
ret = qio_channel_close(ioc, errp);
- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)
+ if ((object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) ||
+ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS))
&& OBJECT(ioc)->ref == 1) {
yank_unregister_function(MIGRATION_YANK_INSTANCE,
migration_yank_iochannel,
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 2/9] migration/rdma: Fix cm event use after free
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 1/9] yank: Unregister function when using TLS migration Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 3/9] channel-socket: Only set CLOEXEC if we have space for fds Dr. David Alan Gilbert (git)
` (8 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Message-Id: <20210602023506.3821293-1-lizhijian@cn.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/rdma.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 1cdb4561f3..d90b29a4b5 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1539,16 +1539,20 @@ static int qemu_rdma_wait_comp_channel(RDMAContext *rdma)
if (pfds[1].revents) {
ret = rdma_get_cm_event(rdma->channel, &cm_event);
- if (!ret) {
- rdma_ack_cm_event(cm_event);
+ if (ret) {
+ error_report("failed to get cm event while wait "
+ "completion channel");
+ return -EPIPE;
}
error_report("receive cm event while wait comp channel,"
"cm event is %d", cm_event->event);
if (cm_event->event == RDMA_CM_EVENT_DISCONNECTED ||
cm_event->event == RDMA_CM_EVENT_DEVICE_REMOVAL) {
+ rdma_ack_cm_event(cm_event);
return -EPIPE;
}
+ rdma_ack_cm_event(cm_event);
}
break;
@@ -3285,7 +3289,6 @@ static void rdma_cm_poll_handler(void *opaque)
error_report("get_cm_event failed %d", errno);
return;
}
- rdma_ack_cm_event(cm_event);
if (cm_event->event == RDMA_CM_EVENT_DISCONNECTED ||
cm_event->event == RDMA_CM_EVENT_DEVICE_REMOVAL) {
@@ -3298,12 +3301,14 @@ static void rdma_cm_poll_handler(void *opaque)
rdma->return_path->error_state = -EPIPE;
}
}
+ rdma_ack_cm_event(cm_event);
if (mis->migration_incoming_co) {
qemu_coroutine_enter(mis->migration_incoming_co);
}
return;
}
+ rdma_ack_cm_event(cm_event);
}
static int qemu_rdma_accept(RDMAContext *rdma)
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 3/9] channel-socket: Only set CLOEXEC if we have space for fds
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 1/9] yank: Unregister function when using TLS migration Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 2/9] migration/rdma: Fix cm event use after free Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 4/9] io/net-listener: Call the notifier during finalize Dr. David Alan Gilbert (git)
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
MSG_CMSG_CLOEXEC cleans up received fd's; it's really only for Unix
sockets, but currently we enable it for everything; some socket types
(IP_MPTCP) don't like this.
Only enable it when we're giving the recvmsg room to receive fd's
anyway.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210421112834.107651-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
io/channel-socket.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/io/channel-socket.c b/io/channel-socket.c
index de259f7eed..606ec97cf7 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -487,15 +487,15 @@ static ssize_t qio_channel_socket_readv(QIOChannel *ioc,
memset(control, 0, CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS));
-#ifdef MSG_CMSG_CLOEXEC
- sflags |= MSG_CMSG_CLOEXEC;
-#endif
-
msg.msg_iov = (struct iovec *)iov;
msg.msg_iovlen = niov;
if (fds && nfds) {
msg.msg_control = control;
msg.msg_controllen = sizeof(control);
+#ifdef MSG_CMSG_CLOEXEC
+ sflags |= MSG_CMSG_CLOEXEC;
+#endif
+
}
retry:
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 4/9] io/net-listener: Call the notifier during finalize
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (2 preceding siblings ...)
2021-06-09 14:45 ` [PULL 3/9] channel-socket: Only set CLOEXEC if we have space for fds Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 5/9] migration: Add cleanup hook for inwards migration Dr. David Alan Gilbert (git)
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Call the notifier during finalize; it's currently only called
if we change it, which is not the intent.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210421112834.107651-3-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
io/net-listener.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/io/net-listener.c b/io/net-listener.c
index 46c2643d00..1c984d69c6 100644
--- a/io/net-listener.c
+++ b/io/net-listener.c
@@ -292,6 +292,9 @@ static void qio_net_listener_finalize(Object *obj)
QIONetListener *listener = QIO_NET_LISTENER(obj);
size_t i;
+ if (listener->io_notify) {
+ listener->io_notify(listener->io_data);
+ }
qio_net_listener_disconnect(listener);
for (i = 0; i < listener->nsioc; i++) {
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 5/9] migration: Add cleanup hook for inwards migration
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (3 preceding siblings ...)
2021-06-09 14:45 ` [PULL 4/9] io/net-listener: Call the notifier during finalize Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 6/9] migration/socket: Close the listener at the end Dr. David Alan Gilbert (git)
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Add a cleanup hook for incoming migration that gets called
at the end as a way for a transport to allow cleanup.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210421112834.107651-4-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 3 +++
migration/migration.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index 1885860d7b..393299e150 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -280,6 +280,9 @@ void migration_incoming_state_destroy(void)
g_array_free(mis->postcopy_remote_fds, TRUE);
mis->postcopy_remote_fds = NULL;
}
+ if (mis->transport_cleanup) {
+ mis->transport_cleanup(mis->transport_data);
+ }
qemu_event_reset(&mis->main_thread_load_event);
diff --git a/migration/migration.h b/migration/migration.h
index b88bd8fe07..2ebb740dfa 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -49,6 +49,10 @@ struct PostcopyBlocktimeContext;
struct MigrationIncomingState {
QEMUFile *from_src_file;
+ /* A hook to allow cleanup at the end of incoming migration */
+ void *transport_data;
+ void (*transport_cleanup)(void *data);
+
/*
* Free at the start of the main state load, set as the main thread finishes
* loading state.
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 6/9] migration/socket: Close the listener at the end
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (4 preceding siblings ...)
2021-06-09 14:45 ` [PULL 5/9] migration: Add cleanup hook for inwards migration Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 7/9] sockets: Support multipath TCP Dr. David Alan Gilbert (git)
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Delay closing the listener until the cleanup hook at the end; mptcp
needs the listener to stay open while the other paths come in.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210421112834.107651-5-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/multifd.c | 5 +++++
migration/socket.c | 24 ++++++++++++++++++------
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 2e8f001bc0..ab41590e71 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -1166,6 +1166,11 @@ bool multifd_recv_all_channels_created(void)
return true;
}
+ if (!multifd_recv_state) {
+ /* Called before any connections created */
+ return false;
+ }
+
return thread_count == qatomic_read(&multifd_recv_state->count);
}
diff --git a/migration/socket.c b/migration/socket.c
index 6016642e04..05705a32d8 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -126,22 +126,31 @@ static void socket_accept_incoming_migration(QIONetListener *listener,
{
trace_migration_socket_incoming_accepted();
- qio_channel_set_name(QIO_CHANNEL(cioc), "migration-socket-incoming");
- migration_channel_process_incoming(QIO_CHANNEL(cioc));
-
if (migration_has_all_channels()) {
- /* Close listening socket as its no longer needed */
- qio_net_listener_disconnect(listener);
- object_unref(OBJECT(listener));
+ error_report("%s: Extra incoming migration connection; ignoring",
+ __func__);
+ return;
}
+
+ qio_channel_set_name(QIO_CHANNEL(cioc), "migration-socket-incoming");
+ migration_channel_process_incoming(QIO_CHANNEL(cioc));
}
+static void
+socket_incoming_migration_end(void *opaque)
+{
+ QIONetListener *listener = opaque;
+
+ qio_net_listener_disconnect(listener);
+ object_unref(OBJECT(listener));
+}
static void
socket_start_incoming_migration_internal(SocketAddress *saddr,
Error **errp)
{
QIONetListener *listener = qio_net_listener_new();
+ MigrationIncomingState *mis = migration_incoming_get_current();
size_t i;
int num = 1;
@@ -156,6 +165,9 @@ socket_start_incoming_migration_internal(SocketAddress *saddr,
return;
}
+ mis->transport_data = listener;
+ mis->transport_cleanup = socket_incoming_migration_end;
+
qio_net_listener_set_client_func_full(listener,
socket_accept_incoming_migration,
NULL, NULL,
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 7/9] sockets: Support multipath TCP
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (5 preceding siblings ...)
2021-06-09 14:45 ` [PULL 6/9] migration/socket: Close the listener at the end Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 8/9] migration/dirtyrate: make sample page count configurable Dr. David Alan Gilbert (git)
` (3 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Multipath TCP allows combining multiple interfaces/routes into a single
socket, with very little work for the user/admin.
It's enabled by 'mptcp' on most socket addresses:
./qemu-system-x86_64 -nographic -incoming tcp:0:4444,mptcp
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210421112834.107651-6-dgilbert@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
io/dns-resolver.c | 4 ++++
qapi/sockets.json | 5 ++++-
util/qemu-sockets.c | 23 +++++++++++++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/io/dns-resolver.c b/io/dns-resolver.c
index 743a0efc87..a5946a93bf 100644
--- a/io/dns-resolver.c
+++ b/io/dns-resolver.c
@@ -122,6 +122,10 @@ static int qio_dns_resolver_lookup_sync_inet(QIODNSResolver *resolver,
.ipv4 = iaddr->ipv4,
.has_ipv6 = iaddr->has_ipv6,
.ipv6 = iaddr->ipv6,
+#ifdef IPPROTO_MPTCP
+ .has_mptcp = iaddr->has_mptcp,
+ .mptcp = iaddr->mptcp,
+#endif
};
(*addrs)[i] = newaddr;
diff --git a/qapi/sockets.json b/qapi/sockets.json
index 2e83452797..735eb4abb5 100644
--- a/qapi/sockets.json
+++ b/qapi/sockets.json
@@ -57,6 +57,8 @@
# @keep-alive: enable keep-alive when connecting to this socket. Not supported
# for passive sockets. (Since 4.2)
#
+# @mptcp: enable multi-path TCP. (Since 6.1)
+#
# Since: 1.3
##
{ 'struct': 'InetSocketAddress',
@@ -66,7 +68,8 @@
'*to': 'uint16',
'*ipv4': 'bool',
'*ipv6': 'bool',
- '*keep-alive': 'bool' } }
+ '*keep-alive': 'bool',
+ '*mptcp': { 'type': 'bool', 'if': 'defined(IPPROTO_MPTCP)' } } }
##
# @UnixSocketAddress:
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 2463c49773..c415c342c1 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -278,6 +278,11 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
/* create socket + bind/listen */
for (e = res; e != NULL; e = e->ai_next) {
+#ifdef IPPROTO_MPTCP
+ if (saddr->has_mptcp && saddr->mptcp) {
+ e->ai_protocol = IPPROTO_MPTCP;
+ }
+#endif
getnameinfo((struct sockaddr*)e->ai_addr,e->ai_addrlen,
uaddr,INET6_ADDRSTRLEN,uport,32,
NI_NUMERICHOST | NI_NUMERICSERV);
@@ -456,6 +461,13 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
for (e = res; e != NULL; e = e->ai_next) {
error_free(local_err);
local_err = NULL;
+
+#ifdef IPPROTO_MPTCP
+ if (saddr->has_mptcp && saddr->mptcp) {
+ e->ai_protocol = IPPROTO_MPTCP;
+ }
+#endif
+
sock = inet_connect_addr(saddr, e, &local_err);
if (sock >= 0) {
break;
@@ -687,6 +699,17 @@ int inet_parse(InetSocketAddress *addr, const char *str, Error **errp)
}
addr->has_keep_alive = true;
}
+#ifdef IPPROTO_MPTCP
+ begin = strstr(optstr, ",mptcp");
+ if (begin) {
+ if (inet_parse_flag("mptcp", begin + strlen(",mptcp"),
+ &addr->mptcp, errp) < 0)
+ {
+ return -1;
+ }
+ addr->has_mptcp = true;
+ }
+#endif
return 0;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 8/9] migration/dirtyrate: make sample page count configurable
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (6 preceding siblings ...)
2021-06-09 14:45 ` [PULL 7/9] sockets: Support multipath TCP Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 9/9] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds Dr. David Alan Gilbert (git)
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
introduce optional sample-pages argument in calc-dirty-rate,
making sample page count per GB configurable so that more
accurate dirtyrate can be calculated.
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Message-Id: <3103453a3b2796f929269c99a6ad81a9a7f1f405.1623027729.git.huangy81@chinatelecom.cn>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Wrapped a couple of long lines
---
migration/dirtyrate.c | 31 +++++++++++++++++++++++++++----
migration/dirtyrate.h | 8 +++++++-
qapi/migration.json | 15 ++++++++++++---
3 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index ccb98147e8..2ee3890721 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -48,6 +48,12 @@ static bool is_sample_period_valid(int64_t sec)
return true;
}
+static bool is_sample_pages_valid(int64_t pages)
+{
+ return pages >= MIN_SAMPLE_PAGE_COUNT &&
+ pages <= MAX_SAMPLE_PAGE_COUNT;
+}
+
static int dirtyrate_set_state(int *state, int old_state, int new_state)
{
assert(new_state < DIRTY_RATE_STATUS__MAX);
@@ -72,13 +78,15 @@ static struct DirtyRateInfo *query_dirty_rate_info(void)
info->status = CalculatingState;
info->start_time = DirtyStat.start_time;
info->calc_time = DirtyStat.calc_time;
+ info->sample_pages = DirtyStat.sample_pages;
trace_query_dirty_rate_info(DirtyRateStatus_str(CalculatingState));
return info;
}
-static void init_dirtyrate_stat(int64_t start_time, int64_t calc_time)
+static void init_dirtyrate_stat(int64_t start_time, int64_t calc_time,
+ uint64_t sample_pages)
{
DirtyStat.total_dirty_samples = 0;
DirtyStat.total_sample_count = 0;
@@ -86,6 +94,7 @@ static void init_dirtyrate_stat(int64_t start_time, int64_t calc_time)
DirtyStat.dirty_rate = -1;
DirtyStat.start_time = start_time;
DirtyStat.calc_time = calc_time;
+ DirtyStat.sample_pages = sample_pages;
}
static void update_dirtyrate_stat(struct RamblockDirtyInfo *info)
@@ -361,6 +370,7 @@ void *get_dirtyrate_thread(void *arg)
int ret;
int64_t start_time;
int64_t calc_time;
+ uint64_t sample_pages;
ret = dirtyrate_set_state(&CalculatingState, DIRTY_RATE_STATUS_UNSTARTED,
DIRTY_RATE_STATUS_MEASURING);
@@ -371,7 +381,8 @@ void *get_dirtyrate_thread(void *arg)
start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) / 1000;
calc_time = config.sample_period_seconds;
- init_dirtyrate_stat(start_time, calc_time);
+ sample_pages = config.sample_pages_per_gigabytes;
+ init_dirtyrate_stat(start_time, calc_time, sample_pages);
calculate_dirtyrate(config);
@@ -383,7 +394,8 @@ void *get_dirtyrate_thread(void *arg)
return NULL;
}
-void qmp_calc_dirty_rate(int64_t calc_time, Error **errp)
+void qmp_calc_dirty_rate(int64_t calc_time, bool has_sample_pages,
+ int64_t sample_pages, Error **errp)
{
static struct DirtyRateConfig config;
QemuThread thread;
@@ -404,6 +416,17 @@ void qmp_calc_dirty_rate(int64_t calc_time, Error **errp)
return;
}
+ if (has_sample_pages) {
+ if (!is_sample_pages_valid(sample_pages)) {
+ error_setg(errp, "sample-pages is out of range[%d, %d].",
+ MIN_SAMPLE_PAGE_COUNT,
+ MAX_SAMPLE_PAGE_COUNT);
+ return;
+ }
+ } else {
+ sample_pages = DIRTYRATE_DEFAULT_SAMPLE_PAGES;
+ }
+
/*
* Init calculation state as unstarted.
*/
@@ -415,7 +438,7 @@ void qmp_calc_dirty_rate(int64_t calc_time, Error **errp)
}
config.sample_period_seconds = calc_time;
- config.sample_pages_per_gigabytes = DIRTYRATE_DEFAULT_SAMPLE_PAGES;
+ config.sample_pages_per_gigabytes = sample_pages;
qemu_thread_create(&thread, "get_dirtyrate", get_dirtyrate_thread,
(void *)&config, QEMU_THREAD_DETACHED);
}
diff --git a/migration/dirtyrate.h b/migration/dirtyrate.h
index 6ec429534d..e1fd29089e 100644
--- a/migration/dirtyrate.h
+++ b/migration/dirtyrate.h
@@ -15,7 +15,6 @@
/*
* Sample 512 pages per GB as default.
- * TODO: Make it configurable.
*/
#define DIRTYRATE_DEFAULT_SAMPLE_PAGES 512
@@ -35,6 +34,12 @@
#define MIN_FETCH_DIRTYRATE_TIME_SEC 1
#define MAX_FETCH_DIRTYRATE_TIME_SEC 60
+/*
+ * Take 1/16 pages in 1G as the maxmum sample page count
+ */
+#define MIN_SAMPLE_PAGE_COUNT 128
+#define MAX_SAMPLE_PAGE_COUNT 16384
+
struct DirtyRateConfig {
uint64_t sample_pages_per_gigabytes; /* sample pages per GB */
int64_t sample_period_seconds; /* time duration between two sampling */
@@ -63,6 +68,7 @@ struct DirtyRateStat {
int64_t dirty_rate; /* dirty rate in MB/s */
int64_t start_time; /* calculation start time in units of second */
int64_t calc_time; /* time duration of two sampling in units of second */
+ uint64_t sample_pages; /* sample pages per GB */
};
void *get_dirtyrate_thread(void *arg);
diff --git a/qapi/migration.json b/qapi/migration.json
index 7a5bdf9a0d..1124a2dda8 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1740,6 +1740,9 @@
#
# @calc-time: time in units of second for sample dirty pages
#
+# @sample-pages: page count per GB for sample dirty pages
+# the default value is 512 (since 6.1)
+#
# Since: 5.2
#
##
@@ -1747,7 +1750,8 @@
'data': {'*dirty-rate': 'int64',
'status': 'DirtyRateStatus',
'start-time': 'int64',
- 'calc-time': 'int64'} }
+ 'calc-time': 'int64',
+ 'sample-pages': 'uint64'} }
##
# @calc-dirty-rate:
@@ -1756,13 +1760,18 @@
#
# @calc-time: time in units of second for sample dirty pages
#
+# @sample-pages: page count per GB for sample dirty pages
+# the default value is 512 (since 6.1)
+#
# Since: 5.2
#
# Example:
-# {"command": "calc-dirty-rate", "data": {"calc-time": 1} }
+# {"command": "calc-dirty-rate", "data": {"calc-time": 1,
+# 'sample-pages': 512} }
#
##
-{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64'} }
+{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
+ '*sample-pages': 'int'} }
##
# @query-dirty-rate:
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PULL 9/9] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (7 preceding siblings ...)
2021-06-09 14:45 ` [PULL 8/9] migration/dirtyrate: make sample page count configurable Dr. David Alan Gilbert (git)
@ 2021-06-09 14:45 ` Dr. David Alan Gilbert (git)
2021-06-09 16:56 ` [PULL 0/9] migration queue Peter Maydell
2021-06-14 22:06 ` no-reply
10 siblings, 0 replies; 18+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2021-06-09 14:45 UTC (permalink / raw
To: qemu-devel, huangy81, peterx, lizhijian, leobras.c, pabeni
From: Peter Xu <peterx@redhat.com>
These two commands are missing when adding the QMP sister commands.
Add them, so developers can play with them easier.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Message-Id: <4cc0039fc3ad6145136770cf3b0f056c09a2910b.1623027729.git.huangy81@chinatelecom.cn>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hmp-commands-info.hx | 13 ++++++++++++
hmp-commands.hx | 14 +++++++++++++
include/monitor/hmp.h | 2 ++
migration/dirtyrate.c | 47 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+)
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index b2347a6aea..fb59c27200 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -867,3 +867,16 @@ SRST
``info replay``
Display the record/replay information: mode and the current icount.
ERST
+
+ {
+ .name = "dirty_rate",
+ .args_type = "",
+ .params = "",
+ .help = "show dirty rate information",
+ .cmd = hmp_info_dirty_rate,
+ },
+
+SRST
+ ``info dirty_rate``
+ Display the vcpu dirty rate information.
+ERST
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 2d21fe5ad4..84dcc3aae6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1727,3 +1727,17 @@ ERST
.flags = "p",
},
+SRST
+``calc_dirty_rate`` *second*
+ Start a round of dirty rate measurement with the period specified in *second*.
+ The result of the dirty rate measurement may be observed with ``info
+ dirty_rate`` command.
+ERST
+
+ {
+ .name = "calc_dirty_rate",
+ .args_type = "second:l,sample_pages_per_GB:l?",
+ .params = "second [sample_pages_per_GB]",
+ .help = "start a round of guest dirty rate measurement",
+ .cmd = hmp_calc_dirty_rate,
+ },
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index 605d57287a..3baa1058e2 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -129,5 +129,7 @@ void hmp_info_replay(Monitor *mon, const QDict *qdict);
void hmp_replay_break(Monitor *mon, const QDict *qdict);
void hmp_replay_delete_break(Monitor *mon, const QDict *qdict);
void hmp_replay_seek(Monitor *mon, const QDict *qdict);
+void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict);
+void hmp_calc_dirty_rate(Monitor *mon, const QDict *qdict);
#endif
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index 2ee3890721..320c56ba2c 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -20,6 +20,9 @@
#include "ram.h"
#include "trace.h"
#include "dirtyrate.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+#include "qapi/qmp/qdict.h"
static int CalculatingState = DIRTY_RATE_STATUS_UNSTARTED;
static struct DirtyRateStat DirtyStat;
@@ -447,3 +450,47 @@ struct DirtyRateInfo *qmp_query_dirty_rate(Error **errp)
{
return query_dirty_rate_info();
}
+
+void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict)
+{
+ DirtyRateInfo *info = query_dirty_rate_info();
+
+ monitor_printf(mon, "Status: %s\n",
+ DirtyRateStatus_str(info->status));
+ monitor_printf(mon, "Start Time: %"PRIi64" (ms)\n",
+ info->start_time);
+ monitor_printf(mon, "Sample Pages: %"PRIu64" (per GB)\n",
+ info->sample_pages);
+ monitor_printf(mon, "Period: %"PRIi64" (sec)\n",
+ info->calc_time);
+ monitor_printf(mon, "Dirty rate: ");
+ if (info->has_dirty_rate) {
+ monitor_printf(mon, "%"PRIi64" (MB/s)\n", info->dirty_rate);
+ } else {
+ monitor_printf(mon, "(not ready)\n");
+ }
+ g_free(info);
+}
+
+void hmp_calc_dirty_rate(Monitor *mon, const QDict *qdict)
+{
+ int64_t sec = qdict_get_try_int(qdict, "second", 0);
+ int64_t sample_pages = qdict_get_try_int(qdict, "sample_pages_per_GB", -1);
+ bool has_sample_pages = (sample_pages != -1);
+ Error *err = NULL;
+
+ if (!sec) {
+ monitor_printf(mon, "Incorrect period length specified!\n");
+ return;
+ }
+
+ qmp_calc_dirty_rate(sec, has_sample_pages, sample_pages, &err);
+ if (err) {
+ hmp_handle_error(mon, err);
+ return;
+ }
+
+ monitor_printf(mon, "Starting dirty rate measurement with period %"PRIi64
+ " seconds\n", sec);
+ monitor_printf(mon, "[Please use 'info dirty_rate' to check results]\n");
+}
--
2.31.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PULL 0/9] migration queue
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (8 preceding siblings ...)
2021-06-09 14:45 ` [PULL 9/9] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds Dr. David Alan Gilbert (git)
@ 2021-06-09 16:56 ` Peter Maydell
2021-06-14 22:06 ` no-reply
10 siblings, 0 replies; 18+ messages in thread
From: Peter Maydell @ 2021-06-09 16:56 UTC (permalink / raw
To: Dr. David Alan Gilbert (git)
Cc: leobras.c, Li Zhijian, huangy81, QEMU Developers, Peter Xu,
pabeni
On Wed, 9 Jun 2021 at 15:47, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
>
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit a4716fd8d7c877185652f5f8e25032dc7699d51b:
>
> Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20210608-1' into staging (2021-06-08 13:54:23 +0100)
>
> are available in the Git repository at:
>
> https://gitlab.com/dagrh/qemu.git tags/pull-migration-20210609a
>
> for you to fetch changes up to a4a571d97866d056787d7a654be5792765be8a60:
>
> hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds (2021-06-08 20:18:26 +0100)
>
> ----------------------------------------------------------------
> Migration pull for 2021-06-09
>
> Yank crash fix from Leo
> RDMA fix from Li
> mptcp support from me
> dirty-rate changes from Hyman and Peter
>
> (Note I've switched to the gitlab I've been using for virtiofs pulls)
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PULL 1/9] yank: Unregister function when using TLS migration
2021-06-09 14:45 ` [PULL 1/9] yank: Unregister function when using TLS migration Dr. David Alan Gilbert (git)
@ 2021-06-14 5:14 ` Philippe Mathieu-Daudé
2021-06-15 21:17 ` Leonardo Brás
0 siblings, 1 reply; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-06-14 5:14 UTC (permalink / raw
To: Dr. David Alan Gilbert (git), qemu-devel, huangy81, peterx,
lizhijian, leobras.c, pabeni
Hi Leonardo,
On 6/9/21 4:45 PM, Dr. David Alan Gilbert (git) wrote:
> From: Leonardo Bras <leobras.c@gmail.com>
>
> After yank feature was introduced in migration, whenever migration
> is started using TLS, the following error happens in both source and
> destination hosts:
>
> (qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance:
> Assertion `QLIST_EMPTY(&entry->yankfns)' failed.
>
> This happens because of a missing yank_unregister_function() when using
> qio-channel-tls.
>
> Fix this by also allowing TYPE_QIO_CHANNEL_TLS object type to perform
> yank_unregister_function() in channel_close() and multifd_load_cleanup().
>
> Also, inside migration_channel_connect() and
> migration_channel_process_incoming() move yank_register_function() so
> it only runs once on a TLS migration.
>
> Fixes: b5eea99ec2f ("migration: Add yank feature", 2021-01-13)
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1964326
> Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
> Reviewed-by: Lukas Straub <lukasstraub2@web.de>
> Reviewed-by: Peter Xu <peterx@redhat.com>
>
> --
Please use the '---' separator, otherwise tools don't strip
out your comments and they end in the repository, adding
confusion.
> Changes since v2:
> - Dropped all references to ioc->master
> - yank_register_function() and yank_unregister_function() now only run
> once in a TLS migration.
>
> Changes since v1:
> - Cast p->c to QIOChannelTLS into multifd_load_cleanup()
> Message-Id: <20210601054030.1153249-1-leobras.c@gmail.com>
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> migration/channel.c | 26 ++++++++++++++------------
> migration/multifd.c | 3 ++-
> migration/qemu-file-channel.c | 4 +++-
> 3 files changed, 19 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PULL 0/9] migration queue
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
` (9 preceding siblings ...)
2021-06-09 16:56 ` [PULL 0/9] migration queue Peter Maydell
@ 2021-06-14 22:06 ` no-reply
10 siblings, 0 replies; 18+ messages in thread
From: no-reply @ 2021-06-14 22:06 UTC (permalink / raw
To: dgilbert; +Cc: leobras.c, lizhijian, huangy81, qemu-devel, peterx, pabeni
Patchew URL: https://patchew.org/QEMU/20210609144512.211746-1-dgilbert@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20210609144512.211746-1-dgilbert@redhat.com
Subject: [PULL 0/9] migration queue
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20210609184955.1193081-1-philmd@redhat.com -> patchew/20210609184955.1193081-1-philmd@redhat.com
* [new tag] patchew/20210611120427.49736-1-berrange@redhat.com -> patchew/20210611120427.49736-1-berrange@redhat.com
* [new tag] patchew/20210613141222.548357-1-lukas.juenger@greensocs.com -> patchew/20210613141222.548357-1-lukas.juenger@greensocs.com
Switched to a new branch 'test'
=== OUTPUT BEGIN ===
checkpatch.pl: no revisions returned for revlist 'base..'
=== OUTPUT END ===
Test command exited with code: 255
The full log is available at
http://patchew.org/logs/20210609144512.211746-1-dgilbert@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PULL 1/9] yank: Unregister function when using TLS migration
2021-06-14 5:14 ` Philippe Mathieu-Daudé
@ 2021-06-15 21:17 ` Leonardo Brás
0 siblings, 0 replies; 18+ messages in thread
From: Leonardo Brás @ 2021-06-15 21:17 UTC (permalink / raw
To: Philippe Mathieu-Daudé, Dr. David Alan Gilbert (git),
qemu-devel, huangy81, peterx, lizhijian, pabeni
On Mon, 2021-06-14 at 07:14 +0200, Philippe Mathieu-Daudé wrote:
> Hi Leonardo,
>
> On 6/9/21 4:45 PM, Dr. David Alan Gilbert (git) wrote:
> > From: Leonardo Bras <leobras.c@gmail.com>
> >
> > After yank feature was introduced in migration, whenever migration
> > is started using TLS, the following error happens in both source
> > and
> > destination hosts:
> >
> > (qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance:
> > Assertion `QLIST_EMPTY(&entry->yankfns)' failed.
> >
> > This happens because of a missing yank_unregister_function() when
> > using
> > qio-channel-tls.
> >
> > Fix this by also allowing TYPE_QIO_CHANNEL_TLS object type to
> > perform
> > yank_unregister_function() in channel_close() and
> > multifd_load_cleanup().
> >
> > Also, inside migration_channel_connect() and
> > migration_channel_process_incoming() move yank_register_function()
> > so
> > it only runs once on a TLS migration.
> >
> > Fixes: b5eea99ec2f ("migration: Add yank feature", 2021-01-13)
> > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1964326
> > Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
> > Reviewed-by: Lukas Straub <lukasstraub2@web.de>
> > Reviewed-by: Peter Xu <peterx@redhat.com>
> >
> > --
>
> Please use the '---' separator, otherwise tools don't strip
> out your comments and they end in the repository, adding
> confusion.
>
Sure, sorry about that.
> > Changes since v2:
> > - Dropped all references to ioc->master
> > - yank_register_function() and yank_unregister_function() now only
> > run
> > once in a TLS migration.
> >
> > Changes since v1:
> > - Cast p->c to QIOChannelTLS into multifd_load_cleanup()
> > Message-Id: <20210601054030.1153249-1-leobras.c@gmail.com>
> >
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> > migration/channel.c | 26 ++++++++++++++------------
> > migration/multifd.c | 3 ++-
> > migration/qemu-file-channel.c | 4 +++-
> > 3 files changed, 19 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2021-06-15 21:18 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-09 14:45 [PULL 0/9] migration queue Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 1/9] yank: Unregister function when using TLS migration Dr. David Alan Gilbert (git)
2021-06-14 5:14 ` Philippe Mathieu-Daudé
2021-06-15 21:17 ` Leonardo Brás
2021-06-09 14:45 ` [PULL 2/9] migration/rdma: Fix cm event use after free Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 3/9] channel-socket: Only set CLOEXEC if we have space for fds Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 4/9] io/net-listener: Call the notifier during finalize Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 5/9] migration: Add cleanup hook for inwards migration Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 6/9] migration/socket: Close the listener at the end Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 7/9] sockets: Support multipath TCP Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 8/9] migration/dirtyrate: make sample page count configurable Dr. David Alan Gilbert (git)
2021-06-09 14:45 ` [PULL 9/9] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds Dr. David Alan Gilbert (git)
2021-06-09 16:56 ` [PULL 0/9] migration queue Peter Maydell
2021-06-14 22:06 ` no-reply
-- strict thread matches above, loose matches on Subject: below --
2020-03-25 13:16 Dr. David Alan Gilbert (git)
2020-03-26 10:46 ` Peter Maydell
2019-09-25 15:01 Dr. David Alan Gilbert (git)
2019-09-26 15:13 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.