diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/core/ptimer.c | 1 | ||||
-rw-r--r-- | hw/i386/kvm/clock.c | 6 | ||||
-rw-r--r-- | hw/ppc/pnv.c | 1 | ||||
-rw-r--r-- | hw/scsi/mptsas.c | 6 |
4 files changed, 11 insertions, 3 deletions
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 59ccb00550..7221c68a98 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -13,6 +13,7 @@ #include "sysemu/replay.h" #include "sysemu/qtest.h" #include "block/aio.h" +#include "sysemu/cpus.h" #define DELTA_ADJUST 1 #define DELTA_NO_ADJUST -1 diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index ef9d560f9c..13eca374cd 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -22,6 +22,7 @@ #include "kvm_i386.h" #include "hw/sysbus.h" #include "hw/kvm/clock.h" +#include "qapi/error.h" #include <linux/kvm.h> #include <linux/kvm_para.h> @@ -208,6 +209,11 @@ static void kvmclock_realize(DeviceState *dev, Error **errp) { KVMClockState *s = KVM_CLOCK(dev); + if (!kvm_enabled()) { + error_setg(errp, "kvmclock device requires KVM"); + return; + } + kvm_update_clock(s); qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 09f0d22def..3fa722af82 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -21,6 +21,7 @@ #include "qapi/error.h" #include "sysemu/sysemu.h" #include "sysemu/numa.h" +#include "sysemu/cpus.h" #include "hw/hw.h" #include "target/ppc/cpu.h" #include "qemu/log.h" diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 2e091c0156..765ab53c34 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -756,7 +756,7 @@ static void mptsas_fetch_request(MPTSASState *s) /* Read the message header from the guest first. */ addr = s->host_mfa_high_addr | MPTSAS_FIFO_GET(s, request_post); - pci_dma_read(pci, addr, req, sizeof(hdr)); + pci_dma_read(pci, addr, req, sizeof(*hdr)); if (hdr->Function < ARRAY_SIZE(mpi_request_sizes) && mpi_request_sizes[hdr->Function]) { @@ -766,8 +766,8 @@ static void mptsas_fetch_request(MPTSASState *s) */ size = mpi_request_sizes[hdr->Function]; assert(size <= MPTSAS_MAX_REQUEST_SIZE); - pci_dma_read(pci, addr + sizeof(hdr), &req[sizeof(hdr)], - size - sizeof(hdr)); + pci_dma_read(pci, addr + sizeof(*hdr), &req[sizeof(*hdr)], + size - sizeof(*hdr)); } if (hdr->Function == MPI_FUNCTION_SCSI_IO_REQUEST) { |