- Nov 23, 2015
-
-
Pavel Fedin authored
Currently hostmem backend fails if CONFIG_NUMA is enabled in QEMU (the default) but NUMA is not supported by the kernel. This makes it impossible to use ivshmem in such configurations. This patch fixes the problem by ignoring ENOSYS error if policy is set to MPOL_DEFAULT. This way the code behaves in the same way as if CONFIG_NUMA was not defined. qemu will still fail if the user specifies some other policy, so that the user knows it. Signed-off-by:
Pavel Fedin <p.fedin@samsung.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Oct 19, 2015
-
-
Paolo Bonzini authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 14, 2015
-
-
Paolo Bonzini authored
Having creation as a member of the CharDriver struct removes the need to export functions for qemu-char.c's usage. After the conversion, chardev backends implemented outside qemu-char.c will not need a stub creation function anymore. Ultimately all drivers will be converted. For now, support the case where cd->create == NULL. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Sep 16, 2015
-
-
Markus Armbruster authored
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Same Coccinelle semantic patch as in commit b45c03f5. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1442231643-23630-1-git-send-email-armbru@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Sep 11, 2015
-
-
Samuel Thibault authored
cur and buf are pointers, so the difference is a ptrdiff_t Signed-off-by:
Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Daniel P. Berrangé authored
The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Jul 22, 2015
-
-
Eduardo Habkost authored
This fixes the following crash, introduced by commit 49d2e648: $ gdb --args qemu-system-x86_64 -machine pc,mem-merge=off -object memory-backend-ram,id=ram-node0,size=1024 [...] Program received signal SIGABRT, Aborted. (gdb) bt #0 0x00007ffff253b8c7 in raise () at /lib64/libc.so.6 #1 0x00007ffff253d52a in abort () at /lib64/libc.so.6 #2 0x00007ffff253446d in __assert_fail_base () at /lib64/libc.so.6 #3 0x00007ffff2534522 in () at /lib64/libc.so.6 #4 0x00005555558bb80a in qemu_opt_get_bool_helper (opts=0x55555621b650, name=name@entry=0x5555558ec922 "mem-merge", defval=defval@entry=true, del=del@entry=false) at qemu/util/qemu-option.c:388 #5 0x00005555558bbb5a in qemu_opt_get_bool (opts=<optimized out>, name=name@entry=0x5555558ec922 "mem-merge", defval=defval@entry=true) at qemu/util/qemu-option.c:398 #6 0x0000555555720a24 in host_memory_backend_init (obj=0x5555562ac970) at qemu/backends/hostmem.c:226 Instead of using qemu_opt_get_bool(), that didn't work with qemu_machine_opts for a long time, we can use the corresponding MachineState fields. Reviewed-by:
Marcel Apfelbaum <marcel@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Jun 22, 2015
-
-
Markus Armbruster authored
In particular, don't include it into headers. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Markus Armbruster authored
These macros expand into error class enumeration constant, comma, string. Unclean. Has been that way since commit 13f59ae8. The error class is always ERROR_CLASS_GENERIC_ERROR since the previous commit. Clean up as follows: * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and delete it from the QERR_ macro. No change after preprocessing. * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into error_setg(...). Again, no change after preprocessing. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Markus Armbruster authored
Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used in new code. Hiding them in QERR_ macros makes new uses hard to spot. Fortunately, there's just one such macro left. Eliminate it with this coccinelle semantic patch: @@ expression EP, E; @@ -error_set(EP, QERR_DEVICE_NOT_FOUND, E) +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E) Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Jun 19, 2015
-
-
Daniel P. Berrangé authored
Now that properties can be explicitly registered as an enum type, there is no need to pass the string table to the object_get_enum() function. The object property registration already has a pointer to the string table. In changing this method signature, the hostmem backend object has to be converted to use the new enum property registration code, which simplifies it somewhat. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Daniel P. Berrangé authored
The 'policy' property was being registered with a typename of 'str', but it is in fact an enum of the 'HostMemPolicy' type. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
- May 31, 2015
-
-
Stefan Berger authored
Following the recent upgrade to version 1.3, extend the TPM TIS interface with capabilities introduced for support of a TPM 2. TPM TIS for TPM 2 introduced the following extensions beyond the TPM TIS 1.3 (used for TPM 1.2): - A new 32bit interface Id register was introduced. - New flags for the status (STS) register were defined. - New flags for the capability flags were defined. Support the above if a TPM TIS 1.3 for TPM 2 is used with a TPM 2 on the backend side. Support the old TPM TIS 1.3 configuration if a TPM 1.2 is being used. A subsequent patch will then determine which TPM version is being used in the backend. Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- May 08, 2015
-
-
Thomas Huth authored
The functions tpm_backend_thread_tpm_reset() and iothread_find() are completely unused, let's remove them. Signed-off-by:
Thomas Huth <huth@tuxfamily.org> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Apr 30, 2015
-
-
Jan Kiszka authored
The subtle difference between "property not found" and "property not set" is already confusing enough. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by:
Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Apr 01, 2015
-
-
Lin Ma authored
showing a memory device whose memdev is removed leads an assert: (qemu) object_add memory-backend-ram,id=ram0,size=128M (qemu) device_add pc-dimm,id=d0,memdev=ram0 (qemu) object_del ram0 (qemu) info memory-devices ** ERROR:qom/object.c:1274:object_get_canonical_path_component:\ assertion failed: (obj->parent != NULL) Aborted The patch prevents removing an in-use mem backend and error out. Signed-off-by:
Lin Ma <lma@suse.com> Message-Id: <1427704589-7688-3-git-send-email-lma@suse.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 19, 2015
-
-
Stefan Weil authored
Sparse report: backends/tpm.c:39:5: warning: returning void-valued expression Signed-off-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Dec 10, 2014
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Sep 18, 2014
-
-
Eduardo Habkost authored
This reverts commit 5e490b6a. Cc: qemu-stable@nongnu.org Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Sep 16, 2014
-
-
Peter Maydell authored
Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-6-git-send-email-peter.maydell@linaro.org
-
- Sep 09, 2014
-
-
Hu Tao authored
When using monitor command object_add to add a memory backend whose size is way too big to allocate memory for it, qemu just exits. In the case we'd better give an error message and keep guest running. The problem can be reproduced as follows: 1. run qemu 2. (monitor)object_add memory-backend-ram,size=100000G,id=ram0 Reviewed-by:
Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Hu Tao authored
Add parameter errp to memory_region_init_ram and update all call sites to pass in &error_abort. Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Reviewed-by:
Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 20, 2014
-
-
Michael S. Tsirkin authored
When memory is allocated on a wrong node, MPOL_MF_STRICT doesn't move it - it just fails the allocation. A simple way to reproduce the failure is with mlock=on realtime feature. The code comment actually says: "ensure policy won't be ignored" so setting MPOL_MF_MOVE seems like a better way to do this. Cc: qemu-stable@nongnu.org Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Aug 18, 2014
-
-
Paolo Bonzini authored
The function is empty after the previous patch, so remove it. Reviewed-by:
Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 06, 2014
-
-
Paolo Bonzini authored
From: Paolo Bonzini <pbonzini@redhat.com> chr-testdev enables a virtio serial channel to be used for guest initiated qemu exits. hw/misc/debugexit already enables guest initiated qemu exits, but only for PC targets. chr-testdev supports any virtio-capable target. kvm-unit-tests/arm is already making use of this backend. Currently there is a single command implemented, "q". It takes a (prefix) argument for the exit code, thus an exit is implemented by writing, e.g. "1q", to the virtio-serial port. It can be used as: $QEMU ... \ -device virtio-serial-device \ -device virtserialport,chardev=ctd -chardev testdev,id=ctd or, use: $QEMU ... \ -device virtio-serial-device \ -device virtconsole,chardev=ctd -chardev testdev,id=ctd to bind it to virtio-serial port0. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 24, 2014
-
-
Eduardo Habkost authored
g_free() is NULL-safe. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Jun 23, 2014
-
-
Paolo Bonzini authored
The next patch will modify this function to initialize state that is common to all backends. Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Jun 19, 2014
-
-
Hu Tao authored
Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> [Raise errors on setting properties if !CONFIG_NUMA. Add BUILD_BUG_ON checks. - Paolo] Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Paolo Bonzini authored
A new "share" property can be used with the "memory-file" backend to map memory with MAP_SHARED instead of MAP_PRIVATE. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Paolo Bonzini authored
And allow preallocation of file-based memory even without -mem-prealloc. Some care is necessary because -mem-prealloc does not allow disabling preallocation for hostmem-file. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> MST: comment tweak
-
Hu Tao authored
This allows the superclass to set various policies on the memory region that the subclass creates. Drops hostmem-ram's complete method accordingly. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hu Tao authored
..to keep names consistant. Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jun 18, 2014
-
-
Igor Mammedov authored
Provides framework for splitting host RAM allocation/ policies into a separate backend that could be used by devices. Initially only legacy RAM backend is provided, which uses memory_region_init_ram() allocator and compatible with every CLI option that affects memory_region_init_ram(). Signed-off-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- May 08, 2014
-
-
Michael Tokarev authored
Current Makefile system allows using foo.o-cflags variables to store object-specific CFLAGS. Convert some usages of old syntax (using QEMU_CFLAGS += construct) to the new syntax. Do not touch multifile modules for now, as build system isn't ready for this. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 05, 2014
-
-
Markus Armbruster authored
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see commit 84d18f06). I guess the error_is_set(errp) in the ObjectProperty set() methods are merely fragile right now, because I can't find a call chain that passes a null errp argument. Make the code more robust and more obviously correct: receive the error in a local variable, then propagate it through the parameter. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
- Mar 24, 2014
-
-
Richard W.M. Jones authored
backends/baum.c: In function ‘chr_baum_init’: backends/baum.c:569:64: error: missing binary operator before token "(" #if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0) ^ backends/baum.c:598:64: error: missing binary operator before token "(" #if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0) Signed-off-by:
Richard W.M. Jones <rjones@redhat.com> Message-id: 1395437377-5779-1-git-send-email-rjones@redhat.com Reviewed-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-