From: Igor Mitsyanko <i.mitsyanko@samsung.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: peter.maydell@linaro.org, d.solodkiy@samsung.com,
qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2 5/5] vmstate: introduce get_bufsize entry in VMStateField
Date: Wed, 14 Mar 2012 18:07:05 +0400 [thread overview]
Message-ID: <4F60A609.4070502@samsung.com> (raw)
In-Reply-To: <4F60955E.6060204@suse.de>
On 03/14/2012 04:55 PM, Andreas Färber wrote:
> Am 05.03.2012 09:30, schrieb Igor Mitsyanko:
>> New get_bufsize field in VMStateField is supposed to help us easily add save/restore
>> support of dynamically allocated buffers in device's states.
>> There are some cases when information about size of dynamically allocated buffer is
>> already presented in specific device's state structure, but in such a form that
>> can not be used with existing VMStateField interface. Currently, we either can get size from
>> another variable in device's state as it is with VMSTATE_VBUFFER_* macros, or we can
>> also multiply value kept in a variable by a constant with VMSTATE_BUFFER_MULTIPLY
>> macro. If we need to perform any other action, we're forced to add additional
>> variable with size information to device state structure with the only intention
>> to use it in VMStateDescription. This approach is not very pretty. Adding extra
>> flags to VMStateFlags enum for every other possible operation with size field
>> seems redundant, and still it would't cover cases when we need to perform a set of
>> operations to get size value.
>> With get_bufsize callback we can calculate size of dynamic array in whichever
>> way we need. We don't need .size_offset field anymore, so we can remove it from
>> VMState Field structure to compensate for extra memory consuption because of
>> get_bufsize addition. Macros VMSTATE_VBUFFER* are modified to use new callback
>> instead of .size_offset. Macro VMSTATE_BUFFER_MULTIPLY and VMFlag VMS_MULTIPLY
>> are removed completely as they are now redundant.
>>
>> Signed-off-by: Igor Mitsyanko<i.mitsyanko@samsung.com>
>
> Apart from this commit message being an overwhelmingly huge block of
> text ;) (maybe insert an empty line or two?)
OK :)
this had touched on the
> overall discussion of whether to pursue a declarative or imperative
> approach for VMState.
>
> So, what about adding this as a new, optional mechanism and leaving
> VBUFFER / BUFFER_MULTIPLY users untouched?
I don't mind.
Now that we decided (in another thread) against live saving of wp_groups
in SDState, the question with this patch arises again: do we need to
introduce get_bufsize or we should just use additional member in SDState
to hold wp_groups buffer size for use with current
VMSTATE_VBUFFER_UINT32 macro?
--
Mitsyanko Igor
ASWG, Moscow R&D center, Samsung Electronics
email: i.mitsyanko@samsung.com
next prev parent reply other threads:[~2012-03-14 14:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 8:30 [Qemu-devel] [PATCH V2 0/5] VMState cleanups Igor Mitsyanko
2012-03-05 8:30 ` [Qemu-devel] [PATCH V2 1/5] target-alpha/machine.c: use VMSTATE_UINT64* instead of VMSTATE_UINTTL* Igor Mitsyanko
2012-03-05 8:30 ` [Qemu-devel] [PATCH V2 2/5] hw/pxa2xx_dma.c: drop target_phys_addr_t usage in device state Igor Mitsyanko
2012-03-14 12:42 ` Andreas Färber
2012-03-14 17:11 ` Michael Roth
2012-03-05 8:30 ` [Qemu-devel] [PATCH V2 3/5] hw/pxa2xx_lcd.c: " Igor Mitsyanko
2012-03-14 12:48 ` Andreas Färber
2012-03-05 8:30 ` [Qemu-devel] [PATCH V2 4/5] vmstate: move VMSTATE_UINTTL* macros definitions to cpu-defs.h Igor Mitsyanko
2012-03-05 8:30 ` [Qemu-devel] [PATCH V2 5/5] vmstate: introduce get_bufsize entry in VMStateField Igor Mitsyanko
2012-03-14 12:55 ` Andreas Färber
2012-03-14 14:07 ` Igor Mitsyanko [this message]
2012-03-14 12:30 ` [Qemu-devel] [PATCH V2 0/5] VMState cleanups Peter Maydell
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=4F60A609.4070502@samsung.com \
--to=i.mitsyanko@samsung.com \
--cc=afaerber@suse.de \
--cc=d.solodkiy@samsung.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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.