[Spice-devel] [PATCH 1/1] Allow missing capabilities from source host
Hans de Goede
hdegoede at redhat.com
Fri Oct 23 06:25:06 PDT 2015
Hi,
On 10/23/2015 03:09 PM, Christophe Fergeau wrote:
> Hey,
>
> On Mon, Sep 21, 2015 at 02:13:44PM +0100, Dr. David Alan Gilbert (git) wrote:
>> From: "Dr. David Alan Gilbert" <dgilbert at redhat.com>
>>
>> When loading a USB redirection stream during a qemu
>> migration, the source QEMU might be earlier and be missing
>> a bunch of capabilities that are now available in a more modern
>> version; allow this migration to work as long as the source
>> isn't claiming any capabilities that we don't have.
>>
>> (We should be a bit more careful about this in future in qemu;
>> we could tie any new capabilities we ask for to machine types).
>
> I don't think this was picked up? Hans, are you planning to pick this
> up,
IIRC I gave my reviewed-by for this already, in case I did not here it is:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Anyone in the spice group should be able to push to the usbredir repo...
Regards,
Hans
> or do you need help with the reviewing/testing?
>
> Thanks,
>
> Christophe
>
>>
>> Signed-off-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
>> ---
>> usbredirparser/usbredirparser.c | 22 ++++++++++++++++++----
>> 1 file changed, 18 insertions(+), 4 deletions(-)
>>
>> diff --git a/usbredirparser/usbredirparser.c b/usbredirparser/usbredirparser.c
>> index 8076b72..d1f9850 100644
>> --- a/usbredirparser/usbredirparser.c
>> +++ b/usbredirparser/usbredirparser.c
>> @@ -1682,10 +1682,24 @@ int usbredirparser_unserialize(struct usbredirparser *parser_pub,
>> memcpy(orig_caps, parser->our_caps, i);
>> if (unserialize_data(parser, &state, &remain, &data, &i, "our_caps"))
>> return -1;
>> - if (memcmp(parser->our_caps, orig_caps,
>> - USB_REDIR_CAPS_SIZE * sizeof(int32_t)) != 0) {
>> - ERROR("error unserialize caps mismatch");
>> - return -1;
>> + for (i =0; i < USB_REDIR_CAPS_SIZE; i++) {
>> + if (parser->our_caps[i] != orig_caps[i]) {
>> + /* orig_caps is our original settings
>> + * parser->our_caps is off the wire.
>> + * We want to allow reception from an older
>> + * usbredir that doesn't have all our features.
>> + */
>> + if (parser->our_caps[i] & ~orig_caps[i]) {
>> + /* Source has a cap we don't */
>> + ERROR("error unserialize caps mismatch ours: %x recv: %x",
>> + orig_caps[i], parser->our_caps[i]);
>> + return -1;
>> + } else {
>> + /* We've got a cap the source doesn't - that's OK */
>> + WARNING("unserialize missing some caps; ours: %x recv: %x",
>> + orig_caps[i], parser->our_caps[i]);
>> + }
>> + }
>> }
>>
>> data = (uint8_t *)parser->peer_caps;
>> --
>> 2.5.0
>>
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list