From: Han, Weidong <[email protected]>

kvm_deassign_pci_device is defined when KVM_CAP_DEVICE_DEASSIGNMENT is defined.

Signed-off-by: Weidong Han <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index b7cbcec..56d70b4 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -551,6 +551,7 @@ static int assign_irq(AssignedDevInfo *adev)
 
 static void deassign_device(AssignedDevInfo *adev)
 {
+#ifdef KVM_CAP_DEVICE_DEASSIGNMENT
     struct kvm_assigned_pci_dev assigned_dev_data;
     AssignedDevice *dev = adev->assigned_dev;
     int r;
@@ -563,6 +564,7 @@ static void deassign_device(AssignedDevInfo *adev)
     if (r < 0)
        fprintf(stderr, "Failed to deassign device \"%s\" : %s\n",
                 adev->name, strerror(-r));
+#endif
 }
 
 void remove_assigned_device(AssignedDevInfo *adev)
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to