hi: Actually, openstack just write some wrappers around libvirt api, together with some logic related to openstack itself. for example: def _lookup_by_name(self, instance_name): """Retrieve libvirt domain object given an instance name. All libvirt error handling should be handled in this method and relevant nova exceptions should be raised in response. """ try: return self._conn.lookupByName(instance_name) except libvirt.libvirtError as ex: error_code = ex.get_error_code() if error_code == libvirt.VIR_ERR_NO_DOMAIN: raise exception.InstanceNotFound(instance_id=instance_name) msg = _("Error from libvirt while looking up %(instance_name)s: " "[Error Code %(error_code)s] %(ex)s") % locals() raise exception.NovaException(msg) self._conn is libvirt connection. By the way, openstack support multiple virtualization drivers, libvirt is only one of them. I think you can treat openstack libvirt api as a reference, then modify libvirt api to suite your needs. Thanks. On 11/12/2012 10:07 AM, 宣铭艺 wrote:
Thanks all: -- Hanyu Xiao Eayun.com |
_______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users