Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AD26C2D0EA for ; Wed, 8 Apr 2020 14:57:56 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB26F206F5 for ; Wed, 8 Apr 2020 14:57:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="quGFHcBO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB26F206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jMC9A-0006mM-Nw; Wed, 08 Apr 2020 14:57:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jMC99-0006mD-P6 for xen-devel@lists.xenproject.org; Wed, 08 Apr 2020 14:57:43 +0000 X-Inumbo-ID: 4c70981e-79a9-11ea-9e09-bc764e2007e4 Received: from mail-ed1-x52c.google.com (unknown [2a00:1450:4864:20::52c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4c70981e-79a9-11ea-9e09-bc764e2007e4; Wed, 08 Apr 2020 14:57:43 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id cf14so8851489edb.13 for ; Wed, 08 Apr 2020 07:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=iU9yuaCYEfkEruhBpR6BbCuUDHAUpY1V9lTjdRCjxp4=; b=quGFHcBOXAeiXqefIaUP3hW0kMAyU9VoW30fxwynsKKHXirq7M9FF1pgze28xA5TLO uiMZJjsLEg4JxbHqrOe0ruvljZLbQyCJrPBLIibGoDq7j0oo13Z7XDirf2JDupPu80fy xP6uBygZIshl2Pt5Q3b74dphBCaPCYuP14L/nne6qveKNME/0Of75UdLhvSxX2U8rMZb D/cosQBWZgYazJdjgUS1HSSX5D7EMtRfQRyQkergTJqSpWE/FlzauSz7OeEdTew8IosS IDYzOouU5yKcUW+A5+8uDo/w8HYK5e37uLrzT9J9w8+NyZtm/Xp9c3Eaw13SY3ML20gA 7nGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :content-language:thread-index; bh=iU9yuaCYEfkEruhBpR6BbCuUDHAUpY1V9lTjdRCjxp4=; b=ly7dR1DxBPGtFaxQWlLTHzQjlC/xvzc4nJc3manF/akDRLENBO4hYE01ZumZUQJ+lo QRCLCHbXOGr8wpzqs6NUILLl90sBboyzYsuRo9vySOxj/ZE32V2K3eoT2ksI++wMjj5Q wHSKpdDWO1KjHiT/P2LJLgCu6VGu0Y/RM3E3gBul6UX6WfX2Mpj7PdcDJsFESzsfc0lr +ts8upion7fhnktAhpLRPqaDyFv17SCGX8b2bLfeNsusOdbPRknE0vENuUBuJ70Avy7f OLWD1QxmzEJa+gAtQ6pQKppQxUym8dj9ghHowHaxuCDaWmQxMD3wElWopb/54RBT6D++ hNuw== X-Gm-Message-State: AGi0PubAUankk9TjSsRa8zAkAYNrdjJ4JYozvUYaAxajWM580ZEfYWy3 dSDjge7XztrZlSIk2JSijjNF4lngkQY= X-Google-Smtp-Source: APiQypLRzwKJfYaMrc0+ovdIMO40fHh5F2dS5HTJYjip3Ql+wp0ZaGlLdLOXU6AxTYshW0F5IvFSaA== X-Received: by 2002:a05:6402:74c:: with SMTP id p12mr7011533edy.138.1586357862398; Wed, 08 Apr 2020 07:57:42 -0700 (PDT) Received: from CBGR90WXYV0 ([54.239.6.188]) by smtp.gmail.com with ESMTPSA id f12sm2926999edw.42.2020.04.08.07.57.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2020 07:57:41 -0700 (PDT) From: Paul Durrant X-Google-Original-From: "Paul Durrant" To: "'Maximilian Heyne'" , References: <20200313123316.122003-1-mheyne@amazon.de> <20200313123316.122003-3-mheyne@amazon.de> In-Reply-To: <20200313123316.122003-3-mheyne@amazon.de> Subject: RE: [PATCH 2/3] Add exit notifiers. Date: Wed, 8 Apr 2020 15:57:40 +0100 Message-ID: <004d01d60db6$0dab56f0$290204d0$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQGvBAjA7hxOW9V3ZNauiodGQFqJFQFuc8TGqLHwPvA= X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: paul@xen.org Cc: 'Ian Jackson' Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" > -----Original Message----- > From: Maximilian Heyne > Sent: 13 March 2020 12:33 > To: xen-devel@lists.xenproject.org > Cc: Ian Jackson ; Paul Durrant > Subject: [PATCH 2/3] Add exit notifiers. > > From: Gerd Hoffmann > > Hook up any cleanup work which needs to be done here. Advantages over > using atexit(3): > > (1) You get passed in a pointer to the notifier. If you embed that > into your state struct you can use container_of() to get get your > state info. > (2) You can unregister, say when un-plugging a device. > > [ v2: move code out of #ifndef _WIN32 ] > > Signed-off-by: Anthony Liguori > (cherry picked from commit fd42deeb4cb42f90084046e3ebdb4383953195e3) > Signed-off-by: Maximilian Heyne Reviewed-by: Paul Durrant