[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] spapr-vscsi: Adding VSCSI capabilities

From: Nikunj A Dadhania
Subject: Re: [Qemu-ppc] [PATCH] spapr-vscsi: Adding VSCSI capabilities
Date: Tue, 27 Aug 2013 10:41:47 +0530
User-agent: Notmuch/0.14+104~g0a21fb9 (http://notmuchmail.org) Emacs/ (x86_64-unknown-linux-gnu)

Paolo Bonzini <address@hidden> writes:

> Il 26/08/2013 11:06, Nikunj A Dadhania ha scritto:
>>>> +        fprintf(stderr, "vscsi_send_capabilities: size out of bound !\n");
>>>> +        goto error_out;
>>>> +    }
>>> I am not 100% familiar with the protocol, could it be that we should
>>> just read sizeof(cap) instead of erroring out or is there no way it
>>> can be correct and have a len too long ?
>> If the length is incorrect, can we trust whether cap is correct or is of
>> the type we are expecting?
> We shouldn't care, it'd be a guest bug.

Then we can do a warning on the size and set only the parts supported.

This is a kind of negotiating capabilities, where the guest says that I
can support following vscsi capabilities, hypervisor if it has
implemented them should return back with affirmative for the
capabilities supported. If not, tell the guest that hypervisor cannot

> If the guest is asking for say 1024 bytes, we do not have to fill all of
> them.  It is in principle possible that a subsequent revision of vscsi
> will make the struct larger; perhaps a bit in the first part of the
> struct will tell the guest if the second part has been filled.
> Unless the spec explicitly say the opposite, I would just zero the bytes
> between sizeof(cap) and len.

Makes sense. I will change the patch accordingly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]