From aa7dd96f1c23b29bd2cabd57d579f2c3b0fe678a Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Date: Mon, 14 Nov 2011 16:58:05 +0100 Subject: Fixes bug 890206 Add a check when creating the volume definition for the libvirt manager to use the apporpiate driver for the disk, according to [1]. [1] http://libvirt.org/formatdomain.html#elementsDisks Change-Id: I89cf3bb308cff28194de0beb36d69f0e32224cbe --- nova/compute/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 0f3e0ae3d..aa2d08c64 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1522,7 +1522,7 @@ class API(base.Base): def attach_volume(self, context, instance, volume_id, device): """Attach an existing volume to an existing instance.""" - if not re.match("^/dev/[a-z]d[a-z]+$", device): + if not re.match("^/dev/x{0,1}[a-z]d[a-z]+$", device): raise exception.ApiError(_("Invalid device specified: %s. " "Example device: /dev/vdb") % device) self.volume_api.check_attach(context, volume_id=volume_id) -- cgit