[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xend: disallow multiple destroy() call



On Mon, Feb 04, 2013 at 09:54:23AM +0800, Joe Jin wrote:
> Current Xend allowing multiple call destroy() for same domain, this lead
> multiple hard resets(FLR) for pci pass-through, and some controller might
> failed.
> 
> In our test, we pass through 2 LSI HAB controllers to the PVHVM guest, after
> guest brought up, call xm-destroy twice, the adapters's BIOS will hung, and
> we had to reboot the server to recovery it.
> 
> Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

The other bugs (the kernel ones) are a nice find and should also
be fixed - but I think with the upstream kernel they have been
mostly fixed.

> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
>  tools/python/xen/xend/XendDomainInfo.py | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tools/python/xen/xend/XendDomainInfo.py 
> b/tools/python/xen/xend/XendDomainInfo.py
> index e9d3e7e..658c3b6 100644
> --- a/tools/python/xen/xend/XendDomainInfo.py
> +++ b/tools/python/xen/xend/XendDomainInfo.py
> @@ -367,6 +367,8 @@ class XendDomainInfo:
>      @type refresh_shutdown_lock: threading.Condition
>      @ivar _deviceControllers: device controller cache for this domain
>      @type _deviceControllers: dict 'string' to DevControllers
> +    @ivar destroying: Is this domain destroying
> +    @type destroying: bool
>      """
>      
>      def __init__(self, info, domid = None, dompath = None, augment = False,
> @@ -455,6 +457,8 @@ class XendDomainInfo:
>          self._checkName(self.info['name_label'])
>  
>          self.metrics = XendVMMetrics(uuid.createString(), self)
> +
> +        self.destroying = False
>              
>  
>      #
> @@ -3073,6 +3077,12 @@ class XendDomainInfo:
>  
>          if self.domid is None:
>              return
> +
> +        if self.destroying == False:
> +            self.destroying = True
> +        else:
> +            raise VmError("Domain (domid=%s) is destroying, please wait!", 
> str(self.domid))
> +
>          from xen.xend import XendDomain
>          log.debug("XendDomainInfo.destroy: domid=%s", str(self.domid))
>  
> @@ -3088,6 +3098,7 @@ class XendDomainInfo:
>                      self.info[state] = 0
>                  self._stateSet(DOM_STATE_HALTED)
>              except:
> +                self.destroying = False
>                  log.exception("XendDomainInfo.destroy: domain destruction 
> failed.")
>  
>              XendDomain.instance().remove_domain(self)
> -- 
> 1.8.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.