Liron Aravot has uploaded a new change for review. Change subject: vm: return diskMapping on status() ......................................................................
vm: return diskMapping on status() status() is used by API.Global.getVMList and should return also the disk mapping retrieved by the guest agent. Change-Id: Ia68ff3c36ba91cde893876a16fc6702419a60d49 Signed-off-by: Liron Aravot <[email protected]> --- M tests/vmTests.py M vdsm/rpc/vdsmapi-schema.json M vdsm/virt/vm.py 3 files changed, 39 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/33197/1 diff --git a/tests/vmTests.py b/tests/vmTests.py index 32fa5e0..a89a8d3 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -894,6 +894,9 @@ class FakeGuestAgent(object): + def __init__(self): + self.guestDiskMapping = {} + def getGuestInfo(self): return { 'username': 'Unknown', diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json index db441f5..a2f2865 100644 --- a/vdsm/rpc/vdsmapi-schema.json +++ b/vdsm/rpc/vdsmapi-schema.json @@ -3434,6 +3434,29 @@ 'returns': ['UUID']} ## +# @GuestDiskMappingInfo: +# +# disk mapping information indexed by property name. +# +# @name: device logical name within the guest. +# +# Since: 4.16.0 +## +{'type': 'GuestDiskMappingInfo', + 'data': {'name': 'str'}} + + +## +# @GuestDisksMappingMap: +# +# guest disks mapping information indexed by serial. +# +# Since: 4.16.0 +## +{'map': 'GuestDisksMappingMap', + 'key': 'str', 'value': 'GuestDiskMappingInfo'} + +## # @VMFullInfo: # # Full information about VM. @@ -3499,6 +3522,11 @@ # # @guestIPs: A space separated string of assigned IPv4 addresses # +# @guestDiskMapping: A dictionary containing information about the disk +# mapping within the guest. The key is the device +# serial and the value is the mapping information. +# (New in version 4.16.0.) +# # @smartcardEnable: Info whether smartcard is enabled. # # @nicModel: The type of device that is exposed to the VM operating system @@ -3521,9 +3549,10 @@ 'username': 'str', 'emulatedMachine': 'str', 'pid': 'uint', 'spiceSslCipherSuite': 'str', 'cpuType': 'str', 'pauseCode': 'str', 'guestFQDN': 'str', 'displayIp': 'str', 'keyboardLayout': 'str', - 'displayPort': 'uint', 'guestIPs': 'str', 'smartcardEnable': 'bool', - 'nicModel': 'VmInterfaceDeviceModel', 'pitReinjection': 'bool', - 'status': 'str', 'clientIp': 'str'}} + 'displayPort': 'uint', 'guestIPs': 'str', + 'guestDiskMapping': 'GuestDisksMappingMap', + 'smartcardEnable': 'bool', 'nicModel': 'VmInterfaceDeviceModel', + 'pitReinjection': 'bool', 'status': 'str', 'clientIp': 'str'}} ## # @Host.getVMFullList: diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 0f9e4ce..548ce18 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2852,8 +2852,10 @@ # used by API.Global.getVMList self.conf['status'] = self.lastStatus # Filter out any internal keys - return dict((k, v) for k, v in self.conf.iteritems() - if not k.startswith("_")) + status = dict((k, v) for k, v in self.conf.iteritems() + if not k.startswith("_")) + status['guestDiskMapping'] = self.guestAgent.guestDiskMapping + return status def getStats(self): """ -- To view, visit http://gerrit.ovirt.org/33197 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia68ff3c36ba91cde893876a16fc6702419a60d49 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Liron Aravot <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
