From: john.levon@sun.com Subject: [PATCH] Prevent attachment of devices in dom0 Date: Thu, 14 Jun 2007 16:00:50 -0700 Message-ID: <7790a6395ed398fffb85.1181862050@xenbld> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User john.levon@sun.com # Date 1181861914 25200 # Node ID 7790a6395ed398fffb85ec8eef184d6c8c83b8c4 # Parent 1e09661173844517d8c7b73822d2067afed2d098 Prevent attachment of devices in dom0 Signed-off-by: Gary Pennington diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -497,6 +497,10 @@ class XendDomainInfo: @param dev_config: device configuration @type dev_config: SXP object (parsed config) """ + + if self.domid == 0: + raise XendError('Devices cannot be attached to Domain 0') + log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config)) dev_type = sxp.name(dev_config) dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config)