sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

525 Commits

Author SHA1 Message Date
aliguori 6f97dba008 Move CharDriverState code out of vl.c
The motivating goal behind this is to allow other tools to use the CharDriver
code.  This patch is pure code motion except for the Makefile changes and the
copyright/header in qemu-char.c.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5580 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 18:49:55 +00:00
aliguori 0e82f34d07 Move some declarations around in the QEMU CharDriver code
The goal of this series is to move the CharDriverState code out of vl.c and
into its own file, qemu-char.c.  This patch moves around some declarations so
the next patch can be pure code motion.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5579 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 18:44:40 +00:00
aliguori 0a1af395bc Increase default IO timeout from 10ms to 5s
With the recent changes to the main loop, we no longer have unconditional
polling.  This means we can now sleep in select() for much longer than we
previously did.  This patch increases our select() sleep time from 10ms to 5s
which is effectively unlimited since we're going to wake up sooner than that
in almost all circumstances.

With this patch, I see the number of wake-ups with an idle dynamic ticks guest
drop from 80 per second to about 15 times per second.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5578 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 18:40:25 +00:00
aliguori 56f3a5d01e Main loop fixes/cleanup
Tidy up win32 main loop bits, allow timeout >= 1s, and force timeout to 0 if
there is a pending bottom half.



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5577 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 18:07:17 +00:00
aliguori 5ccfae10a7 Implement "info chardev" command. (Gerd Hoffmann)
This patch makes qemu keep track of the character devices in use and
implements a "info chardev" monitor command to print a list.

qemu_chr_open() sticks the devices into a linked list now.  It got a new
argument (label), so there is a name for each device.  It also assigns a
filename to each character device.  By default it just copyes the
filename passed in.  Individual drivers can fill in something else
though.  qemu_chr_open_pty() sets the filename to name of the pseudo tty
allocated.

Output looks like this:

  (qemu) info chardev
  monitor: filename=unix:/tmp/run.sh-26827/monitor,server,nowait
  serial0: filename=unix:/tmp/run.sh-26827/console,server
  serial1: filename=pty:/dev/pts/5
  parallel0: filename=vc:640x480

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5575 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 17:31:29 +00:00
aliguori 492c30af25 Make DMA bottom-half driven (v2)
The current DMA routines are driven by a call in main_loop_wait() after every
select.

This patch converts the DMA code to be driven by a constantly rescheduled
bottom half.  The advantage of using a scheduled bottom half is that we can
stop scheduling the bottom half when there no DMA channels are runnable.  This
means we can potentially detect this case and sleep longer in the main loop.

The only two architectures implementing DMA_run() are cris and i386.  For cris,
I converted it to a simple repeating bottom half.  I've only compile tested
this as cris does not seem to work on a 64-bit host.  It should be functionally
identical to the previous implementation so I expect it to work.

For x86, I've made sure to only fire the DMA bottom half if there is a DMA
channel that is runnable.  The effect of this is that unless you're using sb16
or a floppy disk, the DMA bottom half never fires.

You probably should test this malc.  My own benchmarks actually show slight
improvement by it's possible the change in timing could affect your demos.

Since v1, I've changed the code to use a BH instead of a timer.  cris at least
seems to depend on faster than 10ms polling.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5573 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 17:25:56 +00:00
aliguori 1b435b1032 Make bottom halves more robust
Bottom halves are supposed to not complete until the next iteration of the main
loop.  This is very important to ensure that guests can not cause stack
overflows in the block driver code.  Right now, if you attempt to schedule a
bottom half within a bottom half callback, you will enter an infinite loop.

This patch uses the same logic that we use for the IOHandler loop to make the
bottom half processing robust in list manipulation while in a callback.

This patch also introduces idle scheduling for bottom halves.  qemu_bh_poll()
returns an indication of whether any bottom halves were successfully executed.
qemu_aio_wait() uses this to immediately return if a bottom half was executed
instead of waiting for a completion notification.

qemu_bh_schedule_idle() works around this by not reporting the callback has
run in the qemu_bh_poll loop.  qemu_aio_wait() probably needs some refactoring
but that would require a larger code audit.  idle scheduling seems like a good
compromise.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>




git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5572 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-31 17:24:21 +00:00
balrog 3d878caab9 Set default max_cpus to one.
Clean-up machine definitions.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5566 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-28 10:59:59 +00:00
blueswir1 40ea94a5d4 Suppress a GCC warning about unused function
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5534 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-25 11:26:41 +00:00
blueswir1 be15b141e0 Replace uses of strncpy (a GNU extension) with Qemu pstrcpy
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5531 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-25 11:21:28 +00:00
aliguori c1d3666532 Live migration for Win32 (Hervé Poussineau)
This patch fixes migration so that it works on Win32.  This requires using
socket specific calls since sockets cannot be treated like file descriptors
on win32.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5525 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-24 21:55:17 +00:00
aliguori 17e909738d Fix windows build after migration changes
The live migration code broke the windows build.  As part of this 
change, I've switched the BIOS path to C:\Program Files\Qemu instead of 
/c/Program Files/Qemu.  The later is only valid when launching from MSYS 
but the former is always valid.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5524 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-24 14:11:41 +00:00
aliguori 9f7965c7e9 Expand cache= option and use write-through caching by default
This patch changes the cache= option to accept none, writeback, or writethough
to control the host page cache behavior.  By default, writethrough caching is
now used which internally is implemented by using O_DSYNC to open the disk
images.  When using -snapshot, writeback is used by default since data integrity
it not at all an issue.

cache=none has the same behavior as cache=off previously.  The later syntax is
still supported by now deprecated.  I also cleaned up the O_DIRECT
implementation to avoid many of the #ifdefs.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-14 14:42:54 +00:00
aurel32 60759371f0 FreeBSD also has clock_gettime
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5481 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-13 21:08:25 +00:00
aliguori 210f41ba93 Introduce ethernet announcement function.
This patch adds an ethernet announce function that will minimize downtime
when doing a live migration.  This code originates from KVM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5477 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-13 03:13:12 +00:00
aliguori 5bb7910af0 Introduce UI for live migration
This patch introduces a command line parameter and monitor command for starting
a live migration.  The next patch will provide an example of how to use these
parameters.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5476 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-13 03:12:02 +00:00
aliguori 871d2f0796 Fix some issues with QEMUFile
This patch allows QEMUFile's read and write operations to return 
negative error codes.  This is necessary to detect things like closed 
streams during live migration.

It also removes unused code for QEMUFileFD write path.  Finally, it 
makes sure to avoid attempting to flush an output buffer if the file
is only being used for input.  This was spotted by Uri Lublin.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5474 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-13 03:07:56 +00:00
aurel32 bc7b5f873b Get rid of sys/poll.h
(C.W. Betts)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5463 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-12 00:52:58 +00:00
aliguori 9e472e101f Fix IO performance regression in sparc
Replace signalfd with signal handler/pipe.  There is no way to interrupt
the CPU execution loop when a file descriptor becomes readable.  This
results in a large performance regression in sparc emulation during
bootup.
   
This patch switches us to signal handler/pipe which was originally
suggested by Ian Jackson.  The signal handler lets us interrupt the
CPU emulation loop while the write to a pipe lets us avoid the
select/signal race condition.
    
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5451 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-08 19:50:24 +00:00
aliguori b2097003ec machine struct - specify max_cpus at the per machine level (Jes Sorensen)
Introduce a max_cpus per-machine variable, allowing individual boards
to limit it's number of CPUs. Check requested number of CPUs in setup
code and exit if it exceeds the supported number for the machine.
This also renders the static MAX_CPUS check obsolete, so remove this
from vl.c.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5443 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-07 20:39:39 +00:00
aliguori 475e427772 Switch the memory savevm handler to be "live"
This patch replaces the static memory savevm/loadvm handler with a "live" one.
This handler is used even if performing a non-live migration.

The key difference between this handler and the previous is that each page is
prefixed with the address of the page.  The QEMUFile rate limiting code, in
combination with the live migration dirty tracking bits, is used to determine
which pages should be sent and how many should be sent.

The live save code "converges" when the number of dirty pages reaches a fixed
amount.  Currently, this is 10 pages.  This is something that should eventually
be derived from whatever the bandwidth limitation is.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5437 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-06 20:21:51 +00:00
aliguori 9366f41860 Introduce v3 of savevm protocol
The current savevm/loadvm protocol has some draw backs.  It does not support
the ability to do progressive saving which means it cannot be used for live
checkpointing or migration.  The sections sizes are 32-bit integers which
means that it will not function when using more than 4GB of memory for a guest.
It attempts to seek within the output file which means it cannot be streamed.
The current protocol also is pretty lax about how it supports forward
compatibility.  If a saved section version is greater than what the restore
code support, the restore code generally treats the saved data as being in
whatever version it supports.  This means that restoring a saved VM on an older
version of QEMU will likely result in silent guest failure.

This patch introduces a new version of the savevm protocol.  It has the
following features:

 * Support for progressive save of sections (for live checkpoint/migration)
 * An asynchronous API for doing save
 * Support for interleaving multiple progressive save sections
   (for future support of memory hot-add/storage migration)
 * Fully streaming format
 * Strong section version checking

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5434 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-06 14:53:52 +00:00
blueswir1 41bd639b26 Variable autostart is not used outside main()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5419 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-05 09:56:21 +00:00
blueswir1 9dc63a1efd Make network packet debug functions more accessible
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5416 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-04 07:25:46 +00:00
blueswir1 bdaf78e09b Add some missing static qualifiers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5415 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-04 07:24:27 +00:00
blueswir1 c7cd6a3742 Make CPULogItem tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5397 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-02 18:27:46 +00:00
blueswir1 dbed7e40f6 Make some variables static
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5377 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 19:38:09 +00:00
blueswir1 342b51d74f Fix warning about incompatible types
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5373 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 18:02:50 +00:00
blueswir1 a16fa26539 Remove unused variable
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5371 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 17:57:26 +00:00
blueswir1 674bb26172 Add some missing static qualifiers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5363 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30 18:18:27 +00:00
blueswir1 98448f58c1 Silence some warnings about uninitialized variables
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5362 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30 18:16:09 +00:00
blueswir1 223f0d72a8 Few compile time warnings removed (Stefano Stabellini)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5361 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30 18:12:18 +00:00
aliguori 5dafc53f1f Refactor QEMUFile for live migration
To support live migration, we override QEMUFile so that instead of writing to
disk, the save/restore state happens over a network connection.

This patch makes QEMUFile read/write operations function pointers so that we
can override them for live migration.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5352 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 16:25:16 +00:00
balrog 1ae26a18a3 Add a "null" bluetooth HCI and a header file for bluetooth.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5342 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 23:19:47 +00:00
blueswir1 c9b1ae2cfd Add to machine structure a flag to use SCSI drives instead of IDE: fixes SS-20
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5339 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 18:55:17 +00:00
malc cb5a7aa8c3 Optional "precise" VGA retrace support
Selected via: -vga <name>,retrace=precise

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5336 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 00:42:12 +00:00
malc 3893c124e7 Change the way video graphics adapter is selected
Instead of having (current)three command line switches -std-vga,
-cirrusvga and -vmwarevga, provide one -vga switch which takes
an argument, so that:
qemu -std-vga   becomes qemu -vga std
qemu -cirrusvga becomes qemu -vga cirrus
qemu -vmwarevga becomes qemu -vga vmware

Update documentation accordingly.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5335 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 00:42:05 +00:00
blueswir1 2ca83a8dd6 Revert r5274 which breaks savevm/loadvm
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-25 20:24:19 +00:00
blueswir1 48d7c50f84 Remove unnecessary call to qemu_aio_init (called from bdrv_init)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5294 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 16:29:18 +00:00
blueswir1 67d8cec34b Add signed versions of save/load functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-20 08:04:11 +00:00
blueswir1 8fcb1b90cd Add -uuid command line option (Gleb Natapov)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5257 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-18 18:29:08 +00:00
aliguori 03ff3ca30f Use common objects for qemu-img and qemu-nbd
Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
code.  It's ugly and causes us to have to build multiple object files for
linking against qemu and the tools.

This patch introduces a new file, qemu-tool.c which contains enough for
qemu-img, qemu-nbd, and QEMU to all share the same objects.

This also required getting qemu-nbd to be a bit more Windows friendly.  I also
changed the Windows block-raw to use normal IO instead of overlapping IO since
we don't actually do AIO yet on Windows.  I changed the various #if 0's to
 #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows.

After this patch, there are no longer any #ifdef's related to qemu-img and
qemu-nbd.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-15 15:51:35 +00:00
blueswir1 8632fb9a6e qemu_next_deadline_dyntick is only used on Linux and Windows
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5210 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14 13:59:34 +00:00
blueswir1 7ccfb2eb5f Fix warnings that would be caused by gcc flag -Wwrite-strings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14 06:45:34 +00:00
aliguori 5d0c5750bb usb: Support for removing device by host addr, improved auto filter syntax (Max Krasnyansky)
This patch adds support for removing USB devices by host address.
Which is usefull for things like libvirtd because there is no easy way to
find guest USB address of the host device.
In other words you can now do:
   usb_add host:3.5
   ...
   usb_del host:3.5
Before the patch 'usb_del' did not support 'host:' notation.

----
Syntax for specifying auto connect filters has been improved.
Old syntax was
    host:bus.dev
    host:pid:vid
New syntax is
    host:auto:bus.dev[:pid:vid]
In both the cases any attribute can be set to "*".

New syntax is more flexible and lets you do things like
    host:3.*:5533:* /* grab any device on bus 3 with vendor id 5533 */

It's now possible to remove auto filters. For example:
    usb_del host:auto:3.*:5533:*

Active filters are printed after all host devices in 'info usb' output.
Which now looks like this:

  Device 1.1, speed 480 Mb/s
    Hub: USB device 1d6b:0002, EHCI Host Controller
  Device 1.4, speed 480 Mb/s
    Class 00: USB device 1058:0704, External HDD
  Auto filters:
    Device 3.* ID *:*

Signed-off-by: Max Krasnyansky <maxk@kernel.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5205 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14 01:07:41 +00:00
aliguori baf35cb902 Use signalfd() to work around signal/select race
This patch introduces signalfd() to work around the signal/select race in
checking for AIO completions.  For platforms that don't support signalfd(), we
emulate it with threads.

There was a long discussion about this approach.  I don't believe there are any
fundamental problems with this approach and I believe eliminating the use of
signals is a good thing.

I've tested Windows and Linux using Windows and Linux guests.  I've also checked
for disk IO performance regressions.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5187 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-10 15:45:19 +00:00
blueswir1 6f9e38017c Add missing "static"
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5184 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-09 18:56:59 +00:00
ths 04ba529f81 Delete unused variable.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5144 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-02 23:55:28 +00:00
aliguori f441b28b8d Do not try to use -net user as a default when slirp disabled (Jeremy Fitzhardinge)
When CONFIG_SLIRP is not defined, we should not try to use
-net user as a default.

Patch from Jeremy Fitzhardinge <jeremy@goop.org> (who is a Citrix
staff member).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5092 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-28 20:05:14 +00:00
blueswir1 9892fbfb24 Enable pty/tty functions for BSDs too (initial patch from Xen)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5079 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-24 10:34:20 +00:00