[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] migration/ram: only possible bit set in invalid_flags is
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 1/4] migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE |
Date: |
Tue, 8 Oct 2019 18:38:25 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
* Wei Yang (address@hidden) wrote:
> The only possible bit set in invalid_flags is
> RAM_SAVE_FLAG_COMPRESS_PAGE at the beginning of function
> ram_load_precopy(), which means it is not necessary to do
> another check for RAM_SAVE_FLAG_COMPRESS_PAGE bit.
>
> Signed-off-by: Wei Yang <address@hidden>
> ---
> migration/ram.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 31051935c8..769d3f6454 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -4263,10 +4263,7 @@ static int ram_load_precopy(QEMUFile *f)
> addr &= TARGET_PAGE_MASK;
>
> if (flags & invalid_flags) {
> - if (flags & invalid_flags & RAM_SAVE_FLAG_COMPRESS_PAGE) {
> - error_report("Received an unexpected compressed page");
> - }
> -
> + error_report("Received an unexpected compressed page");
> ret = -EINVAL;
I'd rather keep this one; I think Juan's idea is that we might make
other flags illegal here and then it's easy to add to invalid_flags at
the top.
Dave
> break;
> }
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [PATCH 0/4] migration: trivial cleanup and refine, Wei Yang, 2019/10/05
- [PATCH 1/4] migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE, Wei Yang, 2019/10/05
- Re: [PATCH 1/4] migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE,
Dr. David Alan Gilbert <=
- [PATCH 2/4] migration/postcopy: fix typo in mark_postcopy_blocktime_begin's comment, Wei Yang, 2019/10/05
- [PATCH 4/4] migration: report SaveStateEntry id and name on failure, Wei Yang, 2019/10/05
- [PATCH 3/4] migration: pass in_postcopy instead of check state again, Wei Yang, 2019/10/05
- Re: [PATCH 0/4] migration: trivial cleanup and refine, Dr. David Alan Gilbert, 2019/10/11