test driver: Fix domain ID after redefining a running VM

The ID of the existing VM was being unconditionally set to -1, which was
upsetting virt-manager.
This commit is contained in:
Cole Robinson 2009-06-22 16:29:40 +00:00
parent a06b407fce
commit c1b2aea80c
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
Mon Jun 22 11:09:18 EDT 2009 Cole Robinson <crobinso@redhat.com>
* src/test.c: Fix domain ID after redefining a running VM
Mon Jun 22 12:27:39 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/conf.[ch]: restrict VMX syntax parsing types, patch by Matthias

View File

@ -1623,16 +1623,16 @@ static virDomainPtr testDomainDefineXML(virConnectPtr conn,
def)) == NULL) {
goto cleanup;
}
def = NULL;
dom->persistent = 1;
dom->def->id = -1;
event = virDomainEventNewFromObj(dom,
VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED);
ret = virGetDomain(conn, def->name, def->uuid);
def = NULL;
ret = virGetDomain(conn, dom->def->name, dom->def->uuid);
if (ret)
ret->id = -1;
ret->id = dom->def->id;
cleanup:
virDomainDefFree(def);