From: Anthony Liguori <anthony@codemonkey.ws>
To: Alon Levy <alevy@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/2] usb-ccid device (v2)
Date: Tue, 12 Oct 2010 13:23:21 -0500 [thread overview]
Message-ID: <4CB4A799.50903@codemonkey.ws> (raw)
In-Reply-To: <855601437.226331286903377080.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
On 10/12/2010 12:09 PM, Alon Levy wrote:
> The smart card is not being migrated. It is running on the client machine,
> which is not being migrated/shutdown (same as vncviewer isn't migrated).
>
>
Ok, let's look at this compared to another similar use-case: USB
passthrough of a webcam device that's remoted using USB over IP.
In this model, you have a USB bus that's modelled as a bus and a
device. Within the USB bus, you have additional devices. These are all
qdev devices and they may be emulated or they may be implemented using
passthrough. While we don't do it today, USB over IP would be just
another form of passthrough.
Migration is a rather interesting challenge in this model. You've got a
mix of client state and server state on the USB over IP connection. You
could marshal up the client state and as long as you reconnected to the
same server on the destination, I guess it would be okay.
I think the problem with your current implementation is that you've
completed skipped the bus modelling and you're also using the Device
over IP connection to implement device emulation.
What I would suggest is that you model the bus/device relationship via
qdev and move the Smart Card emulation into QEMU. I would also suggest
adding proper passthrough support in QEMU. CCID over IP is a reasonable
thing to have but I think you've got way too much outside of QEMU right
now such that long term maintenance is going to be exceedingly difficult.
Regards,
Anthony Liguori
>> I don't understand the use-case behind this. Is this so that a local
>>
>> physical smart card can be passed through to a guest from a Spice
>> client
>> and when migration happens, the QEMU instance connects back to the
>> Spice
>> client? So the device is never actually migrated?
>>
>>
> The *smart card* is never migrated. The ccid device is. Here is the scenario:
>
> Host A: qemu_a
> qemu_a: guest
>
> Host B: vscclient
> - physical reader
>
> Host C: qemu_b -incoming ..
>
> yes, we will use this for SPICE, but this is submitted
> to qemu on the hopes and with testing ensuring it is perfectly usable as is
> without using SPICE, otherwise I wouldn't have sent it upstream.
>
> non-SPICE usage:
>
> 1. user on B runs vscclient (and presumably the user has some connection to the guest to use the smartcard device, i.e. vnc/ssh/spice, but that's not relevant).
> 2. vscclient connects via tcp to qemu_a.
> 3. qemu_a starts migrating to qemu_b.
> (qemu_b is alive at this point, can receive incoming tcp connections on chardev - otherwise a migration fails immediately anyway)
> 4. pre_load for usb-ccid sends a Reconnect message
> 5. vscclient gets the Reconnect message, closes socket to qemu_a, opens socket to qemu_b
> 6. from guest pov nothing happened (no device detach/attach).
>
> I have to stress that the main problem the migration intends to solve is to avoid a detach/attach in the guest. Actual
> operations on the smartcard could possibly fail as a result of the migration, and it would not be a real problem (i.e.
> we could live without, but we can't leave with a lock of the guest screen as a result of a migration). Which is why I
> consider the current code good enough. It is certainly not perfect (short packet issue), or tested enough.
>
> The SPICE usage scenario is basically the same, just replace vscclient with spicec, and
> we don't need the Reconnect message since SPICE takes care of this for us (we just get
> a channel detach/attach event if we care).
> 1. user on B runs spicec
> 2. spicec connects to qemu via spice channel, smart card channel connects to usb-ccid device via spicevmc chardev (so it doesn't care it's spice or not).
> 3. qemu_a migrates
> 4. spicec disconnects from qemu_a and connects to qemu_b
> 5. from guest os pov nothing happens on the ccid usb device.
>
>
>> Regards,
>>
>> Anthony Liguori
>>
next prev parent reply other threads:[~2010-10-12 18:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <593949580.216281286900989465.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-12 16:43 ` [Qemu-devel] [PATCH 0/2] usb-ccid device (v2) Alon Levy
2010-10-12 16:49 ` Anthony Liguori
2010-10-12 17:09 ` Alon Levy
2010-10-12 18:23 ` Anthony Liguori [this message]
2010-10-13 11:54 ` Alon Levy
2010-10-14 18:37 Robert Relyea
2010-10-14 18:52 ` Anthony Liguori
2010-10-14 22:03 ` Robert Relyea
2010-10-14 22:16 ` Anthony Liguori
2010-10-15 0:16 ` Robert Relyea
[not found] <1045788737.212361286898758903.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-12 16:03 ` Alon Levy
2010-10-12 16:21 ` Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2010-10-12 12:58 Alon Levy
2010-10-12 13:24 ` Anthony Liguori
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=4CB4A799.50903@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=alevy@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).