Commit Graph

24882 Commits

Author SHA1 Message Date
Paolo Bonzini a9384aff53 blockdev: add discard suboption to -drive
Add support for BDRV_O_UNMAP from the QEMU command-line.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:29:42 +01:00
Paolo Bonzini 9e8f1835ea block: implement BDRV_O_UNMAP
It is better to present homogeneous hardware independent of the storage
technology that is chosen on the host, hence we make discard a host
parameter; the user can choose whether to pass it down to the image
format and protocol, or to ignore it.

Using DISCARD with filesystems can cause very severe fragmentation, so it
is left default-off for now.  This can change later when we implement the
"anchor" operation for efficient management of preallocated files.

There is still one choice to make: whether DISCARD has an effect on the
dirty bitmap or not.  I chose yes, though there is a disadvantage: if
the guest is buggy and issues discards for data that is in use, there
will be no way to migrate storage for that guest without downgrading
the machine type to an older one.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:29:42 +01:00
Peter Lieven 9a665b2b86 block: complete all IOs before .bdrv_truncate
bdrv_truncate() invalidates the bdrv_check_request() result for
in-flight requests, so there should better be none.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Reported-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:10 +01:00
Paolo Bonzini 027003152f coroutine: trim down nesting level in perf_nesting test
20000 nested coroutines require 20 GB of virtual address space.
Only nest 1000 of them so that the test (only enabled with
"-m perf" on the command line) runs on 32-bit machines too.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:10 +01:00
Paolo Bonzini 402397843e coroutine: move pooling to common code
The coroutine pool code is duplicated between the ucontext and
sigaltstack backends, and absent from the win32 backend.  But the
code can be shared easily by moving it to qemu-coroutine.c.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:10 +01:00
Kevin Wolf 4dc9f9d67d qemu-iotests: Test qcow2 image creation options
Just create lots of images and try out each of the creation options that
qcow2 provides (except backing_file/fmt for now)

I'm not totally happy with the behaviour of qemu-img in each of the
cases, but let's be explicit and update the test when we do change
things later.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:10 +01:00
Miroslav Rezanina e930d201bc qemu-iotests: Add qemu-img compare test
Simple test for qemu-img compare to check it's working correctly.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:10 +01:00
Miroslav Rezanina d14ed18c8d qemu-img: Add compare subcommand
This patch adds new qemu-img subcommand that compares content of two disk
images.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:10 +01:00
Miroslav Rezanina f382d43a91 qemu-img: Add "Quiet mode" option
There can be a need to turn output to stdout off. This patch adds a -q option
that enable "Quiet mode". In Quiet mode, only errors are printed out.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Miroslav Rezanina b35b2bba5b block: Add synchronous wrapper for bdrv_co_is_allocated_above
There's no synchronous wrapper for bdrv_co_is_allocated_above function
so it's not possible to check for sector allocation in an image with
a backing file.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi 7d81c1413c block: refuse negative iops and bps values
Negative I/O throttling iops and bps values do not make sense so reject
them with an error message.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi c546194f26 block: use Error in do_check_io_limits()
The do_check_io_limits() function returns false when I/O limits are
invalid but it doesn't set an Error to indicate why.  The two
do_check_io_limits() callers duplicate error reporting.  Solve this by
passing an Error pointer into do_check_io_limits().

Note that the two callers report slightly different errors: drive_init()
prints a custom error message while qmp_block_set_io_throttle() does
error_set(errp, QERR_INVALID_PARAMETER_COMBINATION).

QERR_INVALID_PARAMETER_COMBINATION is a generic error, see
include/qapi/qmp/qerror.h:

  #define QERR_INVALID_PARAMETER_COMBINATION \
    ERROR_CLASS_GENERIC_ERROR, "Invalid parameter combination"

Since it is generic we are not obliged to keep this error.  Switch to
the custom error message which contains more information.

This patch prepares for adding additional checks with their own error
messages to do_check_io_limits().  The next patch adds a new check.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi 4db35162ea qcow2: support compressed clusters in BlockFragInfo
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi e6439d783c qemu-img: add compressed clusters to BlockFragInfo
Show how many clusters are compressed.  This can be used to monitor how
many compressed clusters remain and whether to recompress the image.

Suggested-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi c9fc508398 qemu-img: fix missing space in qemu-img check output
The qemu-img check fragmentation printf() is missing a space before the
'=' sign.  The human output is not guaranteed to be stable and we are
not aware of screen scrapers, so add the missing space.

Also fix the missing indentation of the printf() arguments.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi fba31bae2d qcow2: record fragmentation statistics during check
The qemu-img check command can display fragmentation statistics:
 * Total number of clusters in virtual disk
 * Number of allocated clusters
 * Number of fragmented clusters

This patch adds fragmentation statistics support to qcow2.

Compressed and normal clusters count as allocated.  Zero clusters are
not counted as allocated unless their L2 entry has a non-zero offset
(e.g. preallocation).

Only the current L1 table counts towards the statistics - snapshots are
ignored.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Stefan Hajnoczi 801f704452 qcow2: introduce check_refcounts_l1/l2() flags
The check_refcounts_l1/l2() functions have a check_copied argument to
check that the QCOW_O_COPIED flag is consistent with refcount == 1.
This should be a bool, not an int.

However, the next patch introduces qcow2 fragmentation statistics and
also needs to pass an option to check_refcounts_l1/l2().  This is a good
opportunity to use an int flags field.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22 21:21:09 +01:00
Federico Simoncelli 8599ea4c42 qemu-img: add json output option to the check command
This option --output=[human|json] makes qemu-img check output a human
or JSON representation at the choice of the user.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:08 +01:00
Federico Simoncelli c6bb9ad198 qemu-img: find the image end offset during check
This patch adds the support for reporting the image end offset (in
bytes). This is particularly useful after a conversion (or a rebase)
where the destination is a block device in order to find the first
unused byte at the end of the image.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-22 21:21:08 +01:00
Anthony Liguori 5cbb082837 ui/gtk: require at least GTK 2.18 and VTE 0.26
This gives us the bare amount of features we need.  We can add work arounds
for older versions and lower the requirement but this should be a good
starting point.

Suggested-by: Daniel Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - tremendous simplification suggested by danpb
2013-02-22 09:53:56 -06:00
Gerd Hoffmann 82fb0c8908 unbreak hw/usb/redirect.c build
Commit 8550a02d12 added a streams
parameter to usb_wakeup and didn't update redirect.c.  Fix it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-22 09:53:56 -06:00
Stefan Weil 3f58eadeed ui/gtk: Fix build (missing include for setlocale)
At least for Ubuntu Linux locale.h is needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1361514481-26164-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-22 07:17:04 -06:00
Anthony Liguori 73d4dc71f3 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-10-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:49 -06:00
Anthony Liguori 15546425c5 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-9-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:49 -06:00
Anthony Liguori 834574ea89 gtk: add translation support (v5)
This includes a de_DE translation from Kevin Wolf and an it translation from
Paolo Bonzini.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1361367806-4599-8-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori c61584833c 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-7-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori 5104a1f650 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-6-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori d861def367 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-5-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori a4ccabcf6d 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-4-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori d82831dbc5 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Anthony Liguori 22bc9a46bd 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 <aliguori@us.ibm.com>
Message-id: 1361367806-4599-2-git-send-email-aliguori@us.ibm.com
2013-02-21 16:34:48 -06:00
Peter Crosthwaite 00e2ceae6c 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 <peter.crosthwaite@xilinx.com>
Message-id: a8c2db3b9b1f3c4bb81aca352b69e33260f36545.1361246206.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:34:10 -06:00
Peter Crosthwaite 3e407de477 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 <peter.crosthwaite@xilinx.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1f58d2b629d82865dbb2fd5ba8445854049c4382.1361246206.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:34:10 -06:00
Gerd Hoffmann b1424e0381 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: qemu-stable@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk
Cc: agraf@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1361349432-23884-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:34:00 -06:00
Peter Maydell ba43da3698 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 <peter.maydell@linaro.org>
Message-id: 1361377462-19816-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:33:54 -06:00
Jason Wang 2ca81baa0b help: add docs for multiqueue tap options
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-id: 1361354641-51969-1-git-send-email-jasowang@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:33:48 -06:00
Stefan Hajnoczi b5a01a70ad 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-11-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi 6b5f876252 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-10-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi d0c8d2c05f 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-9-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi 9cbaacf999 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-8-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi a3e4b4a809 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-7-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi 8917c3bdba 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-6-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:31 -06:00
Stefan Hajnoczi cf1d078e4e 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-5-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:30 -06:00
Stefan Hajnoczi 48ce11ff97 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-4-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:30 -06:00
Stefan Hajnoczi cbff4b342b 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 <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-3-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:30 -06:00
Stefan Hajnoczi 134a03e0b3 main-loop: fix select_ret uninitialized variable warning
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-2-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21 16:17:30 -06:00
Anthony Liguori 70aa41b56c Merge remote-tracking branch 'kraxel/usb.78' into staging
# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/usb.78:
  uas-uas: usb3 streams
  usb-xhci: usb3 streams
  usb-core: usb3 streams
  usb: fix endpoint descriptor ordering
  usb-redir: simplify packet copy
  usb: make usb_packet_copy operate on combined packets
  usb: add usb_ep_set_halted
  usb-host: remove usb_host_device_close
  usb-host: move legacy cmd line bits
  usb-storage: use scsi_req_enqueue return value
  allow disabling usb smartcard support
  make usb devices configurable
  fix scripts/make_device_config.sh
  usb: Makefile cleanup
2013-02-21 09:39:17 -06:00
Anthony Liguori 259dc0c1ce Merge remote-tracking branch 'stefanha/trivial-patches' into staging
# By Alin Tomescu (1) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
  .gitignore: Ignore optionrom/*.asm
  ppc: fix bamboo >256MB RAM initialization in hw/ppc4xx_devs.c
  Add some missing qtest binaries to .gitignore
  xilinx_axienet.c: Assert no error when making link
  Remove forward declaration of non-existant variable
2013-02-21 09:38:27 -06:00
Cole Robinson 159c9836d0 .gitignore: Ignore optionrom/*.asm
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-21 10:38:07 +01:00
Alin Tomescu 11e5d738a4 ppc: fix bamboo >256MB RAM initialization in hw/ppc4xx_devs.c
I was trying to launch a PowerPC "bamboo" machine with more than 256MB of RAM
with qemu-system-ppc -M bamboo -kernel $kernel -initrd $ramdisk -m 512, but QEMU
would just hang. However, when I used -m 256, the machine would boot.

I looked through the code in hw/ and it seems there is an error when the
RAM memory is setup (if my understanding is correct).

After patching it, the machine launched and booted successfully with 512MB of
RAM.

Signed-off-by: Alin Tomescu <tomescu.alin@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-21 10:34:19 +01:00