nbd: switch to asynchronous operation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd: split requests
qemu-nbd has a limit of slightly less than 1M per request. Workaround this in the nbd block driver.
sheepdog: move coroutine send/recv function to generic code
Outside coroutines, avoid busy waiting on EAGAIN by temporarilymaking the socket blocking.
The API of qemu_recvv/qemu_sendv is slightly different fromdo_readv/do_writev because they do not handle coroutines. It...
add qemu_send_full and qemu_recv_full
sd: Remember to reset .expecting_acmd on reset.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c: Clear status bits when read via response r6
Response format r6 includes a subset of the status bits;clear the clear-on-read bits which are read by an r6 response.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c: Correct handling of APP_CMD status bit
Fix some bugs in our implementation of the APP_CMD status bit: * the response to an ACMD should have APP_CMD set, not cleared * if an illegal ACMD is sent then the next command should be handled as a normal command...
hw/sd.c: Correct handling of type B SD status bits
Correct how we handle the type B ("cleared on valid command")status bits. In particular, the CURRENT_STATE bits in a responseshould be the state of the card when it received that command,not the state when it received the preceding command. (This is...
hw/sd.c: Set ILLEGAL_COMMAND for ACMDs in invalid state
App commands in an invalid state should set ILLEGAL_COMMAND, notmerely return a zero response.
hw/sd.c: Handle CRC and locked-card errors in normal code path
Handle returning CRC and locked-card errors in the same code pathwe use for other responses. This makes no difference in behaviourbut means that these error responses will be printed by the debug...
hw/sd.c: Handle illegal commands in sd_do_command
Add an extra sd_illegal value to the sd_rsp_type_t enum so thatsd_app_command() and sd_normal_command() can tell sd_do_command()that the command was illegal. This is needed so we can do thingslike reset certain status bits only on receipt of a valid command....
hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything else
Fix a typo that meant that ADDRESS_ERRORs setting or clearing writeprotection would clear every other bit in the status register.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/sd.c: On CRC error, set CRC error status bit rather than clearing it
If we fail to validate the CRC for an SD command we should be settingCOM_CRC_ERROR, not clearing it. (This bug actually has no effect currentlybecause sd_req_crc_validate() always returns success.)...
hw/sd.c: Add comment regarding CARD_STATUS_* defines
Add a clarifying comment about what the CARD_STATUS_[ABC]macros are defining.
hw/sd.c: Fix the set of commands which are failed when card is locked
Fix bugs in the code determining whether to accept a command when theSD card is locked. Most notably, we had the condition completelyreversed, so we would accept all the commands we should refuse and...
isa: always use provided ISA bus in isa_bus_irqs()
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: remove unused parameter isa_pic
g_thread_init users: don't call it if glib >= 2.31
since commit f9b29ca03 included in release 2.31 (docs below say 2.32 butthat is not correct) and onwards g_thread_init is deprecated and callingit is not required:
http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init...
hw/sysbus.c: Remove unnecessary conditionals
Now that all sysbus MMIO regions are MemoryRegions, mmio[n].memoryis never NULL, and we can remove some unnecessary conditionals.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: store guest timestamp in dump file instead of time since guest startup
Stored dates are no more 1970-01-01 (+ run time), but have a real meaning.If someone wants to have comparable timestamps accross boots, it ispossible to start qemu with -rtc to give the startup date....
isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions
NULL is a valid bus/device, so there is no change in behaviour.
isa: move ISABus structure definition to header file
i8259: give ISA device to isa_register_ioport()
pc: give ISA bus to ISA methods
alpha: give ISA bus to ISA methods
sun4u: give ISA bus to ISA methods
fulong2e: give ISA bus to ISA methods
malta: give ISA bus to ISA methods
isa: always use provided ISA bus when creating an isa device
net: truncate output file when using dump backend
This prevents data of a previous run to be seen in the new dump file.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
i440fx: remove piix3 field
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: fix hotplug when no -device is specified
The peripheral[-anon] containers are initialized lazily but since they sit onsysbus, they can not be created after realize. This was causing an abort() tooccur during hotplug if no -device option was used....
sh_pci: remove sysbus_init_mmio_cb2 usage
The isa region is not exposed as a sysbus region because the iobrregister contains its address and use it to remap dynamicallythe region. (Peter Maydell's idea)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
ppce500_pci: remove sysbus_init_mmio_cb2 usage
Expose only one container MemoryRegion to sysbus.(Peter Maydell's idea)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Benoît Canet <benoit.canet@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sysbus: remove sysbus_init_mmio_cb2
This function is not longer in use so remove it.
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE
This will be used when reject invalid values for integer fields thatare less than 64-bits wide.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: introduce get/set methods for Property
This patch adds a visitor interface to Property. This way, QOM will beable to expose Properties that access a fixed field in a struct withoutexposing also the everything-is-a-string "feature" of qdev properties....
qom: distinguish "legacy" property type name from QOM type name
qom: register qdev properties also as non-legacy properties
Push legacy properties into a "legacy-..." namespace, and make themavailable with correct types too.
For now, all properties come in both variants. This need not be thecase for string properties. We will revisit this after -device is...
vl.c: Move option generation logic into a wrapper file
In vl.c and qemu-options.h we define macros and include qemu-options.defin order to generate different content. Move the bulk of the def'ing andundef'ing into a wrapper, this will make it cleaner when we add another...
vl.c: In qemu -h output, only print options for the arch we are running as
Only print options in the help output that are accepted by our arch.This is less confusing for users and also for other programs thatconsume the help output.
The options affected are:...
Documentation: Move balloon option out of i386 only section
The balloon option is not i386 only, so move it into the standardoptions section.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: protect against NULL QObject in qmp_input_get_object
A NULL qobj can occur when a parameter is fetched via qdict_get, butthe parameter is not in the command. By returning NULL, the caller canchoose whether to raise a missing parameter error, an invalid parameter...
qom: fix swapped parameters
Reviewed-by: Anthony Liguori <anthony@codemonkey.ws>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: push permission checks up into qdev_property_add_legacy
qdev_property_get and qdev_property_set can generate permissiondenied errors themselves. Do not duplicate this functionality inqdev_get/set_legacy_property, and clean up excessive indentation....
qom: interpret the return value when setting legacy properties
Merge remote-tracking branch 'qemu-kvm/memory/exec-obsolete' into staging
Merge remote-tracking branch 'qemu-kvm/memory/xen' into staging
memory: move obsolete exec.c functions to a private header
This will help avoid accidental usage.
Signed-off-by: Avi Kivity <avi@redhat.com>
etraxfs_eth: drop bogus cpu_unregister_io_memory()
Leftover call to cpu_unregister_io_memory() can segfault on cleanup. Remove.
xen: convert to memory API
Undo the private implementation of qemu_ram_alloc(); use the global one(which calls right back into xen_ram_alloc()).
memory, xen: pass MemoryRegion to xen_ram_alloc()
Currently xen_ram_alloc() relies on ram_addr, which is going away.Give it something else to use as a cookie.
Merge remote-tracking branch 'qemu-kvm/memory/mutators' into staging
Conflicts: memory.h
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
pc: fix event_idx compatibility for virtio devices
event_idx was introduced in 0.15 and must be disabled for all virtio-pci devices(including virtio-balloon-pci).
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
configure: Fix compiler warning in config.log (value was never used)
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
configure: Fix compiler warnings in config.log (statement without effect)
configure: Improve Xen autodetection for hosts without Xen
With this patch, it only takes one test (instead of four)to detect that there is no Xen support at all.
For most build hosts, this will reduce the time configure needs.It will also reduce noisy output in config.log....
configure: Fix compiler warnings in config.log (always return a value from main)
Fix several "warning: control reaches end of non-void function".
configure: Fix compiler warnings in config.log (old-style function definition)
warning: function declaration isn’t a prototypeIn function ‘foo’:warning: old-style function definition
The function name was changed, too, to avoid an additional warning....
configure: Fix compiler warning in config.log (integer from pointer)
warning: return makes integer from pointer without a cast
v2: Removed type cast.
configure: Fix compiler warnings in config.log (null arguments)
warning: null argument where non-null required (argument 1)warning: null argument where non-null required (argument 3)
configure: Fix compiler warning in config.log (unused variable)
warning: unused variable ‘iov’
configure: Fix compiler warning in config.log (macro redefined)
warning: "_GNU_SOURCE" redefined
The macro is already defined on the command line.
configure: Fix compiler warnings in config.log (uninitialized variable)
warning: ‘fd’ is used uninitialized in this functionwarning: ‘id’ is used uninitialized in this function
configure: Fix compiler warning in config.log (undefined NULL)
Avoid the warning when probing for xfs.
Also create piix3 property when Xen is enabled
This recently added line in hw/pc_piix.c is causing a SEGV on a Xensetup because the piix3 property is never created:
qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), "rtc", (DeviceState *)rtc_state, NULL);...
slirp: Fix typo in net_slirp_hostfwd_remove
Report an error when err is nonzero, not when it is zero.
Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
pc: add pc-0.15
kvm: Print something before calling abort() if KVM_RUN fails
It's a little unfriendly to call abort() without printing any sort oferror message. So turn the DPRINTK into an fprintf(stderr, ...).
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>...
stellaris: Calculate system clock period on reset
Calculate the system clock period on reset; otherwise it remainsset to the default value of zero and attempting to use it provokesa hang. This is one of the issues noted in LP:696094.
Makefile.target: Remove unnecessary dependency rules
Remove some dependency rules which aren't necessary (the automaticallygenerated .d files cover all these). These were leftovers from dyngendays, when the object files also had a dependency on some generated...
ide: drop argument to dma_buf_commit
The argument is unused and even wrong when the function is calledby ide_handle_rw_error. Drop it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
network scripts: don't block SIGCHLD before forking
This patch fixes a bug where child processes of launch_script() canmisbehave due to SIGCHLD being blocked. In the case of `sudo`, thiscauses a permanent hang.
Previously a SIGCHLD handler was added to reap fork_exec()'d zombie...
phys_page_find_alloc: Use correct initial region_offset.
This fixes a common bug with initial region_offset value.Usually, the pages are re-assigned afterwards, so the bughas a very small effect on regular QEMU use flows.
Signed-off-by: Alex Rozenman <Alex_Rozenman@mentor.com>...
vl.c: Print the actual program name in help output
In help() we do what boils down to:
printf("%s", "qemu");
This seems to be an artifact of be995c27640a82c7056b6f53d02ec823570114e5("removed unused code"), which removed some ifdef'ery that used to print...
exec.c: Fix subpage memory access to RAM MemoryRegion
Commit 95c318f5e1f88d7e5bcc6deac17330fd4806a2d3 (Fix segfault in mmiosubpage handling code.) prevented a segfault by making all subpageregistrations over an existing memory page perform an unassigned access....
usb: fix usb_qdev_init() error handling again
Commit f462141f18ffdd75847f6459ef83d90b831d12c0 introduced clean up codewhen usb_qdev_init() fails. Unfortunately it calls .handle_destroy()when .init() was never invoked or failed. This can lead to crashes when...
HACKING: clarify allocation/free recommendations
Clarify the allocation/free recommendations; this is mostlyjust tidying up following the global-search-and-replace donewith the conversion to the GLib g_malloc and friends.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
error: Add an accessor for progname
We'd like to get the progname for help output, so add an accessor.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Reviewed-by: Andreas F=E4rber <afaerber@suse.de>...
fix win32 build
On Windows, cpus.c needs access to the hThread. Add a Windows-specificfunction to grab it. This requires changing the CPU threads tojoinable. There is no substantial change because the threads runin an infinite loop.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
rtc: make piix3 set the rtc as a child (v2)
rtc: add a dynamic property for retrieving the date
This really shows the power of dynamic object properties compared to qdevstatic properties.
This property represents a complex structure who's format is preserved over thewire. This is enabled by visitors....
qom: optimize qdev_get_canonical_path using a parent link
The full tree search was a bit unreasonable.
qom: add vga node to the pc composition tree
qom: add string property type
qdev: add a qdev_get_type() function and expose as a 'type' property
qdev: provide a path resolution (v2)
There are two types of supported paths--absolute paths and partial paths.
Absolute paths are derived from the root device and can follow child<> orlink<> properties. Since they can follow link<> properties, they can be...
qom: add child properties (composition) (v3)
Child properties express a relationship of composition.
qom: add link properties (v2)
Links represent an ephemeral relationship between devices. They are meant toreplace the qdev concept of busses by allowing more informal relationshipsbetween devices.
Links are fairly limited in their usefulness without implementing QOM-style...
qapi: allow a 'gen' key to suppress code generation
qmp: add qom-list command
This can be used to list properties in the device model.
qom: qom_{get, set} monitor commands (v2)
This allows clients to read and write device model properties through QMP. QAPIdoesn't support Visitor types yet and these commands are special in that theydon't work with fixed types.
I've added a documentation stub to qapi-schema.json so we can keep consistency...
qdev: add explicitly named devices to the root complex
We first add a 'peripheral' container to the root device that we add usercreated devices to. This provides all user created devices with a unique andisolated namespace.
dev: add an anonymous peripheral container
qom: add new dynamic property infrastructure based on Visitors (v2)
qdev properties are settable only during construction and static to classes.This isn't flexible enough for QOM.
This patch introduces a property interface for qdev that provides dynamic...
qom: register legacy properties as new style properties (v2)
Expose all legacy properties through the new QOM property mechanism. The qdevproperty types are exposed through the 'legacy<>' namespace. They are alwaysvisited as strings since they do their own string parsing....
qom: introduce root device
This is based on Jan's suggestion for how to do unique naming. The root deviceis the root of composition. All devices are reachable via child<> links fromthis device.
qdev: provide an interface to return canonical path from root (v2)
The canonical path is the path in the composition tree from the root to thedevice. This is effectively the name of the device.
This is an incredibly unefficient implementation that will be optimized in...