<br><font size=2 face="Arial">My try of "ip" attribute failed because of a bug in patch. With this corrected file, it works as well as "target".</font>
<br>
<br>
<p><font size=1 color=#800080 face="sans-serif">Pour :        </font><font size=1 face="sans-serif">libvir-list@redhat.com</font>
<br><font size=1 color=#800080 face="sans-serif">cc :         </font>
<br><font size=1 color=#800080 face="sans-serif">Objet :        </font><font size=1 face="Arial">Proposal for virtual devices described in XML</font>
<br>
<br><font size=2 face="Courier New">After comments from Daniel P. Berrange and from Bull people, my proposal is reduced to following 2 functions:<br>
<br>
/* Create a virtual device attachment to backend */<br>
int virDomainAttachDevice(virDomainPtr domain, char *xml);<br>
/* Destroy a virtual device attachment to backend */<br>
int virDomainDetachDevice(virDomainPtr domain, char *xml);<br>
/* @domain: pointer to domain object<br>
* @xml: pointer to XML description of one device<br>
* Returns 0 in case of success, -1 in case of failure. */<br>
<br>
The XML would be in same form as the part of domain description for a single device, either <disk.../disk> or <interface.../interface>.<br>
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 </font><font size=2><tt>virDomainParseXMLIfDesc</tt></font><font size=2 face="Courier New">). 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).</font>