device-assignment: Don't deassign when the assignment fails
commit7c3f7480bcd2f14b3bf5e89bd1c65b4e2df5a568
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 10 Jun 2010 16:20:15 +0000 (10 10:20 -0600)
committerMarcelo Tosatti <mtosatti@redhat.com>
Fri, 11 Jun 2010 17:12:13 +0000 (11 14:12 -0300)
treee08b18c393f51edbf30f9f2dca3aece43da3bb5c
parent02152f7275ebede652360c3840cf45fe240d34f0
device-assignment: Don't deassign when the assignment fails

The last thing assign_device() does is call into KVM_ASSIGN_PCI_DEVICE.
If that fails, the device is not assigned, so we shouldn't then try to
deassign it.  If you try to assign the same device multiple times, you
can get into a nasty fail-succeed-fail-succeed loop.  And we certainly
shouldn't take the assigned_out branch before we've even attempted
to assign the device.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
hw/device-assignment.c