Fix test driver inactive domains and domain ID allocation

This commit is contained in:
Daniel P. Berrange 2008-07-25 13:27:12 +00:00
parent 8c6f5a546b
commit 73d021c5c1
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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;