From: Amit Shah <amit.shah@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/2] virtio-serial-port: Convert to QOM realize/unrealize
Date: Wed, 12 Mar 2014 18:11:26 +0530 [thread overview]
Message-ID: <20140312124126.GC24378@grmbl.mre> (raw)
In-Reply-To: <1394473079-17911-3-git-send-email-afaerber@suse.de>
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
next prev parent reply other threads:[~2014-03-12 12:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 17:37 [Qemu-devel] [PATCH v3 0/2] QOM realize for virtio-console Andreas Färber
2014-03-10 17:37 ` [Qemu-devel] [PATCH v3 1/2] virtio-console: QOM cast cleanup for VirtConsole Andreas Färber
2014-03-10 17:37 ` [Qemu-devel] [PATCH v3 2/2] virtio-serial-port: Convert to QOM realize/unrealize Andreas Färber
2014-03-12 12:41 ` Amit Shah [this message]
2014-03-12 19:03 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140312124126.GC24378@grmbl.mre \
--to=amit.shah@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).