[libvirt] [PATCH] 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. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test.c b/src/test.c index 7dc0840..2a672a3 100644 --- a/src/test.c +++ b/src/test.c @@ -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); -- 1.6.0.6

On Thu, Jun 18, 2009 at 12:35:40PM -0400, Cole Robinson wrote:
The ID of the existing VM was being unconditionally set to -1, which was upsetting virt-manager.
Makes sense too, ACK :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Thu, Jun 18, 2009 at 12:35:40PM -0400, Cole Robinson wrote:
The ID of the existing VM was being unconditionally set to -1, which was upsetting virt-manager.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
ACK. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard