[libvirt] pausing / unpausing guests with libvirt

Daniel P. Berrange berrange at redhat.com
Mon Sep 22 08:17:21 UTC 2008


On Sun, Sep 21, 2008 at 05:16:32PM -0400, Matthew Donovan wrote:
> 
> DEBUG: libvirt.c: virDomainCreate (domain=0x92bd1e0)
> DEBUG: libvirt.c: virDomainSuspend (domain=0x92bd1e0)
> virDomainSuspend() failed: 0

I think this is a  bug in the Xen driver - the  virDomainCreate 
api is not updating the internal 'id' parameter of the virDomainPtr
object, so when you then call virDomainSuspend() with the same
virDomainPtr it doesn't have the id it needs

The easy workaround is to just get rid of your existing dom object
and lookup a new one with 'virDomainLoopByUUID' after starting it.

     virDomainPtr dom;
     char  uuid[VIR_UUID_BUFLEN];

     virDomainCreate(dom);

     virDomainGetUUID(dom, uuid);
     virDomainFree(dom);
     dom = virDomainLookupByUUID(conn, uuid);

     virDomainSuspend(dom);

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 :|




More information about the libvir-list mailing list