qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/8] console: add information retrival wrappers


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 3/8] console: add information retrival wrappers
Date: Wed, 20 Nov 2013 12:12:35 +0100

  Hi,

> +int qemu_get_console_index(QemuConsole *con);

Makes sense to have that.  There are other retrival wrappers already
(qemu_console_is_*).  I'd like to see the new one placed next to the
others, and follow the name convention (i.e. use
qemu_console_get_index).

> +int qemu_get_number_graphical_consoles(void);

Hmm, what is bad with qemu_console_is_graphic?  Patch #5 uses it to loop
over the gfx consoles.  As the code doesn't need to know the number of
consoles in advance you can do this instead (like spice):

    for (i = 0;; i++) {
        con = qemu_console_lookup_by_index(i);
        if (!con || !qemu_console_is_graphic(con)) {
            break;
        }
        [ ... ]
    }

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]