All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH][xenapi] Implement Console.set_other_config
Date: Thu, 26 Jul 2007 16:32:30 -0600	[thread overview]
Message-ID: <46A920FE.2030206@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

Xen API method Console.set_other_config has no implementation in xend. 
This patch provides implementation.

Regards,
Jim

[-- Attachment #2: xend_con_set_config.patch --]
[-- Type: text/x-patch, Size: 3666 bytes --]

# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# Date 1185488948 21600
# Node ID e9c349d79d11f50001a00b0796ee4a767a82ee9d
# Parent  1f348e70a5affdea9b44c1e39cd5ef094ad4a0bf
Implement Xen API method Console.set_other_config.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>

diff -r 1f348e70a5af -r e9c349d79d11 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py	Tue Jul 10 11:10:38 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py	Thu Jul 26 16:29:08 2007 -0600
@@ -2409,6 +2409,13 @@ class XendAPI(object):
         except XendError, exn:
             return xen_api_error(['INTERNAL_ERROR', str(exn)])
 
+    def console_set_other_config(self, session, console_ref, other_config):
+        xd = XendDomain.instance()
+        vm = xd.get_vm_with_dev_uuid('console', console_ref)
+        vm.set_console_other_config(console_ref, other_config)
+        xd.managed_config_save(vm)
+        return xen_api_success_void()
+
     # Xen API: Class SR
     # ----------------------------------------------------------------
     SR_attr_ro = ['VDIs',
diff -r 1f348e70a5af -r e9c349d79d11 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Tue Jul 10 11:10:38 2007 +0100
+++ b/tools/python/xen/xend/XendConfig.py	Thu Jul 26 16:29:08 2007 -0600
@@ -128,6 +128,11 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
                         'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
                         'vncconsole', 'vncdisplay', 'vnclisten',
                         'vncpasswd', 'vncunused', 'xauthority']
+
+# Xen API console 'other_config' keys.
+XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
+                            'vncpasswd', 'type', 'display', 'xauthority',
+                            'keymap']
 
 # List of XendConfig configuration keys that have no direct equivalent
 # in the old world.
@@ -1113,9 +1118,7 @@ class XendConfig(dict):
                 # with vfb
 
                 other_config = {}
-                for key in ['vncunused', 'vncdisplay', 'vnclisten',
-                            'vncpasswd', 'type', 'display', 'xauthority',
-                            'keymap']:
+                for key in XENAPI_CONSOLE_OTHER_CFG:
                     if key in dev_info:
                         other_config[key] = dev_info[key]
                 target['devices'][dev_uuid][1]['other_config'] =  other_config
@@ -1299,6 +1302,13 @@ class XendConfig(dict):
         for dev_uuid, (dev_type, dev_info) in self['devices'].items():
             if dev_uuid == console_uuid:
                 dev_info[key] = value
+                # collapse other_config into dev_info for things
+                # such as vncpasswd, vncunused, etc.
+                if key == 'other_config':
+                    for k in XENAPI_CONSOLE_OTHER_CFG:
+                        if k in dev_info and k not in value:
+                            del dev_info[k]
+                    dev_info.update(value)
                 break
 
     def console_get_all(self, protocol):
diff -r 1f348e70a5af -r e9c349d79d11 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jul 10 11:10:38 2007 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Jul 26 16:29:08 2007 -0600
@@ -2609,6 +2609,9 @@ class XendDomainInfo:
 
         return dev_uuid
 
+    def set_console_other_config(self, console_uuid, other_config):
+        self.info.console_update(console_uuid, 'other_config', other_config)
+
     def destroy_device_by_uuid(self, dev_type, dev_uuid):
         if dev_uuid not in self.info['devices']:
             raise XendError('Device does not exist')

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2007-07-26 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46A920FE.2030206@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.