[Libvir] Proposal for virtual devices described in XML

michel.ponceau at bull.net michel.ponceau at bull.net
Wed Sep 27 15:21:33 UTC 2006

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/20060927/4ee9cc95/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: difxml6
Type: application/octet-stream
Size: 1629 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060927/4ee9cc95/attachment-0001.obj>

More information about the libvir-list mailing list