summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Bolognani <abologna@redhat.com>2016-01-25 14:24:50 +0100
committerAndrea Bolognani <abologna@redhat.com>2016-02-22 17:32:48 +0100
commitdad0ae1c1f43dfa9e67a660ec9bfad1788f39d1a (patch)
treefcc13fc993fff296ce51cc7c5bf9b403ba2d9523
parent4a3ae388baf286af8ea2c0d6c064ac45f05e11cb (diff)
downloadlibvirt-dad0ae1c1f43dfa9e67a660ec9bfad1788f39d1a.tar.gz
hostdev: Minor style adjustments
Mostly labels names and whitespace. No functional changes.
-rw-r--r--src/util/virhostdev.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 76c0429486..9ae217dfdb 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -747,9 +747,10 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
}
cleanup:
+ virObjectUnref(pcidevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
- virObjectUnref(pcidevs);
+
return ret;
}
@@ -1591,17 +1592,18 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data))
- goto out;
+ goto cleanup;
if (virPCIDeviceDetach(pci, hostdev_mgr->activePCIHostdevs,
- hostdev_mgr->inactivePCIHostdevs) < 0) {
- goto out;
- }
+ hostdev_mgr->inactivePCIHostdevs) < 0)
+ goto cleanup;
ret = 0;
- out:
+
+ cleanup:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
+
return ret;
}
@@ -1617,7 +1619,7 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data))
- goto out;
+ goto cleanup;
virPCIDeviceSetUnbindFromStub(pci, true);
virPCIDeviceSetRemoveSlot(pci, true);
@@ -1625,12 +1627,14 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
if (virPCIDeviceReattach(pci, hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs) < 0)
- goto out;
+ goto cleanup;
ret = 0;
- out:
+
+ cleanup:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
+
return ret;
}