From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNoWu-0005Wk-63 for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNoQv-0001Gr-ET for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:03:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44123 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNoQv-0001GE-5o for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:03:17 -0400 Message-ID: <5320AF73.7020500@suse.de> Date: Wed, 12 Mar 2014 20:03:15 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1394473079-17911-1-git-send-email-afaerber@suse.de> <1394473079-17911-3-git-send-email-afaerber@suse.de> <20140312124126.GC24378@grmbl.mre> In-Reply-To: <20140312124126.GC24378@grmbl.mre> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 2/2] virtio-serial-port: Convert to QOM realize/unrealize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu-devel@nongnu.org, Anthony Liguori , "Michael S. Tsirkin" Hi Amit, Am 12.03.2014 13:41, schrieb Amit Shah: > Hi, >=20 > I haven't really followed the whole discussion, so can't say much > about it -- overall looks alright. A couple of minor nits: >=20 >> max_nr_ports =3D tswap32(port->vser->config.max_nr_ports); >> if (port->id >=3D max_nr_ports) { >> - error_report("virtio-serial-bus: Out-of-range port id specifi= ed, max. allowed: %u", >> - max_nr_ports - 1); >> - return -1; >> + error_setg(errp, "virtio-serial-bus: Out-of-range port id spe= cified, " >> + "max. allowed: %u", >> + max_nr_ports - 1); >=20 > indentation looks off. Just put this last line on the line above? Done. (Was intentional to align error string, but no need to keep on separate lines after breaking.) >=20 >> diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/vir= tio-serial.h >> index 1d2040b..b1bc9e5 100644 >> --- a/include/hw/virtio/virtio-serial.h >> +++ b/include/hw/virtio/virtio-serial.h >> @@ -77,19 +77,19 @@ typedef struct VirtIOSerialPort VirtIOSerialPort; >> typedef struct VirtIOSerialPortClass { >> DeviceClass parent_class; >> =20 >> - /* Is this a device that binds with hvc in the guest? */ >> - bool is_console; >> - >> /* >> - * The per-port (or per-app) init function that's called when a >> + * The per-port (or per-app) realize function that's called when = a >> * new device is found on the bus. >> */ >> - int (*init)(VirtIOSerialPort *port); >> + DeviceRealize realize; >> /* >> - * Per-port exit function that's called when a port gets >> + * Per-port unrealize function that's called when a port gets >> * hot-unplugged or removed. >> */ >> - int (*exit)(VirtIOSerialPort *port); >> + DeviceUnrealize unrealize; >> + >> + /* Is this a device that binds with hvc in the guest? */ >> + bool is_console; >=20 > is_console is moved unnecessarily? Fixed. (Previously fields parent_realize were added right after parent_ob= j.) Thanks, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg