[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 33/41] virtio-net: port to vmstate
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCH 33/41] virtio-net: port to vmstate |
Date: |
Wed, 02 Dec 2009 20:07:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
"Michael S. Tsirkin" <address@hidden> wrote:
> On Wed, Dec 02, 2009 at 07:38:03PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" <address@hidden> wrote:
> I expect it fits in practice.
> But you should range check the value and fail migration on error.
>
>> That is only
>> needed for old versions that we are reading (get_* function has real
>> code). But we are supposed to never write old versions (*).
>> Thet that shouldn't happen ever.
>
> vmstate guarantees this won't be called?
No, I express it badly. That function should never be called. It is a
compatibility type for old versions. Only get() part should be used.
What should be guaranteed is that you protect that with a test or
something to assure that only the get() part is ever used, not the put()
one.
> So just assert(1)? Let's not write a ton of
> code that isn't called?
options are:
a- put a NULL value in the struct, and if there are ever an error get a
segmentation fault.
b- put a function that just writes "the impossible happened in <foo>"
and exit.
I don't know where do you want me to put one assert.
Later, Juan.
>> > when
>> > is this called? Please supply a comment.
>> > Maybe call assert?
>> >
>>
>> assert or exit is ok for me, what does people preffer?
>>
>> Later, Juan.
>>
>> (*): My next series will propose to change that and allow to write old
>> versions, but that didn't exist when this code was written, and
>> there are still no agreement about how/if doing it.
[Qemu-devel] Re: [PATCH 33/41] virtio-net: port to vmstate, Michael S. Tsirkin, 2009/12/02
[Qemu-devel] [PATCH 34/41] virtio-console: port to vmstate, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 35/41] virtio-balloon: port to vmstate, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 36/41] virtio-blk: change rq type to VirtIOBlockReq, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 37/41] QLIST: Introduce QLIST_COPY_HEAD, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 38/41] virtio-blk: use QLIST for the list of requests, Juan Quintela, 2009/12/02