* [Qemu-devel] [PATCH] spapr/htab: fix savevm
@ 2017-07-18 8:05 Laurent Vivier
2017-07-18 9:33 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2017-07-18 8:05 UTC (permalink / raw)
To: qemu-devel
Cc: peter.maydell, thuth, Bharata B Rao, sursingh, mdroth,
David Gibson, qemu-ppc, sbobroff
Commit 3a38429 ("spapr: Add a "no HPT" encoding to HTAB migration stream")
allows to migrate an empty HPT, but doesn't mark correctly the
end of the migration stream.
The end condition (value returned by htab_save_iterate() and
htab_save_complete()) should be 1, whereas in 3a38429 they
return 0.
The problem can be reproduced with QEMU monitor command "savevm":
the command never stops and the disk image grows without limit.
Fixes: 3a38429748aa4f74abaecf16c4c087e8a325e12a
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/ppc/spapr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 970093e..fa01511 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1827,7 +1827,7 @@ static int htab_save_iterate(QEMUFile *f, void *opaque)
/* Iteration header */
if (!spapr->htab_shift) {
qemu_put_be32(f, -1);
- return 0;
+ return 1;
} else {
qemu_put_be32(f, 0);
}
@@ -1866,7 +1866,7 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
/* Iteration header */
if (!spapr->htab_shift) {
qemu_put_be32(f, -1);
- return 0;
+ return 1;
} else {
qemu_put_be32(f, 0);
}
--
2.9.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr/htab: fix savevm
2017-07-18 8:05 [Qemu-devel] [PATCH] spapr/htab: fix savevm Laurent Vivier
@ 2017-07-18 9:33 ` Thomas Huth
2017-07-18 10:03 ` Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2017-07-18 9:33 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel
Cc: peter.maydell, Bharata B Rao, sursingh, mdroth, David Gibson,
qemu-ppc, sbobroff
On 18.07.2017 10:05, Laurent Vivier wrote:
> Commit 3a38429 ("spapr: Add a "no HPT" encoding to HTAB migration stream")
> allows to migrate an empty HPT, but doesn't mark correctly the
> end of the migration stream.
>
> The end condition (value returned by htab_save_iterate() and
> htab_save_complete()) should be 1, whereas in 3a38429 they
> return 0.
>
> The problem can be reproduced with QEMU monitor command "savevm":
> the command never stops and the disk image grows without limit.
>
> Fixes: 3a38429748aa4f74abaecf16c4c087e8a325e12a
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> hw/ppc/spapr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 970093e..fa01511 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1827,7 +1827,7 @@ static int htab_save_iterate(QEMUFile *f, void *opaque)
> /* Iteration header */
> if (!spapr->htab_shift) {
> qemu_put_be32(f, -1);
> - return 0;
> + return 1;
> } else {
> qemu_put_be32(f, 0);
> }
> @@ -1866,7 +1866,7 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
> /* Iteration header */
> if (!spapr->htab_shift) {
> qemu_put_be32(f, -1);
> - return 0;
> + return 1;
> } else {
> qemu_put_be32(f, 0);
> }
>
I think you only need to change htab_save_iterate(), but not
htab_save_complete(), don't you? "1" does not seem to have any real
meaning for the *save_complete functions, as far as I can see.
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr/htab: fix savevm
2017-07-18 9:33 ` Thomas Huth
@ 2017-07-18 10:03 ` Laurent Vivier
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-07-18 10:03 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: peter.maydell, Bharata B Rao, sursingh, mdroth, David Gibson,
qemu-ppc, sbobroff
On 18/07/2017 11:33, Thomas Huth wrote:
> On 18.07.2017 10:05, Laurent Vivier wrote:
>> Commit 3a38429 ("spapr: Add a "no HPT" encoding to HTAB migration stream")
>> allows to migrate an empty HPT, but doesn't mark correctly the
>> end of the migration stream.
>>
>> The end condition (value returned by htab_save_iterate() and
>> htab_save_complete()) should be 1, whereas in 3a38429 they
>> return 0.
>>
>> The problem can be reproduced with QEMU monitor command "savevm":
>> the command never stops and the disk image grows without limit.
>>
>> Fixes: 3a38429748aa4f74abaecf16c4c087e8a325e12a
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>> hw/ppc/spapr.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index 970093e..fa01511 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -1827,7 +1827,7 @@ static int htab_save_iterate(QEMUFile *f, void *opaque)
>> /* Iteration header */
>> if (!spapr->htab_shift) {
>> qemu_put_be32(f, -1);
>> - return 0;
>> + return 1;
>> } else {
>> qemu_put_be32(f, 0);
>> }
>> @@ -1866,7 +1866,7 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
>> /* Iteration header */
>> if (!spapr->htab_shift) {
>> qemu_put_be32(f, -1);
>> - return 0;
>> + return 1;
>> } else {
>> qemu_put_be32(f, 0);
>> }
>>
>
> I think you only need to change htab_save_iterate(), but not
> htab_save_complete(), don't you? "1" does not seem to have any real
> meaning for the *save_complete functions, as far as I can see.
Yes, you're right, htab_save_complete() always returns 0 or an error (< 0).
I update the patch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-18 10:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 8:05 [Qemu-devel] [PATCH] spapr/htab: fix savevm Laurent Vivier
2017-07-18 9:33 ` Thomas Huth
2017-07-18 10:03 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).