summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-09-20 15:16:00 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-09-20 15:16:00 -0500
commit7f67d8922e2da59c02852de39f888d7873e8645c (patch)
treefde41774a54f63bce66a739332c3dbd27365af91 /hw
parent27acf660aa1678ff3e7291fa81f4d5d4020b20f8 (diff)
parent6e0ca8820dddd04056c43327f3b3699f572d03d4 (diff)
downloadqemu-7f67d8922e2da59c02852de39f888d7873e8645c.tar.gz
qemu-7f67d8922e2da59c02852de39f888d7873e8645c.tar.bz2
qemu-7f67d8922e2da59c02852de39f888d7873e8645c.zip
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Diffstat (limited to 'hw')
-rw-r--r--hw/etraxfs_dma.c2
-rw-r--r--hw/ide/ahci.c2
-rw-r--r--hw/ide/core.c4
-rw-r--r--hw/ide/internal.h3
-rw-r--r--hw/ide/pci.c2
-rw-r--r--hw/kvmclock.c5
-rw-r--r--hw/qxl.c5
-rw-r--r--hw/scsi-disk.c4
-rw-r--r--hw/virtio-blk.c5
-rw-r--r--hw/virtio.c4
-rw-r--r--hw/watchdog.c2
11 files changed, 21 insertions, 17 deletions
diff --git a/hw/etraxfs_dma.c b/hw/etraxfs_dma.c
index e8ad9e6a0b..d3082acc8f 100644
--- a/hw/etraxfs_dma.c
+++ b/hw/etraxfs_dma.c
@@ -732,7 +732,7 @@ static void DMA_run(void *opaque)
struct fs_dma_ctrl *etraxfs_dmac = opaque;
int p = 1;
- if (vm_running)
+ if (runstate_is_running())
p = etraxfs_dmac_run(etraxfs_dmac);
if (p)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index a8659cf8b9..b8132369ad 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1103,7 +1103,7 @@ static void ahci_irq_set(void *opaque, int n, int level)
{
}
-static void ahci_dma_restart_cb(void *opaque, int running, int reason)
+static void ahci_dma_restart_cb(void *opaque, int running, RunState state)
{
}
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 9297b9e657..4d5a076ad2 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -527,7 +527,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int op)
s->bus->dma->ops->set_unit(s->bus->dma, s->unit);
s->bus->error_status = op;
bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
- vm_stop(VMSTOP_DISKFULL);
+ vm_stop(RSTATE_IO_ERROR);
} else {
if (op & BM_STATUS_DMA_RETRY) {
dma_buf_commit(s, 0);
@@ -1910,7 +1910,7 @@ static int ide_nop_int(IDEDMA *dma, int x)
return 0;
}
-static void ide_nop_restart(void *opaque, int x, int y)
+static void ide_nop_restart(void *opaque, int x, RunState y)
{
}
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 233915ce0d..9046e96013 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -9,6 +9,7 @@
#include <hw/ide.h>
#include "iorange.h"
#include "dma.h"
+#include "sysemu.h"
/* debug IDE devices */
//#define DEBUG_IDE
@@ -387,7 +388,7 @@ typedef void EndTransferFunc(IDEState *);
typedef void DMAStartFunc(IDEDMA *, IDEState *, BlockDriverCompletionFunc *);
typedef int DMAFunc(IDEDMA *);
typedef int DMAIntFunc(IDEDMA *, int);
-typedef void DMARestartFunc(void *, int, int);
+typedef void DMARestartFunc(void *, int, RunState);
struct unreported_events {
bool eject_request;
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 9fded02954..f133c422b6 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -222,7 +222,7 @@ static void bmdma_restart_bh(void *opaque)
}
}
-static void bmdma_restart_cb(void *opaque, int running, int reason)
+static void bmdma_restart_cb(void *opaque, int running, RunState state)
{
IDEDMA *dma = opaque;
BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
diff --git a/hw/kvmclock.c b/hw/kvmclock.c
index b73aec409c..5388bc489d 100644
--- a/hw/kvmclock.c
+++ b/hw/kvmclock.c
@@ -46,7 +46,7 @@ static void kvmclock_pre_save(void *opaque)
* it on next vmsave (which would return a different value). Will be reset
* when the VM is continued.
*/
- s->clock_valid = !vm_running;
+ s->clock_valid = !runstate_is_running();
}
static int kvmclock_post_load(void *opaque, int version_id)
@@ -59,7 +59,8 @@ static int kvmclock_post_load(void *opaque, int version_id)
return kvm_vm_ioctl(kvm_state, KVM_SET_CLOCK, &data);
}
-static void kvmclock_vm_state_change(void *opaque, int running, int reason)
+static void kvmclock_vm_state_change(void *opaque, int running,
+ RunState state)
{
KVMClockState *s = opaque;
diff --git a/hw/qxl.c b/hw/qxl.c
index a282d2396b..6db2f1a466 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1453,10 +1453,11 @@ static void qxl_hw_text_update(void *opaque, console_ch_t *chardata)
}
}
-static void qxl_vm_change_state_handler(void *opaque, int running, int reason)
+static void qxl_vm_change_state_handler(void *opaque, int running,
+ RunState state)
{
PCIQXLDevice *qxl = opaque;
- qemu_spice_vm_change_state_handler(&qxl->ssd, running, reason);
+ qemu_spice_vm_change_state_handler(&qxl->ssd, running, state);
if (running) {
/*
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 4a60820b18..96c554fe29 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -217,7 +217,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
r->status |= SCSI_REQ_STATUS_RETRY | type;
bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
- vm_stop(VMSTOP_DISKFULL);
+ vm_stop(RSTATE_IO_ERROR);
} else {
switch (error) {
case ENOMEM:
@@ -338,7 +338,7 @@ static void scsi_dma_restart_bh(void *opaque)
}
}
-static void scsi_dma_restart_cb(void *opaque, int running, int reason)
+static void scsi_dma_restart_cb(void *opaque, int running, RunState state)
{
SCSIDiskState *s = opaque;
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index c2ee0001eb..daa8e42be7 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -77,7 +77,7 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
req->next = s->rq;
s->rq = req;
bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
- vm_stop(VMSTOP_DISKFULL);
+ vm_stop(RSTATE_IO_ERROR);
} else {
virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
bdrv_acct_done(s->bs, &req->acct);
@@ -439,7 +439,8 @@ static void virtio_blk_dma_restart_bh(void *opaque)
virtio_submit_multiwrite(s->bs, &mrb);
}
-static void virtio_blk_dma_restart_cb(void *opaque, int running, int reason)
+static void virtio_blk_dma_restart_cb(void *opaque, int running,
+ RunState state)
{
VirtIOBlock *s = opaque;
diff --git a/hw/virtio.c b/hw/virtio.c
index 946d911580..d9bf266492 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -847,7 +847,7 @@ void virtio_cleanup(VirtIODevice *vdev)
g_free(vdev);
}
-static void virtio_vmstate_change(void *opaque, int running, int reason)
+static void virtio_vmstate_change(void *opaque, int running, RunState state)
{
VirtIODevice *vdev = opaque;
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
@@ -880,7 +880,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id,
vdev->queue_sel = 0;
vdev->config_vector = VIRTIO_NO_VECTOR;
vdev->vq = g_malloc0(sizeof(VirtQueue) * VIRTIO_PCI_QUEUE_MAX);
- vdev->vm_running = vm_running;
+ vdev->vm_running = runstate_is_running();
for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) {
vdev->vq[i].vector = VIRTIO_NO_VECTOR;
vdev->vq[i].vdev = vdev;
diff --git a/hw/watchdog.c b/hw/watchdog.c
index 1c900a1189..71c6c7df63 100644
--- a/hw/watchdog.c
+++ b/hw/watchdog.c
@@ -132,7 +132,7 @@ void watchdog_perform_action(void)
case WDT_PAUSE: /* same as 'stop' command in monitor */
watchdog_mon_event("pause");
- vm_stop(VMSTOP_WATCHDOG);
+ vm_stop(RSTATE_WATCHDOG);
break;
case WDT_DEBUG: