提交 152896ca 编写于 作者: M Michal Privoznik

uml: s/virDomainObjListFindByID/virDomainObjListFindByUUID/

ListFindByID() still requires to step through items in the hash table
(in the worst case scenario through all of them), lock each one and
compare whether we've found what we're looking for. This is suboptimal
as locking a domain object means we need to wait for the current API
running over the object to finish.

Unfortunately, we can't drop the function completely because we have
this public API virDomainLookupByID which we can't drop.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 8728a565
......@@ -1659,7 +1659,7 @@ static int umlDomainShutdownFlags(virDomainPtr dom,
virCheckFlags(0, -1);
umlDriverLock(driver);
vm = virDomainObjListFindByID(driver->domains, dom->id);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
umlDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
......@@ -1704,7 +1704,7 @@ umlDomainDestroyFlags(virDomainPtr dom,
virCheckFlags(0, -1);
umlDriverLock(driver);
vm = virDomainObjListFindByID(driver->domains, dom->id);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching id %d"), dom->id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册