From 6e502164618ea23f6351b5055296180c8672cad9 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Tue, 29 Dec 2015 12:39:44 +0300 Subject: unicore32: convert get_sp_from_cpustate from macro to inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All other architectures define get_sp_from_cpustate as an inline function, only unicore32 uses a #define. With this, some usages are impossible, for example, enabling sigaltstack in linux-user/syscall.c results in linux-user/syscall.c: In function ‘do_syscall’: linux-user/syscall.c:8299:39: error: dereferencing ‘void *’ pointer [-Werror] get_sp_from_cpustate(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env)); ^ linux-user/syscall.c:8299:39: error: request for member ‘regs’ in something not a structure or union Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- linux-user/unicore32/target_signal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/unicore32/target_signal.h b/linux-user/unicore32/target_signal.h index 8b255c4..7c44238 100644 --- a/linux-user/unicore32/target_signal.h +++ b/linux-user/unicore32/target_signal.h @@ -21,6 +21,10 @@ typedef struct target_sigaltstack { #define TARGET_SS_ONSTACK 1 #define TARGET_SS_DISABLE 2 -#define get_sp_from_cpustate(cpustate) (cpustate->regs[29]) +static inline abi_ulong get_sp_from_cpustate(CPUUniCore32State *state) +{ + return state->regs[29]; +} + #endif /* TARGET_SIGNAL_H */ -- cgit v1.1 From 477cea9e6db35152ace6ffa250080b0e01160b93 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Tue, 29 Dec 2015 12:45:25 +0300 Subject: linux-user: enable sigaltstack for all architectures There is no reason to limit sigaltstack syscall to just a few architectures and pretend it is not implemented for others. If some architecture is not ready for this, that architecture should be fixed instead. This fixes LP#1516408. Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- linux-user/syscall.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6c64ba6..3ceb3e2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8292,14 +8292,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; } case TARGET_NR_sigaltstack: -#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \ - defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA) || \ - defined(TARGET_M68K) || defined(TARGET_S390X) || defined(TARGET_OPENRISC) ret = do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env)); break; -#else - goto unimplemented; -#endif #ifdef CONFIG_SENDFILE case TARGET_NR_sendfile: -- cgit v1.1 From 34f22fc034470032a647262ee142867b3ebe5b2f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 4 Dec 2015 13:38:46 +0100 Subject: net: convert qemu_log to error_report, fix message Ensure that the error is printed with the proper timestamp. Signed-off-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- net/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dump.c b/net/dump.c index ce16a4b..1c05f78 100644 --- a/net/dump.c +++ b/net/dump.c @@ -84,7 +84,7 @@ static ssize_t dump_receive_iov(DumpState *s, const struct iovec *iov, int cnt) cnt = iov_copy(&dumpiov[1], cnt, iov, cnt, 0, caplen); if (writev(s->fd, dumpiov, cnt + 1) != sizeof(hdr) + caplen) { - qemu_log("-net dump write error - stop dump\n"); + error_report("network dump write error - stopping dump"); close(s->fd); s->fd = -1; } -- cgit v1.1 From 240125bc49d016da2f39637c205b04fc6ae6dcef Mon Sep 17 00:00:00 2001 From: Zhu Lingshan Date: Wed, 16 Dec 2015 12:40:40 +0800 Subject: iscsi: fix readcapacity error message fix:The error message for readcapacity 16 incorrectly mentioned a readcapacity 10 failure, fixed the error message. Signed-off-by: Zhu Lingshan Reviewed-by: John Snow Signed-off-by: Michael Tokarev --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index bd1f1bf..eb28ddc 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1270,7 +1270,7 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun, Error **errp) && retries-- > 0); if (task == NULL || task->status != SCSI_STATUS_GOOD) { - error_setg(errp, "iSCSI: failed to send readcapacity10 command."); + error_setg(errp, "iSCSI: failed to send readcapacity10/16 command"); } else if (!iscsilun->block_size || iscsilun->block_size % BDRV_SECTOR_SIZE) { error_setg(errp, "iSCSI: the target returned an invalid " -- cgit v1.1 From 82407515fe36c2d6cbd62f24c04f700f7dc25a69 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 17 Dec 2015 15:25:12 +0100 Subject: MAINTAINERS: Add the correct device_tree.h file device_tree.h is not in the main directory, but under include/sysemu/ nowadays. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 5a62ecd..de5439d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1036,7 +1036,8 @@ Device Tree M: Peter Crosthwaite M: Alexander Graf S: Maintained -F: device_tree.[ch] +F: device_tree.c +F: include/sysemu/device_tree.h Error reporting M: Markus Armbruster -- cgit v1.1 From b3afe33526eca082cd5b0cdb12aabf5315cdf68b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 21 Dec 2015 08:54:17 -0700 Subject: crypto: Fix typo in example The example code wouldn't even compile, since it did not use a consistent spelling for the Error ** parameter. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Signed-off-by: Michael Tokarev --- include/crypto/tlssession.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crypto/tlssession.h b/include/crypto/tlssession.h index b38fe69..d356a8d 100644 --- a/include/crypto/tlssession.h +++ b/include/crypto/tlssession.h @@ -56,7 +56,7 @@ * * static int mysock_run_tls(int sockfd, * QCryptoTLSCreds *creds, - * Error *erp) + * Error *errp) * { * QCryptoTLSSession *sess; * -- cgit v1.1 From 66c058cb69ab158e3fd61b0172e215e650f33213 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Tue, 29 Dec 2015 20:39:56 +0800 Subject: xen/Makefile.objs: simplify merge last two lines, keep alphabetic order. Signed-off-by: Cao jin Reviewed-by: Stefan Weil Reviewed-by: Stefano Stabellini Signed-off-by: Michael Tokarev --- hw/xen/Makefile.objs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs index a9ad7e7..d367094 100644 --- a/hw/xen/Makefile.objs +++ b/hw/xen/Makefile.objs @@ -2,5 +2,4 @@ common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o xen_pt_graphics.o +obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o -- cgit v1.1 From 713572a7b59acfcf8fe0f35c799f647792c8c8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 10 Dec 2015 01:47:46 +0100 Subject: configure: fix trace backend check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found thanks to shellcheck! Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 83b40fc..44ac9ab 100755 --- a/configure +++ b/configure @@ -4817,7 +4817,7 @@ echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" echo "vhost-scsi support $vhost_scsi" echo "Trace backends $trace_backends" -if test "$trace_backend" = "simple"; then +if have_backend "simple"; then echo "Trace output file $trace_file-" fi if test "$spice" = "yes"; then -- cgit v1.1 From f922254c87889f2bcdc289d4eea2dda569a03ece Mon Sep 17 00:00:00 2001 From: Cao jin Date: Fri, 18 Dec 2015 16:55:35 +0800 Subject: hw/misc/edu: Convert to realize() for educational PCI device Signed-off-by: Cao jin Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- hw/misc/edu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index fe50b42..43d5b18 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -327,7 +327,7 @@ static void *edu_fact_thread(void *opaque) return NULL; } -static int pci_edu_init(PCIDevice *pdev) +static void pci_edu_realize(PCIDevice *pdev, Error **errp) { EduState *edu = DO_UPCAST(EduState, pdev, pdev); uint8_t *pci_conf = pdev->config; @@ -344,8 +344,6 @@ static int pci_edu_init(PCIDevice *pdev) memory_region_init_io(&edu->mmio, OBJECT(edu), &edu_mmio_ops, edu, "edu-mmio", 1 << 20); pci_register_bar(pdev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &edu->mmio); - - return 0; } static void pci_edu_uninit(PCIDevice *pdev) @@ -385,7 +383,7 @@ static void edu_class_init(ObjectClass *class, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(class); - k->init = pci_edu_init; + k->realize = pci_edu_realize; k->exit = pci_edu_uninit; k->vendor_id = PCI_VENDOR_ID_QEMU; k->device_id = 0x11e8; -- cgit v1.1 From 9763af08f816cdd6f329cde1c97597a0041998f5 Mon Sep 17 00:00:00 2001 From: Johan Ouwerkerk Date: Thu, 24 Dec 2015 23:31:26 +0100 Subject: Add missing syscall nrs. according to more recent Linux kernels This change covers arm, aarch64, mips. Others to follow? The change was prompted by QEMU warning about a syscall 384 (get_random()) with Debian armhf binaries (ARMv7). Signed-off-by: Johan Ouwerkerk Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- linux-user/aarch64/syscall_nr.h | 13 +++++++++++++ linux-user/arm/syscall_nr.h | 12 ++++++++++++ linux-user/mips/syscall_nr.h | 12 ++++++++++++ 3 files changed, 37 insertions(+) diff --git a/linux-user/aarch64/syscall_nr.h b/linux-user/aarch64/syscall_nr.h index 743255d..74f4275 100644 --- a/linux-user/aarch64/syscall_nr.h +++ b/linux-user/aarch64/syscall_nr.h @@ -262,6 +262,19 @@ #define TARGET_NR_process_vm_writev 271 #define TARGET_NR_kcmp 272 #define TARGET_NR_finit_module 273 + +#define TARGET_NR_sched_setattr 274 +#define TARGET_NR_sched_getattr 275 +#define TARGET_NR_renameat2 276 +#define TARGET_NR_seccomp 277 +#define TARGET_NR_getrandom 278 +#define TARGET_NR_memfd_create 279 +#define TARGET_NR_bpf 280 +#define TARGET_NR_execveat 281 +#define TARGET_NR_userfaultfd 282 +#define TARGET_NR_membarrier 283 +#define TARGET_NR_mlock2 284 + #define TARGET_NR_open 1024 #define TARGET_NR_link 1025 #define TARGET_NR_unlink 1026 diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h index 53552be..cc9089c 100644 --- a/linux-user/arm/syscall_nr.h +++ b/linux-user/arm/syscall_nr.h @@ -384,3 +384,15 @@ #define TARGET_NR_process_vm_writev (377) #define TARGET_NR_kcmp (378) #define TARGET_NR_finit_module (379) + +#define TARGET_NR_sched_setattr (380) +#define TARGET_NR_sched_getattr (381) +#define TARGET_NR_renameat2 (382) +#define TARGET_NR_seccomp (383) +#define TARGET_NR_getrandom (384) +#define TARGET_NR_memfd_create (385) +#define TARGET_NR_bpf (386) +#define TARGET_NR_execveat (387) +#define TARGET_NR_userfaultfd (388) +#define TARGET_NR_membarrier (389) +#define TARGET_NR_mlock2 (390) diff --git a/linux-user/mips/syscall_nr.h b/linux-user/mips/syscall_nr.h index 2d1a13e..6819f86 100644 --- a/linux-user/mips/syscall_nr.h +++ b/linux-user/mips/syscall_nr.h @@ -351,3 +351,15 @@ #define TARGET_NR_process_vm_writev (TARGET_NR_Linux + 346) #define TARGET_NR_kcmp (TARGET_NR_Linux + 347) #define TARGET_NR_finit_module (TARGET_NR_Linux + 348) + +#define TARGET_NR_sched_setattr (TARGET_NR_Linux + 349) +#define TARGET_NR_sched_getattr (TARGET_NR_Linux + 350) +#define TARGET_NR_renameat2 (TARGET_NR_Linux + 351) +#define TARGET_NR_seccomp (TARGET_NR_Linux + 352) +#define TARGET_NR_getrandom (TARGET_NR_Linux + 353) +#define TARGET_NR_memfd_create (TARGET_NR_Linux + 354) +#define TARGET_NR_bpf (TARGET_NR_Linux + 355) +#define TARGET_NR_execveat (TARGET_NR_Linux + 356) +#define TARGET_NR_userfaultfd (TARGET_NR_Linux + 357) +#define TARGET_NR_membarrier (TARGET_NR_Linux + 358) +#define TARGET_NR_mlock2 (TARGET_NR_Linux + 359) -- cgit v1.1 From b429d363ed551a7d6b638368c2c73001a2416706 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Fri, 18 Dec 2015 19:03:51 +0800 Subject: gt64120: convert to realize() Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/mips/gt64xxx_pci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index f76a9fd..c1f3c9c 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -1193,7 +1193,7 @@ static int gt64120_init(SysBusDevice *dev) return 0; } -static int gt64120_pci_init(PCIDevice *d) +static void gt64120_pci_realize(PCIDevice *d, Error **errp) { /* FIXME: Malta specific hw assumptions ahead */ pci_set_word(d->config + PCI_COMMAND, 0); @@ -1207,8 +1207,6 @@ static int gt64120_pci_init(PCIDevice *d) pci_set_long(d->config + PCI_BASE_ADDRESS_4, 0x14000000); pci_set_long(d->config + PCI_BASE_ADDRESS_5, 0x14000001); pci_set_byte(d->config + 0x3d, 0x01); - - return 0; } static void gt64120_pci_class_init(ObjectClass *klass, void *data) @@ -1216,7 +1214,7 @@ static void gt64120_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - k->init = gt64120_pci_init; + k->realize = gt64120_pci_realize; k->vendor_id = PCI_VENDOR_ID_MARVELL; k->device_id = PCI_DEVICE_ID_MARVELL_GT6412X; k->revision = 0x10; -- cgit v1.1 From 9f23b27d0d981a26015472bbdf7a54e549326ed3 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Fri, 18 Dec 2015 19:03:48 +0800 Subject: SH PCI Host: convert to realize() Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/sh4/sh_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c index a2f6d9e..4509053 100644 --- a/hw/sh4/sh_pci.c +++ b/hw/sh4/sh_pci.c @@ -151,12 +151,11 @@ static int sh_pci_device_init(SysBusDevice *dev) return 0; } -static int sh_pci_host_init(PCIDevice *d) +static void sh_pci_host_realize(PCIDevice *d, Error **errp) { pci_set_word(d->config + PCI_COMMAND, PCI_COMMAND_WAIT); pci_set_word(d->config + PCI_STATUS, PCI_STATUS_CAP_LIST | PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM); - return 0; } static void sh_pci_host_class_init(ObjectClass *klass, void *data) @@ -164,7 +163,7 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - k->init = sh_pci_host_init; + k->realize = sh_pci_host_realize; k->vendor_id = PCI_VENDOR_ID_HITACHI; k->device_id = PCI_DEVICE_ID_HITACHI_SH7751R; /* -- cgit v1.1 From a2a645d9678797ea833197d0daf2e330ea75908a Mon Sep 17 00:00:00 2001 From: Cao jin Date: Tue, 5 Jan 2016 18:57:49 +0800 Subject: PCI Bonito: QOMify and cleanup Also clear the code Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/pci-host/bonito.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 4139a2c..b477679 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -180,8 +180,6 @@ #define PCI_ADDR(busno,devno,funno,regno) \ ((((busno)<<16)&0xff0000) + (((devno)<<11)&0xf800) + (((funno)<<8)&0x700) + (regno)) -#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" - typedef struct BonitoState BonitoState; typedef struct PCIBonitoState @@ -215,17 +213,20 @@ typedef struct PCIBonitoState } PCIBonitoState; -#define BONITO_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(BonitoState, (obj), TYPE_BONITO_PCI_HOST_BRIDGE) - struct BonitoState { PCIHostState parent_obj; - qemu_irq *pic; - PCIBonitoState *pci_dev; }; +#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" +#define BONITO_PCI_HOST_BRIDGE(obj) \ + OBJECT_CHECK(BonitoState, (obj), TYPE_BONITO_PCI_HOST_BRIDGE) + +#define TYPE_PCI_BONITO "Bonito" +#define PCI_BONITO(obj) \ + OBJECT_CHECK(PCIBonitoState, (obj), TYPE_PCI_BONITO) + static void bonito_writel(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -723,7 +724,7 @@ static int bonito_pcihost_initfn(SysBusDevice *dev) static void bonito_realize(PCIDevice *dev, Error **errp) { - PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); + PCIBonitoState *s = PCI_BONITO(dev); SysBusDevice *sysbus = SYS_BUS_DEVICE(s->pcihost); PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost); @@ -799,8 +800,8 @@ PCIBus *bonito_init(qemu_irq *pic) qdev_init_nofail(dev); /* set the pcihost pointer before bonito_initfn is called */ - d = pci_create(phb->bus, PCI_DEVFN(0, 0), "Bonito"); - s = DO_UPCAST(PCIBonitoState, dev, d); + d = pci_create(phb->bus, PCI_DEVFN(0, 0), TYPE_PCI_BONITO); + s = PCI_BONITO(d); s->pcihost = pcihost; pcihost->pci_dev = s; qdev_init_nofail(DEVICE(d)); @@ -828,7 +829,7 @@ static void bonito_class_init(ObjectClass *klass, void *data) } static const TypeInfo bonito_info = { - .name = "Bonito", + .name = TYPE_PCI_BONITO, .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIBonitoState), .class_init = bonito_class_init, -- cgit v1.1 From 8f32510f1ca72332b9a662579e951f67d636142e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 18 Dec 2015 12:59:31 +0000 Subject: scripts/checkpatch.pl: Don't allow special cases of unspaced operators The checkpatch.pl script has a special case to permit the following operators to have no spaces around them: << >> & ^ | + - * / % QEMU style prefers all operators to consistently have spacing around them, so remove this special case handling. This avoids reviewers having to manually note it during code review. Signed-off-by: Peter Maydell Reviewed-by: Stefan Weil Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- scripts/checkpatch.pl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b0f6e11..efca817 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1890,19 +1890,6 @@ sub process { ERROR("space prohibited after that '$op' $at\n" . $hereptr); } - - # << and >> may either have or not have spaces both sides - } elsif ($op eq '<<' or $op eq '>>' or - $op eq '&' or $op eq '^' or $op eq '|' or - $op eq '+' or $op eq '-' or - $op eq '*' or $op eq '/' or - $op eq '%') - { - if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { - ERROR("need consistent spacing around '$op' $at\n" . - $hereptr); - } - # A colon needs no spaces before when it is # terminating a case value or a label. } elsif ($opv eq ':C' || $opv eq ':L') { -- cgit v1.1 From 529490e5d664a20d5c4223070dd7c03a0e02b6bd Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 4 Dec 2015 17:34:20 +0000 Subject: osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h Our use of glib is now pervasive across QEMU. Move the include of glib-compat.h from qemu-common.h to osdep.h so that it is more widely accessible and doesn't get forgotten by accident. (Failure to include it will result in build failure on old versions of glib which is likely to be unnoticed by most developers.) Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/qemu-common.h | 1 - include/qemu/osdep.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index 405364f..22b010c 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -22,7 +22,6 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) -#include "glib-compat.h" #include "qemu/option.h" #include "qemu/host-utils.h" diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 84e84ac..59a7f8d 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -69,6 +69,8 @@ #include "sysemu/os-posix.h" #endif +#include "glib-compat.h" + #include "qapi/error.h" #if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10 -- cgit v1.1 From 4e6f7cfbf98e7adae2be524b4042751d107a5bb4 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Nov 2015 21:16:08 +0100 Subject: hw/ide: Remove superfluous return statements The "return;" statements at the end of functions do not make much sense, so let's remove them. Cc: qemu-block@nongnu.org Signed-off-by: Thomas Huth Reviewed-by: John Snow Signed-off-by: Michael Tokarev --- hw/ide/atapi.c | 1 - hw/ide/macio.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 65f8dd4..272ab90 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -824,7 +824,6 @@ static void cmd_inquiry(IDEState *s, uint8_t *buf) out: buf[size_idx] = idx - preamble_len; ide_atapi_cmd_reply(s, idx, max_len); - return; } static void cmd_get_configuration(IDEState *s, uint8_t *buf) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 3ee962f..9771261 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -292,8 +292,6 @@ done: block_acct_done(blk_get_stats(s->blk), &s->acct); } io->dma_end(opaque); - - return; } static void pmac_ide_transfer_cb(void *opaque, int ret) -- cgit v1.1 From ff433bbb82d2c1b4c0146ccb0ce78f58fb382fda Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Nov 2015 21:16:09 +0100 Subject: hw/acpi: Remove superfluous return statement The "return;" statement at the end of acpi_memory_plug_cb() does not make much sense, so let's remove it. Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/acpi/memory_hotplug.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 298e868..65cbc80 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -250,7 +250,6 @@ void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st, /* do ACPI magic */ acpi_send_gpe_event(ar, irq, ACPI_MEMORY_HOTPLUG_STATUS); } - return; } void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq, -- cgit v1.1 From 1063477834b5fa86401da00262a92d1f386e49b9 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Nov 2015 21:16:11 +0100 Subject: hw/core/qdev: Remove superfluous return statement The "return;" statement at the end of device_set_realized() does not make much sense, so let's remove it. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/core/qdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b3ad467..4e3173d 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -1134,7 +1134,6 @@ post_realize_fail: fail: error_propagate(errp, local_err); - return; } static bool device_get_hotpluggable(Object *obj, Error **errp) -- cgit v1.1 From fe02fc5209d497d011b2b4b09395e2503d9dedc6 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Nov 2015 21:16:10 +0100 Subject: hw/s390x: Remove superfluous return statements The "return;" statements at the end of functions do not make much sense, so let's remove them. Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Cc: Richard Henderson Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/s390x/css.c | 1 - hw/s390x/s390-pci-bus.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 19851ce..343c352 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1430,7 +1430,6 @@ void subch_device_save(SubchDev *s, QEMUFile *f) } qemu_put_byte(f, s->ccw_fmt_1); qemu_put_byte(f, s->ccw_no_data_cnt); - return; } int subch_device_load(SubchDev *s, QEMUFile *f) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 98c726c..8de35ff 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -123,7 +123,6 @@ void s390_pci_sclp_configure(int configure, SCCB *sccb) } psccb->header.response_code = cpu_to_be16(rc); - return; } static uint32_t s390_pci_get_pfid(PCIDevice *pdev) @@ -439,8 +438,6 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data, io_int_word = (pbdev->isc << 27) | IO_INT_WORD_AI; s390_io_interrupt(0, 0, 0, io_int_word); } - - return; } static uint64_t s390_msi_ctrl_read(void *opaque, hwaddr addr, unsigned size) @@ -561,7 +558,6 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev, s390_pci_generate_plug_event(HP_EVENT_TO_CONFIGURED, pbdev->fh, pbdev->fid); } - return; } static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev, -- cgit v1.1