* [Qemu-devel] [PATCH] vmstate: check subsection_found is enough
@ 2019-04-02 2:57 Wei Yang
2019-04-02 18:44 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yang @ 2019-04-02 2:57 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, Wei Yang
subsection_found is true implies vmdesc is not NULL.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
migration/vmstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/vmstate.c b/migration/vmstate.c
index e2bbb7b5f7..8327179eea 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -533,7 +533,7 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,
sub++;
}
- if (vmdesc && subsection_found) {
+ if (subsection_found) {
json_end_array(vmdesc);
}
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] vmstate: check subsection_found is enough
2019-04-02 2:57 [Qemu-devel] [PATCH] vmstate: check subsection_found is enough Wei Yang
@ 2019-04-02 18:44 ` Dr. David Alan Gilbert
2019-04-03 1:03 ` Wei Yang
0 siblings, 1 reply; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2019-04-02 18:44 UTC (permalink / raw)
To: Wei Yang; +Cc: qemu-devel, quintela
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> subsection_found is true implies vmdesc is not NULL.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
> migration/vmstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/migration/vmstate.c b/migration/vmstate.c
> index e2bbb7b5f7..8327179eea 100644
> --- a/migration/vmstate.c
> +++ b/migration/vmstate.c
> @@ -533,7 +533,7 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,
> sub++;
> }
>
> - if (vmdesc && subsection_found) {
> + if (subsection_found) {
That's true, however it's not obvious from the names; I think
we should probably rename 'subsection_found' to something like
'vmdesc_has_subsections' then it's more obvious that subsection_found
is more specialised in this routine.
Dave
> json_end_array(vmdesc);
> }
>
> --
> 2.19.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] vmstate: check subsection_found is enough
2019-04-02 18:44 ` Dr. David Alan Gilbert
@ 2019-04-03 1:03 ` Wei Yang
0 siblings, 0 replies; 3+ messages in thread
From: Wei Yang @ 2019-04-03 1:03 UTC (permalink / raw)
To: Dr. David Alan Gilbert; +Cc: Wei Yang, qemu-devel, quintela
On Tue, Apr 02, 2019 at 07:44:23PM +0100, Dr. David Alan Gilbert wrote:
>* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> subsection_found is true implies vmdesc is not NULL.
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>> migration/vmstate.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/migration/vmstate.c b/migration/vmstate.c
>> index e2bbb7b5f7..8327179eea 100644
>> --- a/migration/vmstate.c
>> +++ b/migration/vmstate.c
>> @@ -533,7 +533,7 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,
>> sub++;
>> }
>>
>> - if (vmdesc && subsection_found) {
>> + if (subsection_found) {
>
>That's true, however it's not obvious from the names; I think
>we should probably rename 'subsection_found' to something like
>'vmdesc_has_subsections' then it's more obvious that subsection_found
>is more specialised in this routine.
Reasonable, let me change it :-)
>
>Dave
>
>
>> json_end_array(vmdesc);
>> }
>>
>> --
>> 2.19.1
>>
>--
>Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-03 1:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-02 2:57 [Qemu-devel] [PATCH] vmstate: check subsection_found is enough Wei Yang
2019-04-02 18:44 ` Dr. David Alan Gilbert
2019-04-03 1:03 ` Wei Yang
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).