mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
Fix test driver inactive domains and domain ID allocation
This commit is contained in:
parent
8c6f5a546b
commit
73d021c5c1
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user