qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 134a03: main-loop: fix select_ret uninitializ


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 134a03: main-loop: fix select_ret uninitialized variable w...
Date: Thu, 21 Feb 2013 15:00:23 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 134a03e0b3d34b01b68107104c525c3bff1211d4
      
https://github.com/qemu/qemu/commit/134a03e0b3d34b01b68107104c525c3bff1211d4
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M main-loop.c

  Log Message:
  -----------
  main-loop: fix select_ret uninitialized variable warning

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: cbff4b342b000a7642125dbdabf61113e05eee44
      
https://github.com/qemu/qemu/commit/cbff4b342b000a7642125dbdabf61113e05eee44
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M main-loop.c

  Log Message:
  -----------
  main-loop: switch to g_poll() on POSIX hosts

Use g_poll(3) instead of select(2).  Well, this is kind of a cheat.
It's true that we're now using g_poll(3) on POSIX hosts but the *_fill()
and *_poll() functions are still using rfds/wfds/xfds.

We've set the scene to start converting *_fill() and *_poll() functions
step-by-step until no more rfds/wfds/xfds users remain.  Then we'll drop
the temporary gpollfds_from_select() and gpollfds_to_select() functions
and be left with native g_poll(2).

On Windows things are a little crazy: convert from rfds/wfds/xfds to
GPollFDs, back to rfds/wfds/xfds, call select(2), rfds/wfds/xfds back to
GPollFDs, and finally back to rfds/wfds/xfds again.  This is only
temporary and keeps the Windows build working through the following
patches.  We'll drop this excessive conversion later and be left with a
single GPollFDs -> select(2) -> GPollFDs sequence that allows Windows to
use select(2) while the rest of QEMU only knows about GPollFD.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 48ce11ff972c733afaed3e2a2613a2e56081ec92
      
https://github.com/qemu/qemu/commit/48ce11ff972c733afaed3e2a2613a2e56081ec92
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M main-loop.c

  Log Message:
  -----------
  main-loop: switch POSIX glib integration to GPollFD

Convert glib file descriptor polling from rfds/wfds/xfds to GPollFD.

The Windows code still needs poll_fds[] and n_poll_fds but they can now
become local variables.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: cf1d078e4ea094e516faab49678fbea3a34b7848
      
https://github.com/qemu/qemu/commit/cf1d078e4ea094e516faab49678fbea3a34b7848
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M slirp/slirp.c

  Log Message:
  -----------
  slirp: slirp/slirp.c coding style cleanup

The slirp glue code uses tabs in some places.  Since the next patch will
modify the file, convert tabs to spaces and fix checkpatch.pl issues.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 8917c3bdba37d6fe4393db0fad3fabbde9530d6b
      
https://github.com/qemu/qemu/commit/8917c3bdba37d6fe4393db0fad3fabbde9530d6b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M main-loop.c
    M slirp/libslirp.h
    M slirp/main.h
    M slirp/slirp.c
    M slirp/socket.c
    M slirp/socket.h
    M stubs/slirp.c

  Log Message:
  -----------
  slirp: switch to GPollFD

Slirp uses rfds/wfds/xfds more extensively than other QEMU components.

The rarely-used out-of-band TCP data feature is used.  That means we
need the full table of select(2) to g_poll(3) events:

  rfds -> G_IO_IN | G_IO_HUP | G_IO_ERR
  wfds -> G_IO_OUT | G_IO_ERR
  xfds -> G_IO_PRI

I came up with this table by looking at Linux fs/select.c which maps
select(2) to poll(2) internally.

Another detail to watch out for are the global variables that reference
rfds/wfds/xfds during slirp_select_poll().  sofcantrcvmore() and
sofcantsendmore() use these globals to clear fd_set bits.  When
sofcantrcvmore() is called, the wfds bit is cleared so that the write
handler will no longer be run for this iteration of the event loop.

This actually seems buggy to me since TCP connections can be half-closed
and we'd still want to handle data in half-duplex fashion.  I think the
real intention is to avoid running the read/write handler when the
socket has been fully closed.  This is indicated with the SS_NOFDREF
state bit so we now check for it before invoking the TCP write handler.
Note that UDP/ICMP code paths don't care because they are
connectionless.

Note that slirp/ has a lot of tabs and sometimes mixed tabs with spaces.
I followed the style of the surrounding code.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: a3e4b4a8091cc4fcf7cb619570c72c54c2d6a6e9
      
https://github.com/qemu/qemu/commit/a3e4b4a8091cc4fcf7cb619570c72c54c2d6a6e9
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M include/qemu/main-loop.h
    M iohandler.c
    M main-loop.c

  Log Message:
  -----------
  iohandler: switch to GPollFD

Convert iohandler_select_fill() and iohandler_select_poll() to use
GPollFD instead of rfds/wfds/xfds.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 9cbaacf999b01b27dc3a22502705178057af66de
      
https://github.com/qemu/qemu/commit/9cbaacf999b01b27dc3a22502705178057af66de
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M main-loop.c

  Log Message:
  -----------
  main-loop: drop rfds/wfds/xfds for good

Now that all *_fill() and *_poll() functions use GPollFD we no longer
need rfds/wfds/xfds or pollfds_from_select()/pollfds_to_select().

>From now on everything uses GPollFD.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: d0c8d2c05f67a1a007d87fa3b99254abfa42d06d
      
https://github.com/qemu/qemu/commit/d0c8d2c05f67a1a007d87fa3b99254abfa42d06d
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M aio-posix.c

  Log Message:
  -----------
  aio: extract aio_dispatch() from aio_poll()

We will need to loop over AioHandlers calling ->io_read()/->io_write()
when aio_poll() is converted from select(2) to g_poll(2).

Luckily the code for this already exists, extract it into the new
aio_dispatch() function.

Two small changes:

 * aio_poll() checks !node->deleted to avoid calling handlers that have
   been deleted.

 * Fix typo 'then' -> 'them' in aio_poll() comment.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 6b5f876252b7aeec43e319afdf17705f512be2bc
      
https://github.com/qemu/qemu/commit/6b5f876252b7aeec43e319afdf17705f512be2bc
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M aio-posix.c
    M async.c
    M include/block/aio.h

  Log Message:
  -----------
  aio: convert aio_poll() to g_poll(3)

AioHandler already has a GPollFD so we can directly use its
events/revents.

Add the int pollfds_idx field to AioContext so we can map g_poll(3)
results back to AioHandlers.

Reuse aio_dispatch() to invoke handlers after g_poll(3).

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: b5a01a70ad49b518c2c4b0f0a37f5435f01ce716
      
https://github.com/qemu/qemu/commit/b5a01a70ad49b518c2c4b0f0a37f5435f01ce716
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M aio-posix.c

  Log Message:
  -----------
  aio: support G_IO_HUP and G_IO_ERR

aio-posix.c could not take advantage of G_IO_HUP and G_IO_ERR because
select(2) does not have equivalent events.  Now that g_poll(3) is used
we can support G_IO_HUP and G_IO_ERR.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 2ca81baa0b3363d57de94f8b80c02a003b361161
      
https://github.com/qemu/qemu/commit/2ca81baa0b3363d57de94f8b80c02a003b361161
  Author: Jason Wang <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M qapi-schema.json
    M qemu-options.hx

  Log Message:
  -----------
  help: add docs for multiqueue tap options

Cc: Markus Armbruster <address@hidden>
Cc: Jason Wang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: ba43da36983a0bff2778abfa2338697da129030c
      
https://github.com/qemu/qemu/commit/ba43da36983a0bff2778abfa2338697da129030c
  Author: Peter Maydell <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    R TODO

  Log Message:
  -----------
  Remove elderly top level TODO file

The top level TODO file hasn't been touched since 2008, so it's now
an unhelpful and out of date mix of things that have already been done,
things that don't make sense any more and things which could in theory
be done but are not in practice important enough (or we'd have done
them some time in the last five years). Remove it. The bug tracking
system is probably a better place to track TODO items if we want to
do so.

Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: b1424e0381a7f1c9969079eca4458d5f20bf1859
      
https://github.com/qemu/qemu/commit/b1424e0381a7f1c9969079eca4458d5f20bf1859
  Author: Gerd Hoffmann <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M hw/qxl-render.c
    M hw/vga.c
    M hw/vmware_vga.c
    M hw/xenfb.c
    M include/ui/console.h
    M ui/console.c

  Log Message:
  -----------
  vga: fix byteswapping.

In case host and guest endianness differ the vga code first creates
a shared surface (using qemu_create_displaysurface_from), then goes
patch the surface format to indicate that the bytes must be swapped.

The switch to pixman broke that hack as the format patching isn't
propagated into the pixman image, so ui code using the pixman image
directly (such as vnc) uses the wrong format.

Fix that by adding a byteswap parameter to
qemu_create_displaysurface_from, so we'll use the correct format
when creating the surface (and the pixman image) and don't have
to patch the format afterwards.

[ v2: unbreak xen build ]

Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 3e407de47700cce4babbe0f3ac35677e7b852cf6
      
https://github.com/qemu/qemu/commit/3e407de47700cce4babbe0f3ac35677e7b852cf6
  Author: Peter Crosthwaite <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom/object.c: Reset interface list on inheritance

The QOM framework will attempt the recreate a classes interface list from
scratch for each class. This means that a child class should zero out the
list of interfaces when cloned from the parent class.

Currently the list is memcpy()d from the parent to the child. As the interface
list is just a pointer to a list, this means the parent and child will share
the same list of interfaces. When the child inits, it will append its own
interfaces to the parents list. This is incorrect as the parent should not pick
up its childs interfaces.

This actually causes an infinite loop at class init time, as the child will
iterate through the parent interface list adding each itf to its own list(in
type_initialize()). As the list is (erroneously) shared, the new interface
instances for the child are appended to the parent, and the iterator never hits
the tail and loops forever.

Signed-off-by: Peter Crosthwaite <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 00e2ceae6c55bef40f5128a3e606f5c44351e0f9
      
https://github.com/qemu/qemu/commit/00e2ceae6c55bef40f5128a3e606f5c44351e0f9
  Author: Peter Crosthwaite <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom/object.c: Allow itf cast with num_itfs = 0

num_interfaces only tells you how many interfaces the concrete child class has
(as defined in the TypeInfo). This means if you have a child class which defines
no interfaces of its own, but its parent has interfaces you cannot cast to those
parent interfaces.

Fixed changing the guard to check the class->interfaces list instead (which is
a complete flattened list of implemented interfaces).

Signed-off-by: Peter Crosthwaite <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 22bc9a46bda8f5f88626d3fb578f5d55953c9743
      
https://github.com/qemu/qemu/commit/22bc9a46bda8f5f88626d3fb578f5d55953c9743
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M configure

  Log Message:
  -----------
  build: disable Wstrict-prototypes

GTK won't build with strict-prototypes due to gtkitemfactory.h:

    /* We use () here to mean unspecified arguments. This is deprecated
     * as of C99, but we can't change it without breaking compatibility.
     * (Note that if we are included from a C++ program () will mean
     * (void) so an explicit cast will be needed.)
     */
    typedef     void    (*GtkItemFactoryCallback)  ();

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: d82831dbc5471d72785c49b33710436af49bf9ca
      
https://github.com/qemu/qemu/commit/d82831dbc5471d72785c49b33710436af49bf9ca
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M include/ui/console.h
    M qemu-char.c
    M ui/console.c

  Log Message:
  -----------
  console: allow VCs to be overridden by UI

We want to expose VCs using a VteTerminal widget.  We need access to provide our
own CharDriverState in order to do this.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: a4ccabcf6deaeb42c65d5d6d84ba0ceff8003876
      
https://github.com/qemu/qemu/commit/a4ccabcf6deaeb42c65d5d6d84ba0ceff8003876
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M configure
    M include/sysemu/sysemu.h
    M include/ui/console.h
    M ui/Makefile.objs
    A ui/gtk.c

  Log Message:
  -----------
  ui: add basic GTK gui (v5)

This is minimalistic and just contains the basic widget infrastructure.  The GUI
consists of a menu and a GtkNotebook.  To start with, the notebook has its tabs
hidden which provides a UI that looks very similar to SDL with the exception of
the menu bar.

The menu bar allows a user to toggle the visibility of the tabs.  Cairo is used
for rendering.

I used gtk-vnc as a reference.  gtk-vnc solves the same basic problems as QEMU
since it was originally written as a remote display for QEMU.  So for the most
part, the approach to rendering and keyboard handling should be pretty solid for
GTK.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: d861def367b516055dc4c46dc1305143ee653c84
      
https://github.com/qemu/qemu/commit/d861def367b516055dc4c46dc1305143ee653c84
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M ui/gtk.c

  Log Message:
  -----------
  gtk: add virtual console support (v2)

This enables VteTerminal to be used to render the text consoles.  VteTerminal is
the same widget used by gnome-terminal which means it's VT100 emulation is as
good as they come.

It's also screen reader accessible, supports copy/paste, proper scrolling and
most of the other features you would expect from a terminal widget.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: 5104a1f65088285ddf870aa641b9061064e8757d
      
https://github.com/qemu/qemu/commit/5104a1f65088285ddf870aa641b9061064e8757d
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M ui/gtk.c

  Log Message:
  -----------
  gtk: add support for input grabbing (v2)

There is a small deviation from SDL's behavior here.  Instead of Ctrl+Alt
triggering grab, we now use Ctrl-Alt-g to trigger grab.

GTK will not accept Ctrl+Alt as an accelerator since it just consists of
modifiers.  Having grab as a proper accelerator is important as it allows a user
to override the accelerator for accessibility purposes.

We also are not automatically grabbing on left-click.  Besides the inability to
tie mouse clicks to an accelerator, I think this behavior is hard to discover
and since it only happens depending on the guest state, it can lead to confusing
behavior.

This can be changed in the future if there's a strong resistence to dropping
left-click-to-grab, but I think we're better off dropping it.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: c61584833c579cd7bf800499124ce3d0e15bfb37
      
https://github.com/qemu/qemu/commit/c61584833c579cd7bf800499124ce3d0e15bfb37
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M ui/gtk.c

  Log Message:
  -----------
  gtk: add support for screen scaling and full screen (v5)

Basic menu items to enter full screen mode and zoom in/out.  Unlike SDL, we
don't allow arbitrary scaling based on window resizing.  The current behavior
with SDL causes a lot of problems for me.

Sometimes I accidentally resize the window a tiny bit while trying to move it
(Ubuntu's 1-pixel window decorations don't help here).  After that, scaling is
now active and if the screen changes size again, badness ensues since the
aspect ratio is skewed.

Allowing zooming by 25% in and out should cover most use cases.  We can add a
more flexible scaling later but for now, I think this is a more friendly
behavior.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: 834574ea89fa9c3ee0a557a13ad3f50db2509054
      
https://github.com/qemu/qemu/commit/834574ea89fa9c3ee0a557a13ad3f50db2509054
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M Makefile
    M configure
    A po/Makefile
    A po/de_DE.po
    A po/it.po
    A po/messages.po
    M ui/gtk.c

  Log Message:
  -----------
  gtk: add translation support (v5)

This includes a de_DE translation from Kevin Wolf and an it translation from
Paolo Bonzini.

Cc: Paolo Bonzini <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: 15546425c5527ebb08ede399373b705866f1ff84
      
https://github.com/qemu/qemu/commit/15546425c5527ebb08ede399373b705866f1ff84
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  gtk: make default UI (v5)

A user can still enable SDL with '-sdl' or '-display sdl' but start making the
default display GTK by default.

I'd also like to deprecate the SDL display and remove it in a few releases.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


  Commit: 73d4dc71f3a41131541c73b3ac2a8b160a51842b
      
https://github.com/qemu/qemu/commit/73d4dc71f3a41131541c73b3ac2a8b160a51842b
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-21 (Thu, 21 Feb 2013)

  Changed paths:
    M ui/gtk.c

  Log Message:
  -----------
  gtk: suppress accelerators from the File menu when grab is active

If you're full screen, you probably expect Ctrl-Q to go to the guest,
not the host.  I think restricting certain menus is the right way to
handle this generally speaking.

Signed-off-by: Anthony Liguori <address@hidden>
Message-id: address@hidden


Compare: https://github.com/qemu/qemu/compare/70aa41b56ce3...73d4dc71f3a4

reply via email to

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