From 1e7769cf5587c1ce92f206b39fe646975b19fc95 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 16 Aug 2012 10:58:33 -0700 Subject: Adds support for serial to libvirt config disks. In order for users to find a volume that they have attached to a vm, it is valuable to be able to find it in a consistent location. A following patch wil accomplish this by setting the serial number of the device to the uuid of the volume. This patch prepares for that change by allowing serial numbers to be set in the libvirt config disk object. Prepares to fix bug 1004328 Change-Id: Iecdfc17b45e1c38df50f844f127c0e95558ab22c --- nova/virt/libvirt/config.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/config.py b/nova/virt/libvirt/config.py index 8a924df56..4c3483cb9 100644 --- a/nova/virt/libvirt/config.py +++ b/nova/virt/libvirt/config.py @@ -363,6 +363,7 @@ class LibvirtConfigGuestDisk(LibvirtConfigGuestDevice): self.auth_username = None self.auth_secret_type = None self.auth_secret_uuid = None + self.serial = None def format_dom(self): dev = super(LibvirtConfigGuestDisk, self).format_dom() @@ -404,6 +405,9 @@ class LibvirtConfigGuestDisk(LibvirtConfigGuestDevice): dev.append(etree.Element("target", dev=self.target_dev, bus=self.target_bus)) + if self.serial is not None: + dev.append(self._text_node("serial", self.serial)) + return dev -- cgit