All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Novotny <minovotn@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Check for valid CPU_CAP value when creating (constructing) new domain
Date: Mon, 30 Mar 2009 08:43:07 +0200	[thread overview]
Message-ID: <49D069FB.1020401@redhat.com> (raw)

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

Hi,

This patch implements check for valid cpu_cap value when creating domain (in range 0 to VcpuCount * 100 as when changing scheduler parameters).

Signed-off-by: Michal Novotny <minovotn@redhat.com>


[-- Attachment #2: xen-valid-cap-value-when-creating-domain.patch --]
[-- Type: text/plain, Size: 753 bytes --]

diff -r 0b13d9787622 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Tue Mar 24 06:55:29 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Mon Mar 30 08:39:01 2009 +0200
@@ -2305,6 +2305,11 @@
         # Set maximum number of vcpus in domain
         xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
 
+        cap = self.getCap()
+        if cap < 0 or cap > self.info['VCPUs_max'] * 100:
+            raise VmError("Invalid CAP range, valid range is from 0 to %s for specified number of vcpus" %
+                         (int(self.info['VCPUs_max']) * 100) )
+
         # Test whether the devices can be assigned with VT-d
         pci = self.info["platform"].get("pci")
         pci_str = ''

[-- 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:[~2009-03-30  6:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30  6:43 Michal Novotny [this message]
2009-03-30  7:07 ` [PATCH] Check for valid CPU_CAP value when creating (constructing) new domain Masaki Kanno
2009-03-30  7:35   ` Michal Novotny
2009-03-30  7:52     ` [PATCH] Check for valid CPU_CAP value when creating(constructing) " Masaki Kanno
2009-03-30  7:55       ` Michal Novotny

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=49D069FB.1020401@redhat.com \
    --to=minovotn@redhat.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.