"Michael S. Tsirkin" wrote:
...
>> but u32 don't fit in u8. And we read u32 into u8. I agree that writing
>> u8 into u32 is not a problem, the problem is the reverse.
>
> So don't read u32 into u8.
> Read data into u32, check that the value fits into u8, fail migration
> if it does not, assign
On Wed, Dec 02, 2009 at 08:18:40PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
> > On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
> >>
> >> Signed-off-by: Juan Quintela
> >> ---
> >> hw/virtio-net.c | 148
> >> -
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 07:38:03PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" 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_*
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
>>
>> Signed-off-by: Juan Quintela
>> ---
>> hw/virtio-net.c | 148
>> ---
>> 1 files changed, 64 insertions(+), 84 deletions(-)
>>
>> diff --git a
On Wed, Dec 02, 2009 at 07:38:03PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
> > On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
> >>
> >> Signed-off-by: Juan Quintela
> >> ---
> >> hw/virtio-net.c | 148
> >> -
On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
>
> Signed-off-by: Juan Quintela
> ---
> hw/virtio-net.c | 148
> ---
> 1 files changed, 64 insertions(+), 84 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> in
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
>>
>> Signed-off-by: Juan Quintela
>> ---
>> hw/virtio-net.c | 148
>> ---
>> 1 files changed, 64 insertions(+), 84 deletions(-)
>>
>> diff --git a
On Wed, Dec 02, 2009 at 01:04:31PM +0100, Juan Quintela wrote:
>
> Signed-off-by: Juan Quintela
> ---
> hw/virtio-net.c | 148
> ---
> 1 files changed, 64 insertions(+), 84 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> in