WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Prevent attachment of devices in dom0

To: john.levon@xxxxxxx
Subject: Re: [Xen-devel] [PATCH] Prevent attachment of devices in dom0
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Thu, 14 Jun 2007 16:07:48 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 14 Jun 2007 16:05:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <7790a6395ed398fffb85.1181862050@xenbld>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: john.levon@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <7790a6395ed398fffb85.1181862050@xenbld>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.15 (2007-05-02)
I'd prefer to be able to block-attach things in domain 0 on
occasion. It's a pretty convenient way to set up and maintain blocktap
filesystems. Maybe you can move this policy somewhere closer to the
problem you are fixing?

On Thursday, 14 June 2007 at 16:00, john.levon@xxxxxxx wrote:
> # HG changeset patch
> # User john.levon@xxxxxxx
> # Date 1181861914 25200
> # Node ID 7790a6395ed398fffb85ec8eef184d6c8c83b8c4
> # Parent  1e09661173844517d8c7b73822d2067afed2d098
> Prevent attachment of devices in dom0
> 
> Signed-off-by: Gary Pennington <gary.pennington@xxxxxxx>
> 
> diff --git a/tools/python/xen/xend/XendDomainInfo.py 
> b/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)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

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

<Prev in Thread] Current Thread [Next in Thread>