From 2c9eba280a78e4159267d4a56a09df9076c844d3 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 25 Feb 2013 15:47:35 +0000 Subject: Add a 'hw_' namespace to glance hardware config properties This updates the libvirt driver to use a 'hw_' prefix on the names of hardware config properties it looks up for glance images. Thus the new syntax for setting custom hardware properties is # glance image-update \ --property hw_disk_bus=ide \ --property hw_cdrom_bus=ide \ --property hw_vif_model=e1000 \ f16-x86_64-openstack-sda There is no back-compat support for the previous 'disk_bus', 'cdrom_bus' and 'vif_model' names, since they were never made available in any formal release, only development snapshots. DocImpact Blueprint: libvirt-custom-hardware Fixes bug 1132739 Change-Id: Ic15ef0eba065113b35bbb2713be2532c858c3534 Signed-off-by: Daniel P. Berrange --- nova/virt/libvirt/blockinfo.py | 2 +- nova/virt/libvirt/vif.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/blockinfo.py b/nova/virt/libvirt/blockinfo.py index 09e3809d9..3e4b3995c 100644 --- a/nova/virt/libvirt/blockinfo.py +++ b/nova/virt/libvirt/blockinfo.py @@ -201,7 +201,7 @@ def get_disk_bus_for_device_type(virt_type, # Prefer a disk bus set against the image first of all if image_meta: - key = device_type + "_bus" + key = "hw_" + device_type + "_bus" disk_bus = image_meta.get('properties', {}).get(key) if disk_bus is not None: if not is_disk_bus_valid_for_virt(virt_type, disk_bus): diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index 8d9664751..fde45b4a7 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -101,7 +101,8 @@ class LibvirtBaseVIFDriver(object): # If the user has specified a 'vif_model' against the # image then honour that model if image_meta: - vif_model = image_meta.get('properties', {}).get('vif_model') + vif_model = image_meta.get('properties', + {}).get('hw_vif_model') if vif_model is not None: model = vif_model -- cgit