diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-10-09 15:09:05 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-10-09 15:09:05 +0100 |
commit | fcb2cd928f5519b8241e22411a696be1a7272b1c (patch) | |
tree | 394f049d19f8abb12c1b11f4dcc03b9036da604d /include | |
parent | b6011bd8a57c1eda81a857d21adeb9b66e58b1b0 (diff) | |
parent | 5008e5b7b817b5ea2b788203122cd50e7c16e599 (diff) | |
download | qemu-fcb2cd928f5519b8241e22411a696be1a7272b1c.tar.gz qemu-fcb2cd928f5519b8241e22411a696be1a7272b1c.tar.bz2 qemu-fcb2cd928f5519b8241e22411a696be1a7272b1c.zip |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Four changes here. Polling for reconnection of character devices,
the QOMification of accelerators, a fix for -kernel support on x86, and one
for a recently-introduced virtio-scsi optimization.
# gpg: Signature made Thu 09 Oct 2014 14:36:50 BST using RSA key ID 4E6B09D7
# gpg: Good signature from "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: aka "Paolo Bonzini <bonzini@gnu.org>"
* remotes/bonzini/tags/for-upstream: (28 commits)
qemu-char: Fix reconnect socket error reporting
qemu-sockets: Add error to non-blocking connect handler
qemu-error: Add error_vreport()
virtio-scsi: fix use-after-free of VirtIOSCSIReq
linuxboot: compute initrd loading address
kvm: Make KVMState be the TYPE_KVM_ACCEL instance struct
accel: Create accel object when initializing machine
accel: Pass MachineState object to accel init functions
accel: Rename 'init' method to 'init_machine'
accel: Move accel init/allowed code to separate function
accel: Remove tcg_available() function
accel: Move qtest accel registration to qtest.c
accel: Move Xen registration code to xen-common.c
accel: Move KVM accel registration to kvm-all.c
accel: Report unknown accelerator as "not found" instead of "does not exist"
accel: Make AccelClass.available() optional
accel: Use QOM classes for accel types
accel: Move accel name lookup to separate function
accel: Simplify configure_accelerator() using AccelType *acc variable
accel: Create AccelType typedef
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/boards.h | 4 | ||||
-rw-r--r-- | include/hw/xen/xen.h | 1 | ||||
-rw-r--r-- | include/qemu/error-report.h | 1 | ||||
-rw-r--r-- | include/qemu/sockets.h | 2 | ||||
-rw-r--r-- | include/qemu/typedefs.h | 1 | ||||
-rw-r--r-- | include/sysemu/accel.h | 62 | ||||
-rw-r--r-- | include/sysemu/arch_init.h | 1 | ||||
-rw-r--r-- | include/sysemu/kvm.h | 2 | ||||
-rw-r--r-- | include/sysemu/qtest.h | 1 |
9 files changed, 67 insertions, 8 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index 663f16acdd..e07c03f846 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -5,12 +5,11 @@ #include "qemu/typedefs.h" #include "sysemu/blockdev.h" +#include "sysemu/accel.h" #include "hw/qdev.h" #include "qom/object.h" -typedef struct MachineState MachineState; - typedef void QEMUMachineInitFunc(MachineState *ms); typedef void QEMUMachineResetFunc(void); @@ -135,6 +134,7 @@ struct MachineState { char *kernel_cmdline; char *initrd_filename; const char *cpu_model; + AccelState *accelerator; }; #endif diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h index f71f2d8963..b0ed04caa9 100644 --- a/include/hw/xen/xen.h +++ b/include/hw/xen/xen.h @@ -36,7 +36,6 @@ void xen_cmos_set_s3_resume(void *opaque, int irq, int level); qemu_irq *xen_interrupt_controller_init(void); -int xen_init(MachineClass *mc); void xenstore_store_pv_console_info(int i, struct CharDriverState *chr); #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 000eae3957..7ab235590e 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -38,6 +38,7 @@ void error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_set_progname(const char *argv0); +void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); const char *error_get_progname(void); extern bool enable_timestamp_msg; diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index fdbb196787..f47dae614a 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -47,7 +47,7 @@ int recv_all(int fd, void *buf, int len1, bool single_read); /* callback function for nonblocking connect * valid fd on success, negative error code on failure */ -typedef void NonBlockingConnectHandler(int fd, void *opaque); +typedef void NonBlockingConnectHandler(int fd, Error *errp, void *opaque); InetSocketAddress *inet_parse(const char *str, Error **errp); int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 5f20b0e263..04df51b6fc 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -32,6 +32,7 @@ typedef struct MemoryMappingList MemoryMappingList; typedef struct QEMUMachine QEMUMachine; typedef struct MachineClass MachineClass; +typedef struct MachineState MachineState; typedef struct NICInfo NICInfo; typedef struct HCIInfo HCIInfo; typedef struct AudioState AudioState; diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h new file mode 100644 index 0000000000..997720f36c --- /dev/null +++ b/include/sysemu/accel.h @@ -0,0 +1,62 @@ +/* QEMU accelerator interfaces + * + * Copyright (c) 2014 Red Hat Inc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef HW_ACCEL_H +#define HW_ACCEL_H + +#include "qemu/typedefs.h" +#include "qom/object.h" + +typedef struct AccelState { + /*< private >*/ + Object parent_obj; +} AccelState; + +typedef struct AccelClass { + /*< private >*/ + ObjectClass parent_class; + /*< public >*/ + + const char *opt_name; + const char *name; + int (*available)(void); + int (*init_machine)(MachineState *ms); + bool *allowed; +} AccelClass; + +#define TYPE_ACCEL "accel" + +#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL +#define ACCEL_CLASS_NAME(a) (a ACCEL_CLASS_SUFFIX) + +#define ACCEL_CLASS(klass) \ + OBJECT_CLASS_CHECK(AccelClass, (klass), TYPE_ACCEL) +#define ACCEL(obj) \ + OBJECT_CHECK(AccelState, (obj), TYPE_ACCEL) +#define ACCEL_GET_CLASS(obj) \ + OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) + +extern int tcg_tb_size; + +int configure_accelerator(MachineState *ms); + +#endif diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 769ec069b7..54b36c16c4 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -33,7 +33,6 @@ void do_smbios_option(QemuOpts *opts); void ram_mig_init(void); void cpudef_init(void); void audio_init(void); -int tcg_available(void); int kvm_available(void); int xen_available(void); diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 77ee240875..b0cd657f77 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -163,8 +163,6 @@ extern KVMState *kvm_state; /* external API */ -int kvm_init(MachineClass *mc); - int kvm_has_sync_mmu(void); int kvm_has_vcpu_events(void); int kvm_has_robust_singlestep(void); diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index 95c9ade778..05473b75a5 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -26,7 +26,6 @@ static inline bool qtest_enabled(void) bool qtest_driver(void); -int qtest_init_accel(MachineClass *mc); void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp); static inline int qtest_available(void) |