提交 73d021c5 编写于 作者: D Daniel P. Berrange

Fix test driver inactive domains and domain ID allocation

上级 8c6f5a54
Fri Jul 25 14:00:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/test.c: Increment dom ID tracker when setting up
default domain. Reset dom ID when destroying domain. Fix
listing of defined domains
Fri Jul 25 14:00:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Convert XenD XML->SEXPR conversion to new domain XML APIs
......
......@@ -259,7 +259,7 @@ static int testOpenDefault(virConnectPtr conn) {
virDomainDefFree(domdef);
goto error;
}
domobj->def->id = 1;
domobj->def->id = privconn->nextDomID++;
domobj->state = VIR_DOMAIN_RUNNING;
domobj->persistent = 1;
......@@ -776,6 +776,8 @@ static int testDestroyDomain (virDomainPtr domain)
GET_DOMAIN(domain, -1);
privdom->state = VIR_DOMAIN_SHUTOFF;
privdom->def->id = -1;
domain->id = -1;
if (!privdom->persistent) {
virDomainRemoveInactive(&privconn->domains,
privdom);
......@@ -1132,7 +1134,7 @@ static int testListDefinedDomains(virConnectPtr conn,
dom = privconn->domains;
memset(names, 0, sizeof(*names)*maxnames);
while (dom && n < maxnames) {
if (virDomainIsActive(dom) &&
if (!virDomainIsActive(dom) &&
!(names[n++] = strdup(dom->def->name)))
goto no_memory;
dom = dom->next;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册