summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-23convert net_init_tap() to NetClientOptionsLaszlo Ersek8-70/+71
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_vde() to NetClientOptionsLaszlo Ersek1-10/+7
v1->v2: - NetdevVdeOptions::port and ::mode are of type uint16. Remove superfluous range checks. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_socket() to NetClientOptionsLaszlo Ersek1-76/+43
I "reverse engineered" the following permissions between the -socket sub-options: fd listen connect mcast udp | localaddr fd x . . . . | . listen . x . . . | . connect . . x . . | . mcast . . . x . | x udp . . . . x | x -------------------------------------------+ localaddr . . . x x x I transformed the code accordingly. The real fix would be to embed "fd", "listen", "connect", "mcast" and "udp" in a separate union. However OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as union discriminator. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_slirp() to NetClientOptionsLaszlo Ersek1-68/+25
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_dump() to NetClientOptionsLaszlo Ersek1-4/+17
v1->v2: - NetdevDumpOptions::len is of type 'size', whose C type was changed to uint64_t. Adapt the printf() format specifier macro. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_nic() to NetClientOptionsLaszlo Ersek1-17/+22
v1->v2: - NetLegacyNicOptions::vectors is of type uint32 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_client_init() to OptsVisitorLaszlo Ersek12-346/+127
The net_client_init() prototype is kept intact. Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a Netdev or a NetLegacy. The original meat of net_client_init() is moved to and simplified in net_client_init1(): Fields not common between -net and -netdev are clearly separated. Getting the name for the init functions is cleaner: Netdev::id is mandatory, and all init functions handle a NULL NetLegacy::name. NetLegacy::vlan explicitly depends on -net (see below). Verifying the "type=" option for -netdev can be turned into a switch. Format validation with qemu_opts_validate() can be removed because the visitor covers it. Relatedly, the "net_client_types" array is reduced to an array of init functions that can be directly indexed by opts->kind. (Help text is available in the schema JSON.) The outermost negation in the condition around qemu_find_vlan() was flattened, because it expresses the dependent code's requirements more clearly. VLAN lookup is avoided if there's no init function to pass the VLAN to. Whenever the value of type=... is needed, we substitute NetClientOptionsKind_lookup[kind]. The individual init functions are not converted yet, thus the original QemuOpts instance is passed transparently. v1->v2: - NetLegacy::name is optional. Tracked it through all init functions: they all handle a NULL name. Updated commit message accordingly. v2->v3: - NetLegacy::id is allowed and takes precedence over NetLegacy::name. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)Laszlo Ersek34-83/+71
NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_ Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi schema: add Netdev typesLaszlo Ersek1-0/+278
NetdevTapOptions::sndbuf and NetdevDumpOptions::len use the new "size" type. v1->v2: - NetLegacy::name is optional - NetLegacyNicOptions::vectors is of type uint32 - NetdevVdeOptions::port and ::mode are of type uint16 - NetLegacy::vlan has type int32 v2->v3: - NetLegacy::id is allowed and takes precedence over NetLegacy::name - replace "@traits" with "@opts" in NetLegacy & Netdev descriptions Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi schema: remove trailing whitespaceLaszlo Ersek1-5/+5
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: introduce OptsVisitorLaszlo Ersek3-1/+459
This visitor supports parsing -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...] style QemuOpts objects into "native" C structures. After defining the type tree in the qapi schema (see below), a root type traversal with this visitor linked to the underlying QemuOpts object will build the "native" C representation of the option. The type tree in the schema, corresponding to an option with a discriminator, must have the following structure: struct scalar member for non-discriminated optarg 1 [*] list for repeating non-discriminated optarg 2 [*] wrapper struct single scalar member union struct for discriminator case 1 scalar member for optarg 3 [*] list for repeating optarg 4 [*] wrapper struct single scalar member scalar member for optarg 5 [*] struct for discriminator case 2 ... The "type" optarg name is fixed for the discriminator role. Its schema representation is "union of structures", and each discriminator value must correspond to a member name in the union. If the option takes no "type" descriminator, then the type subtree rooted at the union must be absent from the schema (including the union itself). Optarg values can be of scalar types str / bool / integers / size. Members marked with [*] may be defined as optional in the schema, describing an optional optarg. Repeating an optarg is supported; its schema representation must be "list of structure with single mandatory scalar member". If an optarg is not described as repeating in the schema (ie. it is defined as a scalar field instead of a list), its last occurrence will take effect. Ordering between differently named optargs is not preserved. A mandatory list (or an optional one which is reported to be available), corresponding to a repeating optarg, has at least one element after successful parsing. v1->v2: - Update opts_type_size() prototype to uint64_t. - Add opts_type_uint64() for options needing the full uint64_t range. (Internals could be extracted to "cutils.c".) - Allow negative values in opts_type_int(). - Rebase to nested Makefiles. v2->v3: - Factor opts_visitor_insert() out of opts_start_struct() and call it separately for opts_root->id if there's any. - Don't require non-negative values in opts_type_int()'s error message. - g_malloc0() may return NULL for zero-sized requests. Support empty structures by requesting 1 byte for them instead. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23expose QemuOpt and QemuOpts struct definitions to interested partiesLaszlo Ersek2-23/+54
The only clients should be the existent "qemu-option.c", and the upcoming "qapi/opts-visitor.c". Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: introduce "size" typeLaszlo Ersek3-0/+12
v1->v2: - fall back to uint64 rather than int Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: generate C types for fixed-width integersLaszlo Ersek1-0/+4
(Long line folded using parens: <http://www.python.org/dev/peps/pep-0008/#maximum-line-length>.) Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: add test case for deallocating traversal of incomplete structureLaszlo Ersek1-0/+42
v3: - new patch Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: fix error propagationPaolo Bonzini6-70/+121
Don't overwrite / leak previously set errors. Make traversal cope with missing mandatory sub-structs. Don't try to end a container that could not be started. v1->v2: - unchanged v2->v3: - instead of examining, assert that we never overwrite errors with error_set() - allow visitors to set a NULL struct pointer successfully, so traversal of incomplete objects can continue - check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a typo, "obj != NULL" implies "*obj != NULL" here) - fix start_struct / end_struct balance for unions as well Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan HajnocziStefan Hajnoczi1-1/+2
The net subsystem has lacked an active maintainer since 2009. I have built and tested a net-next tree to get the ball rolling again. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19Revert "audio: Make PC speaker audio card available by default"Anthony Liguori1-2/+2
This reverts commit 504972922da9b562f15e13544d3efca84b46b8fd which broke the build for ARM. I don't think this change is necessary. If I'm wrong, please recommit this changeset with an appropriate fix for ARM. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-19audio: Make PC speaker audio card available by defaultJan Kiszka1-2/+2
[ The following text is in the "ISO-8859-1" character set. ] [ Your display is set for the "KOI8-R" character set. ] [ Some special characters may be displayed incorrectly. ] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: malc <av1474@comtv.ru>
2012-07-18Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori39-697/+1325
* kwolf/for-anthony: (41 commits) fdc-test: Clean up a bit fdc-test: introduce test_relative_seek fdc: fix relative seek qemu-iotests: Valgrind support coroutine-ucontext: Help valgrind understand coroutines qemu-io: Fix memory leaks hw/block-common: Factor out fall back to legacy -drive cyls=... blockdev: Don't limit DriveInfo serial to 20 characters hw/block-common: Factor out fall back to legacy -drive serial=... hw/block-common: Move BlockConf & friends from block.h Relax IDE CHS limits from 16383,16,63 to 65535,16,255 blockdev: Drop redundant CHS validation for if=ide hd-geometry: Compute BIOS CHS translation in one place qtest: Test we don't put hard disk info into CMOS for a CD-ROM ide pc: Put hard disk info into CMOS only for hard disks block: Geometry and translation hints are now useless, purge them qtest: Cover qdev property for BIOS CHS translation ide: qdev property for BIOS CHS translation qdev: New property type chs-translation qdev: Collect private helpers in one place ...
2012-07-18Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori22-142/+230
* qemu-kvm/uq/master: virtio: move common irqfd handling out of virtio-pci virtio: move common ioeventfd handling out of virtio-pci event_notifier: add event_notifier_set_handler memory: pass EventNotifier, not eventfd ivshmem: wrap ivshmem_del_eventfd loops with transaction ivshmem: use EventNotifier and memory API event_notifier: add event_notifier_init_fd event_notifier: remove event_notifier_test event_notifier: add event_notifier_set apic: Defer interrupt updates to VCPU thread apic: Reevaluate pending interrupts on LVT_LINT0 changes apic: Resolve potential endless loop around apic_update_irq kvm: expose tsc deadline timer feature to guest kvm_pv_eoi: add flag support kvm: Don't abort on kvm_irqchip_add_msi_route()
2012-07-18Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori7-42/+99
* qmp/queue/qmp: qapi: Convert getfd and closefd qapi: input_type_enum(): fix error message qmp: dump-guest-memory: improve schema doc
2012-07-18Merge remote-tracking branch 'kraxel/bios.2' into stagingAnthony Liguori6-0/+38
* kraxel/bios.2: Add vgabios build rules to roms/Makefile
2012-07-18Merge remote-tracking branch 'kraxel/usb.57' into stagingAnthony Liguori8-34/+909
* kraxel/usb.57: ehci: improve expire time calculation ehci: implement Interrupt Threshold Control support ehci: raise irq in the frame timer uhci: initialize expire_time when loading v1 vmstate usb: add usb attached scsi emulation scsi: add free_request callback
2012-07-17build: fix build breakage due to bad mergeAnthony Liguori1-7/+4
34bb443ee74df3780d86044dbf6492eb798c5807 broke the build but in a subtle way. The patch on the ML was actually based on the 1.1.1 stable branch (accidentally). When I merged it from the ML, the fuzzing got resolved in a such a way that the newly introduced Makefile dependency on GENERATED_HEADERS got lost (that was not in 1.1.1). The dist bits also got duplicated (but this is just cosmetic). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17build: add make dist target (v2)Anthony Liguori2-15/+39
Let's stop screwing up releases by having a script do the work that Anthony's fat fingers can't seem to get right. Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17qemu-options.hx: Fix set_password and expire_password descriptionMichal Novotny1-2/+15
The description for set_password and expire_password commands is incomplete. This patch fixes the man page that is being generated to match the real behaviour of these functions. Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17qemu-options.hx: Improve -nodefaults descriptionMichal Novotny1-1/+4
This patch improves the description of -nodefaults QEMU command line option by adding more information what is being disabled using this command. Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17qemu-options.hx: Improve -{read|write}config options descriptionMichal Novotny1-2/+6
This is the patch to improve description for -{read|write}config functions. Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17constify value pointer for qdev_prop_set_stringChristian Borntraeger2-2/+2
qdev_prop_set_string uses object_property_set_str, which takes a const char * for the value. Lets propagate the constness into qdev_prop_set_string. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17doc: Fix indefinite article an -> a before nouns that begin with 'h'Stefan Weil2-2/+2
Although the rule also allows 'an' for historical reasons, 'a' is more common because 'h' is pronounced. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17fdc-test: Clean up a bitKevin Wolf1-16/+20
Readability of the test code has suffered as the test case evolved. This should improve it a bit again. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17fdc-test: introduce test_relative_seekPavel Hrdina1-5/+41
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17fdc: fix relative seekPavel Hrdina1-4/+6
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17qemu-iotests: Valgrind supportKevin Wolf2-0/+21
check -valgrind wraps all qemu-io calls with valgrind. This makes it a bit easier to debug problems that occur somewhere deep in a test case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-17coroutine-ucontext: Help valgrind understand coroutinesKevin Wolf2-0/+48
valgrind tends to get confused and report false positives when you switch stacks and don't tell it about it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-17qemu-io: Fix memory leaksKevin Wolf1-0/+4
Almost all callers of create_iovec() forgot to destroy the qiov when the request has completed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-17hw/block-common: Factor out fall back to legacy -drive cyls=...Markus Armbruster6-85/+62
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17blockdev: Don't limit DriveInfo serial to 20 charactersMarkus Armbruster4-10/+6
All current users (IDE, SCSI and virtio-blk) happen to share this 20 characters limit. Still, it should be left to device models. They already enforce their limits. They have to, as the DriveInfo limit only affects legacy -drive serial=..., not the qdev properties. usb-storage, which doesn't limit serial number length, also uses DriveInfo for -usbdevice. But that doesn't provide access to DriveInfo serial. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17hw/block-common: Factor out fall back to legacy -drive serial=...Markus Armbruster7-33/+34
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17hw/block-common: Move BlockConf & friends from block.hMarkus Armbruster7-48/+48
This stuff doesn't belong to block layer, and was put there only because a better home didn't exist then. Now it does. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17Relax IDE CHS limits from 16383,16,63 to 65535,16,255Markus Armbruster1-4/+4
New limits straight from ATA4 6.2 Register delivered data transfer command sector addressing. I figure the old sector limit 63 was blindly copied from the BIOS int 13 limit. Doesn't apply to the hardware. No idea where the old cylinder limit comes from. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17blockdev: Drop redundant CHS validation for if=ideMarkus Armbruster1-3/+3
Leave it to ide_init_drive(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17hd-geometry: Compute BIOS CHS translation in one placeMarkus Armbruster5-16/+18
Currently, it is split between hd_geometry_guess() and pc_cmos_init_late(). Confusing. info qtree shows the result of the former. Also confusing. Fold the part done in pc_cmos_init_late() into hd_geometry_guess(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17qtest: Test we don't put hard disk info into CMOS for a CD-ROMMarkus Armbruster1-0/+22
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17ide pc: Put hard disk info into CMOS only for hard disksMarkus Armbruster1-1/+1
In particular, don't set disk type and geometry when a CD-ROM on bus ide.0 has media during CMOS initialization. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17block: Geometry and translation hints are now useless, purge themMarkus Armbruster9-77/+12
There are two producers of these hints: drive_init() on behalf of -drive, and hd_geometry_guess(). The only consumer of the hint is hd_geometry_guess(). The callers of hd_geometry_guess() call it only when drive_init() didn't set the hints. Therefore, drive_init()'s hints are never used. Thus, hd_geometry_guess() only ever sees hints it produced itself in a prior call. Only the first call computes something, subsequent calls just repeat the first call's results. However, hd_geometry_guess() is never called more than once: the device models don't, and the block device is destroyed on unplug. Thus, dropping the repeat feature doesn't break anything now. If a block device wasn't destroyed on unplug and could be reused with a new device, then repeating old results would be wrong. Thus, dropping the repeat feature prevents future breakage. This renders the hints unused. Purge them from the block layer. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17qtest: Cover qdev property for BIOS CHS translationMarkus Armbruster1-6/+7
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17ide: qdev property for BIOS CHS translationMarkus Armbruster2-5/+6
This isn't quite orthodox. CHS translation is firmware configuration, communicated via the RTC's CMOS RAM, not a property of the disk. But it's best to treat it just like geometry anyway. Maintain backward compatibility exactly like for geometry: fall back to DriveInfo's translation, set with -drive trans=... Bonus: info qtree now shows the translation. Except when it shows "auto": that's resolved by pc_cmos_init_late(). To be addressed shortly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17qdev: New property type chs-translationMarkus Armbruster2-0/+18
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>