On 01/03/2011 06:39 AM, Paolo Bonzini wrote:
> On 12/23/2010 05:51 PM, Eric Blake wrote:
>> In the outgoing direction, we still have to use a unix socket (outgoing
>> migration is started via a monitor command, and I don't know how to pass
>> a new fd into qemu for using with an fd:n outgoing migration via the
>> monitor - it seems like fd is only useful on the command line).
>
> See qemuMonitorCommandWithFd and qemuMonitorJSONCommandWithFd.
I'm looking at this problem again, now that we know that qemu exec:
migration is inherently racy (see
https://bugzilla.redhat.com/show_bug.cgi?id=678524). I've managed to
work out the code to send an fd over to qemu, but how do I formulate the
fd:n migration command to use that fd? That is, if I call
qemuMonitorCommandWithFd(,20), that copies fd 20 from libvirt's point of
view into qemu, but using the command 'migrate fd:20' is wrong because
qemu's copy is not necessarily fd 20.
As Paolo mentions, file descriptors are passed by name in the monitor
args, instead of by number as they are on the command line. So if doing
a NIC on the command line libvirt would do
-netdev tap,fd=20
The corresponding monitor code would be
getfd foo (with SCM_RIGHTS for fd=20)
netdev_add tap,fd=foo
closefd foo (only if we failed netdev_add stage)
So libvirt never needs to know what FD number QEMU sees.
Regards,
Daniel
--
|: