[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] problems using libvirt to mange "defined" domains.

I'm having a problem using libvirt to manage "defined" domains (ie:
domains for which it has XML, but are not running.)

I have tried several debugging scenarios, but the simplest one is this. 
In a libvirt C program I define the following XML:

char domxml[]="<domain type='xen' id='99'>"
    "<interface type='bridge'>"
      "<source bridge='xenbr0'/>"
      "<mac address='00:16:3e:09:ef:b0'/>"
      "<script path='vif-bridge'/>"
    "<disk type='block' device='disk'>"
      "<driver name='phy'/>"
      "<source dev='/dev/sda3'/>"
      "<target dev='xvda'/>"
    "<console tty='/dev/pts/2'/>"

(I've played with several values for the domain id).

What I find is that when I use virDomainDefineXML() to define the domain,
for some reason it drops, the "root" element from the "os" specification. 
Because of this the domain then crashes when I try to start it.

I've also tried, using virsh to create the domain from an XML file,
capture the XML with virDomainGetXMLDesc(), pause the C program, and then
try to redefine the domain with the domain with the exact XML
virDomainGetXMLDesc() gave me (after destroying the original of course),
and I get the same behavior, it strips the root element from the OS

Here is the version information:

[root rhel5-xen tmp]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
[root rhel5-xen tmp]# uname -a
Linux rhel5-xen 2.6.18-8.1.8.el5xen #1 SMP Mon Jun 25 17:19:38 EDT 2007
x86_64 x86_64 x86_64 GNU/Linux
[root rhel5-xen tmp]# virsh version
Compiled against library: libvir 0.3.1
Using library: libvir 0.3.1
Using API: Xen 3.0.1
Running hypervisor: Xen 3.0.0

I am using rhel5 "out of the box" with libvirt upgraded to:

I tried using libvirt-0.3.2-1, but sample code segv'd in

All I'm really trying to do is build a primitive interface to list domains
(both running, and non-running), and start and stop them. I'm open to
suggestions as to whether I have this misconfigured or if there would be a
better version with which to do this.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]