[Libvir] Proposal for virtual devices described in XML

michel.ponceau at bull.net michel.ponceau at bull.net
Thu Sep 28 11:11:36 UTC 2006


My try of "ip" attribute failed because of a bug in patch. With this 
corrected file, it works as well as "target".


Pour :  libvir-list at redhat.com
cc : 
Objet : Proposal for virtual devices described in XML

After comments from Daniel P. Berrange and from Bull people, my proposal 
is reduced to following 2 functions:

/* Create a virtual device attachment to backend */
int virDomainAttachDevice(virDomainPtr domain, char *xml);
/* Destroy a virtual device attachment to backend */
int virDomainDetachDevice(virDomainPtr domain, char *xml);
/* @domain: pointer to domain object
* @xml: pointer to XML description of one device
* Returns 0 in case of success, -1 in case of failure. */

The XML would be in same form as the part of domain description for a 
single device, either <disk.../disk> or <interface.../interface>.
The device is identified by its target name. This attribute is optional 
for "interface" in domain description, but would become mandatory in 
Attach/Detach description. It is not yet processed in Libvirt-0.1.6 source 
xml.c (function virDomainParseXMLIfDesc). I have successfully tried the attached patch, which tranlates "target" 
into Xen "vifname". (It processes "ip" attribute in same way, but my try 
failed, maybe because address value was invalid for Xen).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060928/91d65b7d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: difxml6
Type: application/octet-stream
Size: 1628 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060928/91d65b7d/attachment-0001.obj>


More information about the libvir-list mailing list