aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-09-05Fix Sparse warnings: add "static"Blue Swirl3-3/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-05esp: handle "select without attention"Artyom Tarasenko1-5/+23
Up to now "select without attention" was handled the same way as "select with attention". According to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt select without ATN sends the CDB (Command Descriptor Block) directly, whereas select with ATN sends one message phase byte followed by 6, 10, or 12 command phase bytes. The attached patch implements the behaviour described above. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> [blauwirbel@gmail.com: cleaned up formatting] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-04Include sys-queue.h early to override system queue definitions on BSDBlue Swirl1-0/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-04Shuffle lines to avoid gcc 3 warning about redundant redeclarationBlue Swirl3-18/+18
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-04Bring pcbios, seabios, and vgabios into the tree as git submodules. Right now,Anthony Liguori31-2097/+26
they aren't integrated into the build but we can do that incrementally. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04mips malta: Fix fdc regression and use qdev for i8042 setupStefan Weil5-22/+19
8baf73adf664e79eae201c3f618078a220a661d9 (qdev/isa: convert fdc) breaks MIPS Malta: Tried to create isa device isa-fdc with no isa bus present Fix this by creating an isa bus for piix4. This change also requires some more qdev related changes (similar changes were applied to pc.c) and allows cleaning of piix3/piix4 code. Thanks to Gerd Hoffmann for his hints. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QDict unit-testsLuiz Capitulino3-1/+367
This suite contains tests to assure that QDict API works as expected. To execute it you should have check installed and build QEMU with check support enabled (--enable-check-utests) and then run: $ ./check-qdict Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QDict test data fileLuiz Capitulino1-0/+4999
This file is used by the QDict stress test, it adds 5k nodes on the dictionary and performs various operations. My original file had 21k entries and almost 400k of size. After some discussion with Eduardo Habkost, I decided to reduce the size. There are ways to generate this kind of data dynamically, but it has its problems too. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QString unit-testsLuiz Capitulino3-1/+102
This suite contains tests to assure that QString API works as expected. To execute it you should have check installed and build QEMU with check support enabled (--enable-check-utests) and then run: $ ./check-qstring Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QInt unit-testsLuiz Capitulino3-1/+113
This suite contains tests to assure that QInt API works as expected. To execute it you should have check installed and build QEMU with check support enabled (--enable-check-utests) and then run: $ ./check-qint Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Add check supportLuiz Capitulino1-0/+31
Check is a unit testing framework for C. All the QObjects have unit-tests and more will be written for the future data types. More info about check can be found at: http://check.sourceforge.net/ Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Update supported types documentationLuiz Capitulino1-1/+3
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: fail when 'i' type is greater than 32-bitLuiz Capitulino1-0/+6
The 'i' argument type is for 32-bit only and most handlers will use an 'int' to store its value. It's better to fail gracefully when the user enters a value greater than 32-bit than to get subtle casting bugs. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Drop args[] handling codeLuiz Capitulino1-61/+10
This commit drops all the code used to handle the 'args[]' array, as now we use a dictionary to pass arguments. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Drop str_allocated[]Luiz Capitulino1-11/+2
It's not used anymore, as QDict is now used to handle string memory allocation/deallocation. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Drop unused macrosLuiz Capitulino1-12/+0
GET_TLONG() and GET_TPHYSADDR() are not needed anymore, QInt can handle such conversions. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Split monitor_handle_command()Luiz Capitulino1-34/+39
In order to help the integration with unit-tests and having a better design, this commit splits monitor_handle_command() into two parts. The parsing code is moved to a function called monitor_parse_command(), while allocating memory and calling the handler is still done by monitor_handle_command(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_10 to use QDictLuiz Capitulino1-18/+8
This commit ports command handlers that receive ten arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Drop handler_8 and handler_9Luiz Capitulino1-16/+0
Commit 79c4f6b08009a1d23177c2be8bd003253cf3686a added handler_8 and handler_9 handling, but there isn't any command handler with those number of arguments. Just drop them. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_7 to use QDictLuiz Capitulino1-12/+10
This commit ports command handlers that receive seven arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_6 to use QDictLuiz Capitulino1-8/+6
This commit ports command handlers that receive six arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_5 to use QDictLuiz Capitulino1-21/+28
This commit ports command handlers that receive five arguments to use the new monitor's dictionary. Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_4 to use QDictLuiz Capitulino1-13/+9
This commit ports command handlers that receive four arguments to use the new monitor's dictionary. Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_3 to use QDictLuiz Capitulino5-23/+28
This commit ports command handlers that receive three arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_2 to use QDictLuiz Capitulino7-20/+35
This commit ports command handlers that receive two arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_1 to use QDictLuiz Capitulino8-47/+67
This commit ports command handlers that receive one argument to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_0 to use QDictLuiz Capitulino3-11/+12
This commit ports command handlers that receive no arguments to use the new monitor's dictionary. It might seem no sense to do this, as the handlers have no arguments, but at the end of this porting work all handlers will have the same structure. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Export QDict headerLuiz Capitulino1-0/+1
Command handlers will have to use QDict functions, so export qdict.h through monitor.h. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Setup a QDict with arguments to handlersLuiz Capitulino1-0/+18
With this commit monitor_handle_command() will be able to setup a QDict with arguments to command handlers. However, the current 'args[]' method is still being used, next changes will port commands to get their arguments from the dictionary. Two changes are worth noting: 1. The '/' argument type always adds the following standard keys in the dictionary: 'count', 'format' and 'size'. This way, the argument name used in the 'args_type' string doesn't matter 2. The optional argument type '?' doesn't need to pass the additional 'has_arg' argument, hanlders can do the same check with qdict_haskey() Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: New format for handlers argument typesLuiz Capitulino2-59/+98
Current handlers argument types, as defined in qemu-monitor.hx file, are a sequence of chars where each one represents one argument type of the command handler. The number of chars is also used to know how many arguments a given handler accepts. This commit defines a new format, which makes mandatory the use of a name for each argument. For example, do_eject() command handler is currently defined as: { "eject", "-fB", do_eject, ... } With the new format it becomes: { "eject", "force:-f,filename:B", do_eject, ... } This way the Monitor will be capable of setting up a dictionary, using each argument's name as the key and the argument itself as the value. This commit also adds two new functions: key_get_info() and next_arg_type(), both are used to parse the new format. Currently key_get_info() consumes the 'key' part of the new format and discards it, this way the current parsing code is not affected by this change. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Add wrappers to functions used by the MonitorLuiz Capitulino4-2/+13
Some functions exported to be used by the Monitor as command handlers are also called in other places as regular functions. When those functions got ported to use the Monitor dictionary to pass argments, the callers will have to setup a dictionary to be able to call them. To avoid this problem, this commit add wrappers to those functions, so that we change the wrapper to accept the dictionary, letting the current functions as is. The following wrappers are being added: - do_help_cmd() - do_pci_device_hot_remove() Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QDictLuiz Capitulino4-1/+341
QDict is a high-level dictionary data type that can be used to store a collection of QObjects. A unique key is associated with only one QObject. The following functions are available: - qdict_new() Create a new QDict - qdict_put() Add a new 'key:object' pair - qdict_get() Get the QObject of a given key - qdict_del() Delete a 'key:object' pair - qdict_size() Return the size of the dictionary - qdict_haskey() Check if a given 'key' exists Some high-level helpers to operate on QStrings and QInts objects are also provided. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QStringLuiz Capitulino4-1/+90
QString is a high-level data type that can be used to represent C strings. The following functions are available: - qstring_from_str() Create a new QString - qstring_get_str() Get a pointer to the stored string Note that qstring_get_str() is too low-level for a data type like this, but it's interesting for quick read-only accesses. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QIntLuiz Capitulino4-0/+84
QInt is a high-level data type that can be used to represent integers, internally it stores an int64_t value. The following functions are available: - qint_from_int() Create a new QInt - qint_get_int() Get the stored integer Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Introduce QObjectLuiz Capitulino1-0/+106
This commit introduces the qobject.h header file, it contains basic QObject definitions and helper macros. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04ide: move cmd+irq from IDEState to IDEBus.Gerd Hoffmann3-63/+55
These variables are per bus, not per drive. Lets move them and cleanup things a bit. And fix the cmd migration bug for real. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04ide: pass down DriveInfo instead of BlockDriverStateGerd Hoffmann19-59/+46
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Support for multiple -monitor devicesJan Kiszka1-16/+46
Rebased version of Anthony's patch: Allow to specify more than one monitor terminal via the -monitor command line switch. This is particularly useful when libvirt or some other management tool already occupies the primary monitor but you need another one for debugging. The current clumsy workaround is to multiplex such additional terminals over a qemu character device (e.g. -serial mon:<device>). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04net: Fix send queue orderingJan Kiszka2-19/+15
Ensure that packets enqueued for delayed delivery are dequeued in FIFO order. At least one simplistic guest TCP/IP stack became unhappy due to sporadically reordered packet streams. At this chance, switch the send queue implementation to TAILQ. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04do not issue ioctl from within the io threadGlauber Costa1-1/+1
According to Documentation/kvm/api.txt, (and well, to common sense), we should not be calling vcpu ioctls from within the iothread. Since vcpu initialization issues a vcpu ioctl, move it a little bit further in time to prevent it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Delay sighandler_setup()Juan Quintela1-5/+5
If we are using --serial telnet:0:5555,server or similar, ^C will not kill qemu. We need to first connect using telnet, and the the ^C takes effect. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Remove typedef for bool from eepro100.cAmit Shah1-2/+1
eepro100.c shouldn't have the need to do this in its local header file. And I recently started getting this: $ make -j3 ... CC x86_64-softmmu/eepro100.o /home/amit/src/qemu/hw/eepro100.c:112: error: two or more data types in declaration specifiers /home/amit/src/qemu/hw/eepro100.c:112: warning: useless type name in empty declaration make[1]: *** [eepro100.o] Error 1 so just remove the typedef and include <stdbool.h> instead. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04add documentation for multi-core featuresAndre Przywara1-3/+11
extend QEMU's internal help and man page to cover the recently added multi-core feature. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04piix3: use new vmstate infrastructureJuan Quintela1-27/+11
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04i440fx: use new vmstate infrastructureJuan Quintela1-12/+24
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04VMState: Fix sub-structs versioningJuan Quintela1-1/+1
We can't check the version in a substruct, it is not stored anywhere Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Update SaveVM versionsJuan Quintela1-15/+25
Now that we have all fields belonging to a PCIDevice, save each field on the device that it belongs. This means moving pci_irq_levels from PCII440FXState to PIIX3State. Old formats are loaded, but we only save on the new saner format. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04pci_irq_levels[] belong to PIIX3StateJuan Quintela1-7/+6
With previous cleanups, now it is possible to put it where it belongs Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Save irq_state into PCII440FXStateJuan Quintela1-0/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04We can add piix3_dev now to PIIX3IrqStateJuan Quintela1-6/+6
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>