Re: Problem attaching device

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

 



2010/3/24  <steven765@xxxxxxxxx>:
> I keep getting an error when I try to attach a device in the libvirt api through python
>
> The python code is:
>
>     conn=libvirt.open('qemu:///system')
>     dom = conn.lookupByName("fedoratest")
>     if dom.info()[0]==1:
>         dom.attachDevice('net.xml')
>
> And I keep getting: "libvirtError: XML description not well formed or invalid
>
>   The xml is a simple network card that works fine in virsh. It is just:
> #cat net.xml
> <interface type='network'>
>           <mac address='52:54:00:00:fe:5c'/>
>           <source network-'default'/>

Your XML is really not well formed. This

   <source network-'default'/>

should be

   <source network='default'/>

>            target dev='vnet1'/>

And you miss a < before the word target:

   target dev='vnet1'/>

should be

   <target dev='vnet1'/>

> </interface>
>
> I've tired giving it the full path still no luck.
> Thanks in advance,
>

Matthias


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux