From patchwork Thu Jul 21 14:44:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 72576 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp495550qga; Thu, 21 Jul 2016 08:12:28 -0700 (PDT) X-Received: by 10.129.99.198 with SMTP id x189mr21701313ywb.106.1469113948763; Thu, 21 Jul 2016 08:12:28 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m67si5282134qkb.53.2016.07.21.08.12.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Jul 2016 08:12:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:41422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFeG-0003U6-76 for patch@linaro.org; Thu, 21 Jul 2016 11:12:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFDj-0005il-Mm for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFDe-0007EF-PG for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:45:02 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:36695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFDe-0007E8-Kg for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:44:58 -0400 Received: by mail-oi0-x241.google.com with SMTP id d204so7875307oig.3 for ; Thu, 21 Jul 2016 07:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5eQzKr1gH5N0QNfQW9txxRarbmtBLp/QENuLQO0+kY=; b=dotQxTJCE7BwLhK0kBPNz7zubyONQpu2AlexVKrvvJMtrkpQWWJitlh0G7aNoOuTKW crDgnmYg3IEE91VDqApDHMd78PSLpsafCQIbXV0TvgM+exMmgbJ/mfkV+YyEvxBfnELj JJw0SUuU0mmo32ciD1lf6aKIGWRwpx8bHnyZB0xSAs2d1yR+6d7j+Sg82CYy1vT7HlX7 iWISd2TvgsmjiYU8KI2ZzzhvG0rtwgUDVdMVIIvDw+lVhT/mM/XngS65nzEpal4BY888 65mzjiLm13rzPp54iOb1TVbhN38KDIOZBozlH2gNlrzsYTvlv0JVquotF6p8wxXIC33n wVkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=K5eQzKr1gH5N0QNfQW9txxRarbmtBLp/QENuLQO0+kY=; b=aS2MPLs27uIbk42drMbDVzMRpDSiRjvJUu2gJ8zLdRwJX/btjNN4g3rou4YE4sFtIB Umaus705ITvhid4sGllffszykMeehsQ+UUyy1kP5r4dDpCcRpG0hkpqOrm8/e79sfNDM MUFuhTMTUwwqbQvyrd09mtKLzb5kk7BwwYAd7CUj6sMNYDSzvWlU7/0TKLA3L6SqQ9AC KPkDJfyXvw6T8u55K+C43fITe/dz+/t5NbGERxb5zgIGjtpgwcWQ4WP57pzsOaQRAGvs 4uZ8LVv1iv9Jdo9sCkU/QeTt41zuwjBJrTPdckqk/z0q2uN3T16/JOxtmvg9CojPhGS9 BmoQ== X-Gm-Message-State: ALyK8tLYMinl1HKSmIk9ZfNd70kXmS9XpG8Y2yxhEk31chEBhanzpVKxicL4axyjjx5XMA== X-Received: by 10.202.94.9 with SMTP id s9mr15475933oib.174.1469112298194; Thu, 21 Jul 2016 07:44:58 -0700 (PDT) Received: from serve.minyard.net ([173.64.235.97]) by smtp.gmail.com with ESMTPSA id k205sm3343348oia.7.2016.07.21.07.44.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 07:44:57 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 4E9CA234; Thu, 21 Jul 2016 09:44:55 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id EE5D2302C07; Thu, 21 Jul 2016 09:44:53 -0500 (CDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Thu, 21 Jul 2016 09:44:50 -0500 Message-Id: <1469112292-30548-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH 1/3] ipmi_bmc_sim: Free timer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Corey Minyard Add an unrealize function to free the timer allocated in the realize function. Signed-off-by: Corey Minyard Cc: Marc-André Lureau --- hw/ipmi/ipmi_bmc_sim.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.7.4 diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index dc9c14c..c83adf8 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1786,12 +1786,22 @@ static void ipmi_sim_realize(DeviceState *dev, Error **errp) vmstate_register(NULL, 0, &vmstate_ipmi_sim, ibs); } +static void ipmi_sim_unrealize(DeviceState *dev, Error **errp) +{ + IPMIBmc *b = IPMI_BMC(dev); + IPMIBmcSim *ibs = IPMI_BMC_SIMULATOR(b); + + timer_del(ibs->timer); + timer_free(ibs->timer); +} + static void ipmi_sim_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); IPMIBmcClass *bk = IPMI_BMC_CLASS(oc); dc->realize = ipmi_sim_realize; + dc->unrealize = ipmi_sim_unrealize; bk->handle_command = ipmi_sim_handle_command; }