Add pci slot in NIC/Disk objects. This slot will be used only
by hypervisor code. Currently only KVM will use it and store it
temporarily in runtime files.
Add HOTPLUG_* constants to define device types an hotplug actions.

Signed-off-by: Dimitris Aragiorgis <[email protected]>
---
 lib/constants.py |    6 ++++++
 lib/objects.py   |    7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/constants.py b/lib/constants.py
index 35b47ae..35eb6bc 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -697,6 +697,12 @@ DDMS_VALUES_WITH_MODIFY = (DDMS_VALUES | frozenset([
   ]))
 # TODO: DDM_SWAP, DDM_MOVE?
 
+# hotplug
+HOTPLUG_DISK = "hotdisk"
+HOTPLUG_NIC = "hotnic"
+HOTPLUG_ADD = "hotadd"
+HOTPLUG_REMOVE = "hotremove"
+
 # common exit codes
 EXIT_SUCCESS = 0
 EXIT_FAILURE = 1
diff --git a/lib/objects.py b/lib/objects.py
index 6105595..257c119 100644
--- a/lib/objects.py
+++ b/lib/objects.py
@@ -487,7 +487,8 @@ class ConfigData(ConfigObject):
 
 class NIC(ConfigObject):
   """Config object representing a network card."""
-  __slots__ = ["name", "mac", "ip", "network", "nicparams", "netinfo"] + _UUID
+  __slots__ = ["name", "mac", "ip", "network",
+               "nicparams", "netinfo", "pci"] + _UUID
 
   @classmethod
   def CheckParameterSyntax(cls, nicparams):
@@ -511,8 +512,8 @@ class NIC(ConfigObject):
 class Disk(ConfigObject):
   """Config object representing a block device."""
   __slots__ = (["name", "dev_type", "logical_id", "physical_id",
-                "children", "iv_name", "size", "mode", "params", "spindles"] +
-               _UUID)
+                "children", "iv_name", "size", "mode", "params",
+                "spindles", "pci"] + _UUID)
 
   def CreateOnSecondary(self):
     """Test if this device needs to be created on a secondary node."""
-- 
1.7.10.4

Reply via email to