+ def FillHV(self, instance, skip_globals=False):
+ """Fill an instance's hvparams dict.
+
+ @type instance: L{objects.Instance}
+ @param instance: the instance parameter to fill
+ @type skip_globals: boolean
+ @param skip_globals: if True, the global hypervisor parameters will
+ not be filled
+ @rtype: dict
+ @return: a copy of the instance's hvparams with missing keys filled from
+ the cluster defaults
+
+ """
+ if skip_globals:
+ skip_keys = constants.HVC_GLOBALS
+ else:
+ skip_keys = []
+ return FillDict(self.hvparams.get(instance.hypervisor, {}),
+ instance.hvparams, skip_keys=skip_keys)
+
+ def FillBE(self, instance):
+ """Fill an instance's beparams dict.
+
+ @type instance: L{objects.Instance}
+ @param instance: the instance parameter to fill
+ @rtype: dict
+ @return: a copy of the instance's beparams with missing keys filled from
+ the cluster defaults
+
+ """
+ return FillDict(self.beparams.get(constants.PP_DEFAULT, {}),
+ instance.beparams)
+
+
+class BlockDevStatus(ConfigObject):
+ """Config object representing the status of a block device."""
+ __slots__ = [
+ "dev_path",
+ "major",
+ "minor",
+ "sync_percent",
+ "estimated_time",
+ "is_degraded",
+ "ldisk_status",
+ ]
+
+
+class ConfdRequest(ConfigObject):
+ """Object holding a confd request.
+
+ @ivar protocol: confd protocol version
+ @ivar type: confd query type
+ @ivar query: query request
+ @ivar rsalt: requested reply salt
+
+ """
+ __slots__ = [
+ "protocol",
+ "type",
+ "query",
+ "rsalt",
+ ]
+
+
+class ConfdReply(ConfigObject):
+ """Object holding a confd reply.
+
+ @ivar protocol: confd protocol version
+ @ivar status: reply status code (ok, error)
+ @ivar answer: confd query reply
+ @ivar serial: configuration serial number
+
+ """
+ __slots__ = [
+ "protocol",
+ "status",
+ "answer",
+ "serial",
+ ]
+