All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	xen-ia64-devel <xen-ia64-devel@lists.xensource.com>
Subject: Re: [PATCH] Create XEN_DOMCTL_set_opt_feature
Date: Wed, 28 Nov 2007 11:39:32 -0700	[thread overview]
Message-ID: <1196275172.7687.33.camel@lappy> (raw)
In-Reply-To: <C3735853.19245%Keir.Fraser@cl.cam.ac.uk>


On Wed, 2007-11-28 at 17:39 +0000, Keir Fraser wrote:
> On 28/11/07 17:31, "Alex Williamson" <alex.williamson@hp.com> wrote:
> 
> >    This patch goes along with the guest_os_type domain config patch.
> > Once we know what the guest OS is in the builder code, we need a
> > mechanism to set optimization features for that guest.  This is done via
> > a new XEN_DOMCTL as shown in the patch below.  This only has ia64
> > specific contents at the moment, but could be expanded for x86.  I
> > expect the contents of the structure will mostly be architecture
> > specific.  Thanks,
> 
> If you use this in the builder, why do you need a hvm param at all? In any
> case I don't like the encoding of OS strings into hvm_param integers. Either
> the concept of 'OS type' should not be visible to Xen, or a proper
> enumeration should be defined, or if you want a string then the builder
> should stick it in memory for your virtual boot firmware to pick up.

Hi Keir,

   You're right, thanks for bringing it to my attention that storing it
in an hvm_param is simply unnecessary.  If we add the guest_os_type
config option as per the new patch below, and still add the
XEN_DOMCTL_set_opt_feature call, everything else can be done in
architecture code.  I'll make a pyxc binding to an xc_ia64_set_os_type
that gets passed self.guest_os_type and makes use of set_opt_feature.
This avoids munging the string into an integer entirely and keeps
guest_os_type out of Xen.  Does this look more reasonable?  Please also
apply this and the original XEN_DOMCTL_set_opt_feature patch if so.
Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

diff -r c555a5f97982 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Wed Nov 28 13:36:56 2007 +0000
+++ b/tools/python/xen/xend/XendConfig.py	Wed Nov 28 09:48:59 2007 -0700
@@ -129,7 +129,8 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
                         'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
                         'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
                         'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
-                        'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt']
+                        'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt',
+                        'guest_os_type' ]
 
 # Xen API console 'other_config' keys.
 XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
diff -r c555a5f97982 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Wed Nov 28 13:36:56 2007 +0000
+++ b/tools/python/xen/xend/image.py	Wed Nov 28 11:22:38 2007 -0700
@@ -426,6 +426,7 @@ class HVMImageHandler(ImageHandler):
 
         self.apic = int(vmConfig['platform'].get('apic', 0))
         self.acpi = int(vmConfig['platform'].get('acpi', 0))
+        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
 
     # Return a list of cmd line args to the device models based on the
     # xm config file
diff -r c555a5f97982 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	Wed Nov 28 13:36:56 2007 +0000
+++ b/tools/python/xen/xm/create.py	Wed Nov 28 09:48:59 2007 -0700
@@ -453,6 +453,10 @@ gopts.var('usbdevice', val='NAME',
 gopts.var('usbdevice', val='NAME',
           fn=set_value, default='',
           use="Name of USB device to add?")
+
+gopts.var('guest_os_type', val='NAME',
+          fn=set_value, default='default',
+          use="Guest OS type running in HVM")
 
 gopts.var('stdvga', val='no|yes',
           fn=set_bool, default=0,
@@ -733,7 +737,9 @@ def configure_hvm(config_image, vals):
              'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
              'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
-             'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci' ]
+             'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci',
+             'guest_os_type']
+
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None:
             config_image.append([a, vals.__dict__[a]])

  parent reply	other threads:[~2007-11-28 18:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 17:31 [PATCH] Create XEN_DOMCTL_set_opt_feature Alex Williamson
2007-11-28 17:39 ` Keir Fraser
2007-11-28 17:44   ` Daniel P. Berrange
2007-11-28 18:39   ` Alex Williamson [this message]
2007-11-28 19:00     ` Keir Fraser

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=1196275172.7687.33.camel@lappy \
    --to=alex.williamson@hp.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-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.