Vinzenz Feenstra has uploaded a new change for review.

Change subject: Added support for reporting the timezone and os info
......................................................................

Added support for reporting the timezone and os info

The guest agent reports now the timezone and more detailed os information.
This patch introduces the support for those new messages.

Change-Id: Iadb85a5003fcb4693b5a1174655acf59193340b5
Guest-Agent-API-Version: 2
Bug-Url: https://bugzilla.redhat.com/869296
Signed-off-by: Vinzenz Feenstra <[email protected]>
---
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/guestagent.py
2 files changed, 50 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/28940/1

diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 2ccf963..869b78c 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -3456,6 +3456,12 @@
 #
 # @clientIp:              The IP address of the client connected to the display
 #
+# @guestOsInfo:           #optional Guest OS information like architecture,
+#                         type, and version (Since 4.15.0)
+#
+# @guestTimezone:         #optional Timezone and time offset of the guest OS
+#                         (Since 4.15.0)
+#
 # Since: 4.14.1
 ##
 {'type': 'VMFullInfo',
@@ -3470,7 +3476,45 @@
           'guestFQDN': 'str', 'displayIp': 'str', 'keyboardLayout': 'str',
           'displayPort': 'uint', 'guestIPs': 'str', 'smartcardEnable': 'bool',
           'nicModel': 'VmInterfaceDeviceModel', 'pitReinjection': 'bool',
-          'status': 'str', 'clientIp': 'str'}}
+          'status': 'str', 'clientIp': 'str', '*guestOsInfo': 'VMGuestOsInfo',
+          '*guestTimezone': 'VMGuestTimezone'}}
+
+##
+# @VMGuestTimezone:
+#
+# Timezone configuration of the guest operating system
+#
+# @zone:        Name of the timezone native to the Guest OS
+#
+# @offset:      Time offset of the configured timezone in minutes
+#
+# Since: 4.15.0
+##
+{'type': 'VMGuestTimezone',
+ 'data': {'zone': 'string', 'offset': 'uint'}}
+
+##
+# @VMGuestOsInfo:
+#
+# Information about the guest operating system on a VM
+#
+# @version:             Operating system version
+#
+# @distribution:        Name of the linux distribution
+#
+# @codename:            Codename of the OS
+#
+# @arch:                Architecture of the OS (x86, x86_64, ppc64, ...)
+#
+# @type:                Type of the OS (linux, windows, ...)
+#
+# @kernel:              Kernel version reported by a linux guest
+#
+# Since: 4.15.0
+##
+{'type': 'VMGuestOsInfo',
+ 'data': {'version': 'string', 'distribution': 'string', 'codename': 'string',
+          'arch': 'string', 'type': 'string', 'kernel': 'string'}}
 
 ##
 # @Host.getVMFullList:
diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index 31c0a26..8ff262f 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -30,7 +30,7 @@
 
 from . import vmstatus
 
-_MAX_SUPPORTED_API_VERSION = 1
+_MAX_SUPPORTED_API_VERSION = 2
 _IMPLICIT_API_VERSION_ZERO = 0
 
 _MESSAGE_API_VERSION_LOOKUP = {
@@ -255,6 +255,10 @@
             self.guestInfo['guestName'] = args['name']
         elif message == 'os-version':
             self.guestInfo['guestOs'] = args['version']
+        elif message == 'os-info':
+            self.guestInfo['guestOsInfo'] = args
+        elif message == 'timezone':
+            self.guestInfo['guestTimezone'] = args
         elif message == 'network-interfaces':
             interfaces = []
             old_ips = ''


-- 
To view, visit http://gerrit.ovirt.org/28940
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadb85a5003fcb4693b5a1174655acf59193340b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to