From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7l4j-0001Ij-AE for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7l4f-0006L4-6n for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:50:49 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34912 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7l4f-0006Ko-0T for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:50:45 -0400 Message-ID: <558AB5B3.7080005@suse.de> Date: Wed, 24 Jun 2015 15:50:43 +0200 From: =?windows-1252?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <803004FB-2F23-439C-AF59-E71FA7DDC2C4@livius.net> <55893750.3020502@suse.de> <55896C57.6060904@suse.de> <5B7FDD61-18AF-4024-9254-7B96582540E9@livius.net> <5EDCF9DC-453A-435C-9379-DE250716BA0F@livius.net> <04BD2F65-DACC-4865-9C16-2936F84220FD@livius.net> In-Reply-To: <04BD2F65-DACC-4865-9C16-2936F84220FD@livius.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liviu Ionescu Cc: Paolo Bonzini , Peter Crosthwaite , QEMU Developers Am 24.06.2015 um 11:29 schrieb Liviu Ionescu: > the machine init code now looks like this: >=20 > static void stm32_h103_board_init_callback(MachineState *machine) > { > cm_board_greeting(machine); >=20 > { > /* Create the MCU */ > DeviceState *mcu =3D cm_create(TYPE_STM32F103RB); >=20 > qdev_prop_set_ptr(mcu, "machine", machine); >=20 > /* Set the board specific oscillator frequencies. */ > qdev_prop_set_uint32(mcu, "hse-freq-hz", 8000000); /* 8.0 MHz *= / > qdev_prop_set_uint32(mcu, "lse-freq-hz", 32768); /* 32 KHz */ >=20 > cm_realize(mcu); > } >=20 > { > /* Create the board LED */ > DeviceState *led =3D cm_create(TYPE_GPIO_LED); >=20 > /* STM32-H103 Green LED, GPIOC[12], active low */ > qdev_prop_set_bit(led, "active-low", true); > qdev_prop_set_string(led, "on-message", "[Green LED On]\n"); > qdev_prop_set_string(led, "off-message", "[Green LED Off]\n"); >=20 > gpio_led_connect(led, "/machine/stm32/gpio[c]", 12); >=20 > cm_realize(led); > } > } >=20 > I hope it is better now. You're still doing the {...} thing I asked you not to do. static ... { DeviceState *mcu, *led; mcu =3D ... ... led =3D ... ... } Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)