diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-13 05:39:01 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-13 05:39:01 +0000 |
| commit | 4c7bef9b236e2705ae83c7b3364baa33277b5696 (patch) | |
| tree | ee6323a926d1a1c9fc29681218f73c909340cb10 | |
| parent | 7a8db63cef9400adecb5cb0630bb2aed027df3cb (diff) | |
| parent | 6c05f79cb39acd8a01d375600abd953c960b0d31 (diff) | |
Merge "make libvirt with Xen more workable"
| -rw-r--r-- | nova/virt/libvirt/driver.py | 5 | ||||
| -rw-r--r-- | nova/virt/libvirt/vif.py | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index e2f70b2b6..94ce9f6f8 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2354,6 +2354,11 @@ class LibvirtDriver(driver.ComputeDriver): None. if given cpu info is not compatible to this server, raise exception. """ + + # NOTE(berendt): virConnectCompareCPU not working for Xen + if CONF.libvirt_type == 'xen': + return 1 + info = jsonutils.loads(cpu_info) LOG.info(_('Instance launched has CPU info:\n%s') % cpu_info) cpu = vconfig.LibvirtConfigCPU() diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index 56c26dfd1..91088c3d2 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -293,7 +293,8 @@ class QuantumLinuxBridgeVIFDriver(vif.VIFDriver): conf.model = 'virtio' conf.net_type = "ethernet" conf.target_dev = dev - conf.script = "" + if CONF.libvirt_type != 'xen': + conf.script = "" conf.mac_addr = mapping['mac'] return conf @@ -303,7 +304,8 @@ class QuantumLinuxBridgeVIFDriver(vif.VIFDriver): network, mapping = vif dev = self.get_dev_name(mapping['vif_uuid']) try: - utils.execute('ip', 'link', 'delete', dev, run_as_root=True) + if CONF.libvirt_type != 'xen': + utils.execute('ip', 'link', 'delete', dev, run_as_root=True) except exception.ProcessExecutionError: LOG.warning(_("Failed while unplugging vif"), instance=instance) raise |
