From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFdn-0003nT-S6 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFdj-0005cA-GM for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:11:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFdj-0005c5-AV for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:11:55 -0400 Date: Thu, 21 Jul 2016 16:11:53 +0100 From: "Richard W.M. Jones" Message-ID: <20160721151153.GS1688@redhat.com> References: <1469112292-30548-1-git-send-email-minyard@acm.org> <1469112292-30548-3-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1469112292-30548-3-git-send-email-minyard@acm.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] wdt_ib700: Free timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: minyard@acm.org Cc: qemu-devel@nongnu.org, =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Corey Minyard On Thu, Jul 21, 2016 at 09:44:52AM -0500, minyard@acm.org wrote: > From: Corey Minyard >=20 > Add an unrealize function to free the timer allocated in the > realize function. >=20 > Signed-off-by: Corey Minyard > Cc: Richard W.M. Jones > Cc: Marc-Andr=E9 Lureau > --- > hw/watchdog/wdt_ib700.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c > index 532afe8..179771a 100644 > --- a/hw/watchdog/wdt_ib700.c > +++ b/hw/watchdog/wdt_ib700.c > @@ -117,6 +117,14 @@ static void wdt_ib700_realize(DeviceState *dev, Er= ror **errp) > portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj= ), 0); > } > =20 > +static void wdt_ib700_unrealize(DeviceState *dev, Error **errp) > +{ > + IB700State *s =3D IB700(dev); > + > + timer_del(s->timer); > + timer_free(s->timer); > +} > + > static void wdt_ib700_reset(DeviceState *dev) > { > IB700State *s =3D IB700(dev); > @@ -136,6 +144,7 @@ static void wdt_ib700_class_init(ObjectClass *klass= , void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D wdt_ib700_realize; > + dc->unrealize =3D wdt_ib700_unrealize; > dc->reset =3D wdt_ib700_reset; > dc->vmsd =3D &vmstate_ib700; > set_bit(DEVICE_CATEGORY_MISC, dc->categories); With the caveat that I only examined the code and compile-tested it: Reviewed-by: Richard W.M. Jones Rich. --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rj= ones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v