From: Eric Blake <eblake@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] vl: Replace *_vga_available() functions with class_names field
Date: Wed, 11 Nov 2015 15:09:17 -0700 [thread overview]
Message-ID: <5643BC8D.9030505@redhat.com> (raw)
In-Reply-To: <1447277273-26151-3-git-send-email-ehabkost@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
On 11/11/2015 02:27 PM, Eduardo Habkost wrote:
> Instead of requiring a separate function for each VGA interface,
> just enumerate the corresponding class names on struct
> VGAInterfaceInfo.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> vl.c | 70 +++++++++++++++++++++++---------------------------------------------
> 1 file changed, 23 insertions(+), 47 deletions(-)
>
> [VGA_CG3] = {
> .opt_name = "cg3",
> .name = "CG3 framebuffer",
> - .available = cg3_vga_available,
> + .class_names = { "cgthree" },
> },
> [VGA_XENFB] = {
> .opt_name = "xenfb",
> },
> };
>
> +static bool vga_interface_available(VGAInterfaceType t)
> +{
> + VGAInterfaceInfo *ti = &vga_interfaces[t];
> +
> + assert(t < VGA_TYPE_MAX);
> + return !ti->class_names[0] ||
> + object_class_by_name(ti->class_names[0]) ||
> + object_class_by_name(ti->class_names[1]);
Does the correct thing when ti->class_names[1] is NULL (but I had to look).
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
prev parent reply other threads:[~2015-11-11 22:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 21:27 [Qemu-devel] [PATCH 0/2] vl: Simplify vga interface configuration code Eduardo Habkost
2015-11-11 21:27 ` [Qemu-devel] [PATCH 1/2] vl: Table-based select_vgahw() Eduardo Habkost
2015-11-11 22:05 ` Eric Blake
2015-11-12 15:08 ` Eduardo Habkost
2015-11-11 21:27 ` [Qemu-devel] [PATCH 2/2] vl: Replace *_vga_available() functions with class_names field Eduardo Habkost
2015-11-11 22:09 ` Eric Blake [this message]
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=5643BC8D.9030505@redhat.com \
--to=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.