From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNiTb-0005Ef-Gz for qemu-devel@nongnu.org; Wed, 12 Mar 2014 08:41:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNiTV-0005ri-6p for qemu-devel@nongnu.org; Wed, 12 Mar 2014 08:41:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNiTU-0005rZ-Ux for qemu-devel@nongnu.org; Wed, 12 Mar 2014 08:41:33 -0400 Date: Wed, 12 Mar 2014 18:11:26 +0530 From: Amit Shah Message-ID: <20140312124126.GC24378@grmbl.mre> References: <1394473079-17911-1-git-send-email-afaerber@suse.de> <1394473079-17911-3-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394473079-17911-3-git-send-email-afaerber@suse.de> 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: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, Anthony Liguori , "Michael S. Tsirkin" Hi, I haven't really followed the whole discussion, so can't say much about it -- overall looks alright. A couple of minor nits: > max_nr_ports = tswap32(port->vser->config.max_nr_ports); > if (port->id >= max_nr_ports) { > - error_report("virtio-serial-bus: Out-of-range port id specified, max. allowed: %u", > - max_nr_ports - 1); > - return -1; > + error_setg(errp, "virtio-serial-bus: Out-of-range port id specified, " > + "max. allowed: %u", > + max_nr_ports - 1); indentation looks off. Just put this last line on the line above? > diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-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; > > - /* 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; is_console is moved unnecessarily? Amit