[Libvir] Patch to attach/detach virtual devices on a running domain

michel.ponceau at bull.net michel.ponceau at bull.net
Tue Nov 14 14:34:05 UTC 2006


This patch adds to Libvirt-0.1.8 the two functions described in my 
preceding mail. It has been tested in our Bull environment.





Michel Ponceau
02/10/2006 17:27

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

Proposal modified after comments from Daniel P. Berrange:

/* 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 is in same form as the part of domain description for a single 
device, either <disk.../disk> or <interface.../interface>.
In Detach function, the device is identified by its target name for 
"disk", and its MAC address for "interface". When the MAC address has not 
been assigned by Libvirt user at device creation, it must be retrieved 
from Xen using virDomainGetXMLDesc function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20061114/033a4bce/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: difdev
Type: application/octet-stream
Size: 10678 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20061114/033a4bce/attachment-0001.obj>


More information about the libvir-list mailing list