本文整理汇总了C++中runstate_is_running函数的典型用法代码示例。如果您正苦于以下问题:C++ runstate_is_running函数的具体用法?C++ runstate_is_running怎么用?C++ runstate_is_running使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了runstate_is_running函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sdl_update_caption
static void sdl_update_caption(struct sdl2_console *scon)
{
char win_title[1024];
char icon_title[1024];
const char *status = "";
if (!runstate_is_running()) {
status = " [Stopped]";
} else if (gui_grab) {
if (alt_grab) {
status = " - Press Ctrl-Alt-Shift to exit grab";
} else if (ctrl_grab) {
status = " - Press Right-Ctrl to exit grab";
} else {
status = " - Press Ctrl-Alt to exit grab";
}
}
if (qemu_name) {
snprintf(win_title, sizeof(win_title), "QEMU (%s-%d)%s", qemu_name,
scon->idx, status);
snprintf(icon_title, sizeof(icon_title), "QEMU (%s)", qemu_name);
} else {
snprintf(win_title, sizeof(win_title), "QEMU%s", status);
snprintf(icon_title, sizeof(icon_title), "QEMU");
}
if (scon->real_window) {
SDL_SetWindowTitle(scon->real_window, win_title);
}
}
示例2: sdl_update_caption
static void sdl_update_caption(void)
{
char win_title[1024];
char icon_title[1024];
const char *status = "";
if (!runstate_is_running())
status = " [Stopped]";
else if (gui_grab) {
if (alt_grab)
status = " - Press Ctrl-Alt-Shift to exit mouse grab";
else if (ctrl_grab)
status = " - Press Right-Ctrl to exit mouse grab";
else
status = " - Press Ctrl-Alt to exit mouse grab";
}
if (qemu_name) {
snprintf(win_title, sizeof(win_title), "QEMU (%s)%s", qemu_name, status);
snprintf(icon_title, sizeof(icon_title), "QEMU (%s)", qemu_name);
} else {
snprintf(win_title, sizeof(win_title), "QEMU%s", status);
snprintf(icon_title, sizeof(icon_title), "QEMU");
}
SDL_WM_SetCaption(win_title, icon_title);
}
示例3: icount_adjust
static void icount_adjust(void)
{
int64_t cur_time;
int64_t cur_icount;
int64_t delta;
static int64_t last_delta;
/* If the VM is not running, then do nothing. */
if (!runstate_is_running()) {
return;
}
cur_time = cpu_get_clock();
cur_icount = qemu_get_clock_ns(vm_clock);
delta = cur_icount - cur_time;
/* FIXME: This is a very crude algorithm, somewhat prone to oscillation. */
if (delta > 0
&& last_delta + ICOUNT_WOBBLE < delta * 2
&& icount_time_shift > 0) {
/* The guest is getting too far ahead. Slow time down. */
icount_time_shift--;
}
if (delta < 0
&& last_delta - ICOUNT_WOBBLE > delta * 2
&& icount_time_shift < MAX_ICOUNT_SHIFT) {
/* The guest is getting too far behind. Speed time up. */
icount_time_shift++;
}
last_delta = delta;
qemu_icount_bias = cur_icount - (qemu_icount << icount_time_shift);
}
示例4: migrate_fd_put_ready
static void migrate_fd_put_ready(void *opaque)
{
MigrationState *s = opaque;
int ret;
if (s->state != MIG_STATE_ACTIVE) {
DPRINTF("put_ready returning because of non-active state\n");
return;
}
DPRINTF("iterate\n");
ret = qemu_savevm_state_iterate(s->mon, s->file);
if (ret < 0) {
migrate_fd_error(s);
} else if (ret == 1) {
int old_vm_running = runstate_is_running();
DPRINTF("done iterating\n");
vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
if (qemu_savevm_state_complete(s->mon, s->file) < 0) {
migrate_fd_error(s);
} else {
migrate_fd_completed(s);
}
if (s->state != MIG_STATE_COMPLETED) {
if (old_vm_running) {
vm_start();
}
}
}
}
示例5: icount_warp_rt
static void icount_warp_rt(void *opaque)
{
if (vm_clock_warp_start == -1) {
return;
}
if (runstate_is_running()) {
int64_t clock = qemu_get_clock_ns(rt_clock);
int64_t warp_delta = clock - vm_clock_warp_start;
if (use_icount == 1) {
qemu_icount_bias += warp_delta;
} else {
/*
* In adaptive mode, do not let the vm_clock run too
* far ahead of real time.
*/
int64_t cur_time = cpu_get_clock();
int64_t cur_icount = qemu_get_clock_ns(vm_clock);
int64_t delta = cur_time - cur_icount;
qemu_icount_bias += MIN(warp_delta, delta);
}
if (qemu_clock_expired(vm_clock)) {
qemu_notify_event();
}
}
vm_clock_warp_start = -1;
}
示例6: vm_stop_force_state
/* does a state transition even if the VM is already stopped,
current state is forgotten forever */
void vm_stop_force_state(RunState state)
{
if (runstate_is_running()) {
vm_stop(state);
} else {
runstate_set(state);
}
}
示例7: cpu_can_run
static int cpu_can_run(CPUArchState *env)
{
if (env->stop) {
return 0;
}
if (env->stopped || !runstate_is_running()) {
return 0;
}
return 1;
}
示例8: cpu_can_run
static bool cpu_can_run(CPUState *cpu)
{
if (cpu->stop) {
return false;
}
if (cpu->stopped || !runstate_is_running()) {
return false;
}
return true;
}
示例9: vm_stop_force_state
/* does a state transition even if the VM is already stopped,
current state is forgotten forever */
void vm_stop_force_state(RunState state)
{
if (runstate_is_running()) {
vm_stop(state);
} else {
//if(!mthread){
runstate_set(state);
//}
}
}
示例10: vm_stop_force_state
/* does a state transition even if the VM is already stopped,
current state is forgotten forever */
int vm_stop_force_state(RunState state)
{
if (runstate_is_running()) {
return vm_stop(state);
} else {
runstate_set(state);
/* Make sure to return an error if the flush in a previous vm_stop()
* failed. */
return bdrv_flush_all();
}
}
示例11: DMA_run
static void DMA_run(void *opaque)
{
struct fs_dma_ctrl *etraxfs_dmac = opaque;
int p = 1;
if (runstate_is_running())
p = etraxfs_dmac_run(etraxfs_dmac);
if (p)
qemu_bh_schedule_idle(etraxfs_dmac->bh);
}
示例12: do_vm_stop
static void do_vm_stop(RunState state)
{
if (runstate_is_running()) {
cpu_disable_ticks();
pause_all_vcpus();
runstate_set(state);
vm_state_notify(0, state);
bdrv_drain_all();
bdrv_flush_all();
monitor_protocol_event(QEVENT_STOP, NULL);
}
}
示例13: cpu_thread_is_idle
static bool cpu_thread_is_idle(CPUArchState *env)
{
if (env->stop || env->queued_work_first) {
return false;
}
if (env->stopped || !runstate_is_running()) {
return true;
}
if (!env->halted || qemu_cpu_has_work(env) || kvm_irqchip_in_kernel()) {
return false;
}
return true;
}
示例14: do_vm_stop
static void do_vm_stop(RunState state)
{
if (runstate_is_running()) {
cpu_disable_ticks();
pause_all_vcpus();
//if(!mthread){ // TLC
runstate_set(state);
//}
vm_state_notify(0, state);
qemu_aio_flush();
bdrv_flush_all();
monitor_protocol_event(QEVENT_STOP, NULL);
}
}
示例15: cpu_thread_is_idle
static bool cpu_thread_is_idle(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
if (cpu->stop || cpu->queued_work_first) {
return false;
}
if (cpu->stopped || !runstate_is_running()) {
return true;
}
if (!env->halted || qemu_cpu_has_work(cpu) ||
kvm_async_interrupts_enabled()) {
return false;
}
return true;
}