[libvirt] [PATCH V3] xen: check if device is assigned to guest before reattaching

Eric Blake eblake at redhat.com
Thu Apr 28 20:46:39 UTC 2011


On 04/28/2011 01:00 AM, Osier Yang wrote:
> 于 2011年04月27日 20:09, Yufang Zhang 写道:
>> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=664059
>>
>> This is the version3 patch for BZ#664059.

This sentence is not as useful in the commit message; it's handy in
reviews, but for someone using 'git am' to snarf the email message into
their own git tree, the way to convey that information is by putting it
after the '---' dividing line.  That is, --- provides the boundary
between commit details and out-of-band review helps.

>> Reattaching pci device back to
>> host without destroying guest or detaching device from guest would cause
>> host to crash. This patch adds a check before doing device reattach. If
>> the device is being assigned to guest, libvirt refuses to reattach device
>> to host. The patch only works for Xen, for it just checks xenstore to get
>> pci device information. This version fixes some formatting problem and moves
>> lock-unlock out of loop so that the check is atomic.
> 
> We have same problem with qemu driver, though this patch looks fine
> and fix the problem for xen driver, IMHO it's not the ideal solution,
> ideally it will be nice if kernel could let us known if the device is
> still in use. I filed bug against kernel, no feedback yet though.

Link to that bug?

> 
>>
>> Signed-off-by: Yufang Zhang<yuzhang at redhat.com>
>> ---
>>   src/xen/xen_driver.c |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 files changed, 67 insertions(+), 0 deletions(-)

ACK.

I've added Yufang to AUTHORS (let me know off-list) if you prefer any
alternate spelling to your name and pushed this patch.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110428/e80abe48/attachment-0001.sig>


More information about the libvir-list mailing list