From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Wei Wang <wei.w.wang@intel.com>
Cc: kevin.tian@intel.com, quintela@redhat.com, qemu-devel@nongnu.org,
peterx@redhat.com, dgilbert@redhat.com, gloryxiao@tencent.com,
yi.y.sun@intel.com
Subject: Re: [PATCH v1 1/2] migration/xbzrle: replace transferred xbzrle bytes with encoded bytes
Date: Mon, 20 Apr 2020 10:29:30 +0100 [thread overview]
Message-ID: <20200420092930.GH346737@redhat.com> (raw)
In-Reply-To: <1587352003-3312-2-git-send-email-wei.w.wang@intel.com>
On Mon, Apr 20, 2020 at 11:06:42AM +0800, Wei Wang wrote:
> Like compressed_size which indicates how many bytes are compressed, we
> need encoded_size to understand how many bytes are encoded with xbzrle
> during migration.
>
> Replace the old xbzrle_counter.bytes, instead of adding a new counter,
> because we don't find a usage of xbzrle_counter.bytes currently, which
> includes 3 more bytes of the migration transfer protocol header (in
> addition to the encoding header). The encoded_size will further be used
> to calculate the encoding rate.
>
> Signed-off-by: Yi Sun <yi.y.sun@intel.com>
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> ---
> migration/migration.c | 2 +-
> migration/ram.c | 18 +++++++++---------
> monitor/hmp-cmds.c | 4 ++--
> qapi/migration.json | 6 +++---
> 4 files changed, 15 insertions(+), 15 deletions(-)
> diff --git a/qapi/migration.json b/qapi/migration.json
> index eca2981d0a..bf195ff6ac 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -62,7 +62,7 @@
> #
> # @cache-size: XBZRLE cache size
> #
> -# @bytes: amount of bytes already transferred to the target VM
> +# @encoded_size: amount of bytes encoded
Woah, this is part of QEMU's public API, so it isn't permissible to just
arbitrarily remove a field with no warning, and replace it with a new
field reporting different data. Adding a new field is allowed, but any
existing field should be deprecated first, if there is a genuine need
to remove it. If it isn't costly though, just leave the existing field
unchanged.
I would also note that the other fields in this struct use a hyphen, not
an underscore.
> #
> # @pages: amount of pages transferred to the target VM
> #
> @@ -75,7 +75,7 @@
> # Since: 1.2
> ##
> { 'struct': 'XBZRLECacheStats',
> - 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
> + 'data': {'cache-size': 'int', 'encoded_size': 'int', 'pages': 'int',
> 'cache-miss': 'int', 'cache-miss-rate': 'number',
> 'overflow': 'int' } }
>
> @@ -333,7 +333,7 @@
> # },
> # "xbzrle-cache":{
> # "cache-size":67108864,
> -# "bytes":20971520,
> +# "encoded_size":20971520,
> # "pages":2444343,
> # "cache-miss":2244,
> # "cache-miss-rate":0.123,
> --
> 2.20.1
>
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-04-20 9:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 3:06 [PATCH v1 0/2] Migration xbzrle changes Wei Wang
2020-04-20 3:06 ` [PATCH v1 1/2] migration/xbzrle: replace transferred xbzrle bytes with encoded bytes Wei Wang
2020-04-20 9:29 ` Daniel P. Berrangé [this message]
2020-04-20 9:49 ` Wei Wang
2020-04-21 19:21 ` Dr. David Alan Gilbert
2020-04-22 2:51 ` Wei Wang
2020-04-24 10:47 ` Dr. David Alan Gilbert
2020-04-27 7:26 ` Wei Wang
2020-04-20 3:06 ` [PATCH v1 2/2] migration/xbzrle: add encoding rate Wei Wang
2020-04-20 9:30 ` Daniel P. Berrangé
2020-04-20 14:53 ` Eric Blake
2020-04-21 1:14 ` Wei Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200420092930.GH346737@redhat.com \
--to=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=gloryxiao@tencent.com \
--cc=kevin.tian@intel.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=wei.w.wang@intel.com \
--cc=yi.y.sun@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.