sysemu: Let VMChangeStateHandler take boolean 'running' argument
Subsystems (3)
cover sysemu: Let VMChangeStateHandler take boolean 'running' argument
Trivial prototype change to clarify the use of the 'running' argument of VMChangeStateHandler.
Green CI:
https://gitlab.com/philmd/qemu/-/pipelines/239497352
Philippe Mathieu-Daudé (2):
sysemu/runstate: Let runstate_is_running() return bool
sysemu: Let VMChangeStateHandler take boolean 'running' argument
include/sysemu/runstate.h | 12 +++++++++--- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 4 ++-- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 51 insertions(+), 45 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/2 sysemu/runstate: Let runstate_is_running() return bool
runstate_check() returns a boolean. runstate_is_running() returns what runstate_check() returns, also a boolean.
--- include/sysemu/runstate.h | 2 +- softmmu/runstate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/sysemu/runstate.h +1 -1
@@ -6,7 +6,7 @@bool runstate_check (RunState state);void runstate_set (RunState new_state); -int runstate_is_running (void ); +bool runstate_is_running (void );bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size);
softmmu/runstate.c +1 -1
@@ -217,7 +217,7 @@ void runstate_set(RunState new_state) current_run_state = new_state; } -int runstate_is_running (void ) +bool runstate_is_running (void ) {return runstate_check (RUN_STATE_RUNNING ); }
Signature · 1 line
2.26.2
Re: [PATCH 1/2] sysemu/runstate: Let runstate_is_running() return bool
Quoted 28 lines · Philippe Mathieu-Daudé
runstate_check()returns a boolean.runstate_is_running()returns whatrunstate_check()returns, also a boolean.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/sysemu/runstate.h | 2 +- softmmu/runstate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/sysemu/runstate.h +1
-1@@ -6,7 +6,7 @@bool runstate_check (RunState state);void runstate_set (RunState new_state); -int runstate_is_running (void ); +bool runstate_is_running (void );bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size);softmmu/runstate.c +0
-0
softmmu/runstate.c void runstate_set(RunState new_state) · line 223
Quoted 8 lines
softmmu/runstate.c +1
-1@@ -217,7 +217,7 @@ void runstate_set(RunState new_state) current_run_state = new_state; } -int runstate_is_running (void ) +bool runstate_is_running (void ) {return runstate_check (RUN_STATE_RUNNING ); }
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 1/2] sysemu/runstate: Let runstate_is_running() return bool
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
runstate_check()returns a boolean.runstate_is_running()returns whatrunstate_check()returns, also a boolean.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Signature · 1 line
Alex Bennée
Laurent Vivier
AppliedRe: [PATCH 1/2] sysemu/runstate: Let runstate_is_running() return bool
In reply to Philippe Mathieu-DaudéLe 11/01/2021 à 16:20, Philippe Mathieu-Daudé a écrit :
Quoted 28 lines
runstate_check()returns a boolean.runstate_is_running()returns whatrunstate_check()returns, also a boolean.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/sysemu/runstate.h | 2 +- softmmu/runstate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/sysemu/runstate.h +1
-1@@ -6,7 +6,7 @@bool runstate_check (RunState state);void runstate_set (RunState new_state); -int runstate_is_running (void ); +bool runstate_is_running (void );bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size);softmmu/runstate.c +0
-0
softmmu/runstate.c void runstate_set(RunState new_state) · line 223
Quoted 8 lines
softmmu/runstate.c +1
-1@@ -217,7 +217,7 @@ void runstate_set(RunState new_state) current_run_state = new_state; } -int runstate_is_running (void ) +bool runstate_is_running (void ) {return runstate_check (RUN_STATE_RUNNING ); }
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH 2/2 sysemu: Let VMChangeStateHandler take boolean 'running' argument
In reply to Philippe Mathieu-DaudéThe 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean.
--- include/sysemu/runstate.h | 10 ++++++++-- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 2 +- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 49 insertions(+), 43 deletions(-)
include/sysemu/runstate.h +8 -2
@@ -10,7 +10,7 @@ bool runstate_is_running(void);bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size); -typedef void VMChangeStateHandler (void *opaque,int running,RunState state); +typedef void VMChangeStateHandler (void *opaque,bool running,RunState state);VMChangeStateEntry *qemu_add_vm_change_state_handler (VMChangeStateHandler *cb,void *opaque);
@@ -20,7 +20,13 @@ VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev, VMChangeStateHandler *cb, void *opaque);void qemu_del_vm_change_state_handler (VMChangeStateEntry *e); -void vm_state_notify (int running,RunState state); +/** +* vm_state_notify: Notify the state of the VM +* +* @running: whether the VM is running or not. +* @state: the #RunState of the VM. +*/ +void vm_state_notify (bool running,RunState state);static inline bool shutdown_caused_by_guest (ShutdownCause cause) {
target/arm/kvm_arm.h +1 -1
@@ -352,7 +352,7 @@ void kvm_arm_get_virtual_time(CPUState *cs);*/ void kvm_arm_put_virtual_time (CPUState *cs); -void kvm_arm_vm_state_change (void *opaque,int running,RunState state); +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state);int kvm_arm_vgic_probe (void );
target/ppc/cpu-qom.h +1 -1
@@ -218,7 +218,7 @@ extern const VMStateDescription vmstate_ppc_timebase; .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state);#endif
accel/xen/xen-all.c +1 -1
@@ -122,7 +122,7 @@ static void xenstore_record_dm_state(struct xs_handle *xs, const char *state) } -static void xen_change_state_handler (void *opaque,int running, +static void xen_change_state_handler (void *opaque,bool running,RunState state) {if (running) {
audio/audio.c +1 -1
@@ -1549,7 +1549,7 @@ static int audio_driver_init(AudioState *s, struct audio_driver *drv, } } -static void audio_vm_change_state_handler (void *opaque,int running, +static void audio_vm_change_state_handler (void *opaque,bool running,RunState state) {AudioState *s = opaque;
block/block-backend.c +1 -1
@@ -163,7 +163,7 @@ static const char *blk_root_get_name(BdrvChild *child)return blk_name (child->opaque); } -static void blk_vm_state_changed (void *opaque,int running,RunState state) +static void blk_vm_state_changed (void *opaque,bool running,RunState state) {Error *local_err =NULL ;BlockBackend *blk = opaque;
gdbstub.c +1 -1
@@ -2691,7 +2691,7 @@ void gdb_set_stop_cpu(CPUState *cpu) }#ifndef CONFIG_USER_ONLY -static void gdb_vm_state_change (void *opaque,int running,RunState state) +static void gdb_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cpu = gdbserver_state.c_cpu;g_autoptr (GString) buf =g_string_new (NULL );
hw/block/pflash_cfi01.c +1 -1
@@ -1014,7 +1014,7 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *fl, DriveInfo *dinfo)loc_pop (&loc); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {PFlashCFI01 *pfl = opaque;
hw/block/virtio-blk.c +1 -1
@@ -870,7 +870,7 @@ static void virtio_blk_dma_restart_bh(void *opaque)virtio_blk_process_queued_requests (s, true); } -static void virtio_blk_dma_restart_cb (void *opaque,int running, +static void virtio_blk_dma_restart_cb (void *opaque,bool running,RunState state) {VirtIOBlock *s = opaque;
hw/display/qxl.c +1 -1
@@ -1992,7 +1992,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl) } } -static void qxl_vm_change_state_handler (void *opaque,int running, +static void qxl_vm_change_state_handler (void *opaque,bool running,RunState state) {PCIQXLDevice *qxl = opaque;
hw/i386/kvm/clock.c +1 -1
@@ -162,7 +162,7 @@ static void do_kvmclock_ctrl(CPUState *cpu, run_on_cpu_data data) } } -static void kvmclock_vm_state_change (void *opaque,int running, +static void kvmclock_vm_state_change (void *opaque,bool running,RunState state) {KVMClockState *s = opaque;
hw/i386/kvm/i8254.c +1 -1
@@ -239,7 +239,7 @@ static void kvm_pit_irq_control(void *opaque, int n, int enable)kvm_pit_put (pit); } -static void kvm_pit_vm_state_change (void *opaque,int running, +static void kvm_pit_vm_state_change (void *opaque,bool running,RunState state) {KVMPITState *s = opaque;
hw/i386/kvmvapic.c +1 -1
@@ -748,7 +748,7 @@ static void do_vapic_enable(CPUState *cs, run_on_cpu_data data) s->state =VAPIC_ACTIVE ; } -static void kvmvapic_vm_state_change (void *opaque,int running, +static void kvmvapic_vm_state_change (void *opaque,bool running,RunState state) {MachineState *ms =MACHINE (qdev_get_machine ());
hw/i386/xen/xen-hvm.c +1 -1
@@ -1235,7 +1235,7 @@ static void xen_main_loop_prepare(XenIOState *state) } -static void xen_hvm_change_state_handler (void *opaque,int running, +static void xen_hvm_change_state_handler (void *opaque,bool running,RunState rstate) {XenIOState *state = opaque;
hw/ide/core.c +1 -1
@@ -2677,7 +2677,7 @@ static void ide_restart_bh(void *opaque) } } -static void ide_restart_cb (void *opaque,int running,RunState state) +static void ide_restart_cb (void *opaque,bool running,RunState state) {IDEBus *bus = opaque;
hw/intc/arm_gicv3_its_kvm.c +1 -1
@@ -71,7 +71,7 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3ITSState *s = (GICv3ITSState *)opaque;
hw/intc/arm_gicv3_kvm.c +1 -1
@@ -743,7 +743,7 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] = {* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3State *s = (GICv3State *)opaque;
hw/intc/spapr_xive_kvm.c +1 -1
@@ -504,7 +504,7 @@ static int kvmppc_xive_get_queues(SpaprXive *xive, Error **errp)* runs again. If an interrupt was queued while the VM was stopped, * simply generate a trigger. */ -static void kvmppc_xive_change_state_handler (void *opaque,int running, +static void kvmppc_xive_change_state_handler (void *opaque,bool running,RunState state) {SpaprXive *xive = opaque;
hw/misc/mac_via.c +1 -1
@@ -1098,7 +1098,7 @@ static void mac_via_init(Object *obj) TYPE_ADB_BUS, DEVICE(obj), "adb.0"); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {MacVIAState *m =MAC_VIA (opaque);
hw/net/e1000e_core.c +1 -1
@@ -3298,7 +3298,7 @@ e1000e_autoneg_resume(E1000ECore *core) }static void -e1000e_vm_state_change (void *opaque,int running,RunState state) +e1000e_vm_state_change (void *opaque,bool running,RunState state) {E1000ECore *core = opaque;
hw/nvram/spapr_nvram.c +1 -1
@@ -217,7 +217,7 @@ static int spapr_nvram_pre_load(void *opaque)return 0 ; } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {SpaprNvram *nvram = opaque;
hw/ppc/ppc.c +1 -1
@@ -1059,7 +1059,7 @@ static void timebase_load(PPCTimebase *tb) } } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state) {PPCTimebase *tb = opaque;
hw/ppc/ppc_booke.c +1 -1
@@ -317,7 +317,7 @@ static void ppc_booke_timer_reset_handle(void *opaque)* action will be taken. To avoid this we always clear the watchdog state when * state changes to running. */ -static void cpu_state_change_handler (void *opaque,int running,RunState state) +static void cpu_state_change_handler (void *opaque,bool running,RunState state) {PowerPCCPU *cpu = opaque;CPUPPCState *env = &cpu->env;
hw/s390x/tod-kvm.c +1 -1
@@ -78,7 +78,7 @@ static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp) } } -static void kvm_s390_tod_vm_state_change (void *opaque,int running, +static void kvm_s390_tod_vm_state_change (void *opaque,bool running,RunState state) {S390TODState *td = opaque;
hw/scsi/scsi-bus.c +1 -1
@@ -181,7 +181,7 @@ void scsi_req_retry(SCSIRequest *req) req->retry = true; } -static void scsi_dma_restart_cb (void *opaque,int running,RunState state) +static void scsi_dma_restart_cb (void *opaque,bool running,RunState state) {SCSIDevice *s = opaque;
hw/usb/hcd-ehci.c +1 -1
@@ -2436,7 +2436,7 @@ static int usb_ehci_post_load(void *opaque, int version_id)return 0 ; } -static void usb_ehci_vm_state_change (void *opaque,int running,RunState state) +static void usb_ehci_vm_state_change (void *opaque,bool running,RunState state) {EHCIState *ehci = opaque;
hw/usb/host-libusb.c +1 -1
@@ -1755,7 +1755,7 @@ type_init(usb_host_register_types)static QEMUTimer *usb_auto_timer;static VMChangeStateEntry *usb_vmstate; -static void usb_host_vm_state (void *unused,int running,RunState state) +static void usb_host_vm_state (void *unused,bool running,RunState state) {if (running) {usb_host_auto_check (unused);
hw/usb/redirect.c +1 -1
@@ -1395,7 +1395,7 @@ static void usbredir_chardev_event(void *opaque, QEMUChrEvent event)* init + destroy */ -static void usbredir_vm_state_change (void *priv,int running,RunState state) +static void usbredir_vm_state_change (void *priv,bool running,RunState state) {USBRedirDevice *dev = priv;
hw/vfio/migration.c +1 -1
@@ -727,7 +727,7 @@ static SaveVMHandlers savevm_vfio_handlers = {/* ---------------------------------------------------------------------- */ -static void vfio_vmstate_change (void *opaque,int running,RunState state) +static void vfio_vmstate_change (void *opaque,bool running,RunState state) {VFIODevice *vbasedev = opaque;VFIOMigration *migration = vbasedev->migration;
hw/virtio/virtio-rng.c +1 -1
@@ -133,7 +133,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t f, Error **errp)return f; } -static void virtio_rng_vm_state_change (void *opaque,int running, +static void virtio_rng_vm_state_change (void *opaque,bool running,RunState state) {VirtIORNG *vrng = opaque;
hw/virtio/virtio.c +1 -1
@@ -3208,7 +3208,7 @@ void virtio_cleanup(VirtIODevice *vdev)qemu_del_vm_change_state_handler (vdev->vmstate); } -static void virtio_vmstate_change (void *opaque,int running,RunState state) +static void virtio_vmstate_change (void *opaque,bool running,RunState state) {VirtIODevice *vdev = opaque;BusState *qbus =qdev_get_parent_bus (DEVICE (vdev));
net/net.c +1 -1
@@ -1341,7 +1341,7 @@ void qmp_set_link(const char *name, bool up, Error **errp) } } -static void net_vm_change_state_handler (void *opaque,int running, +static void net_vm_change_state_handler (void *opaque,bool running,RunState state) {NetClientState *nc;
softmmu/memory.c +1 -1
@@ -2675,7 +2675,7 @@ static void memory_global_dirty_log_do_stop(void)MEMORY_LISTENER_CALL_GLOBAL (log_global_stop, Reverse); } -static void memory_vm_change_state_handler (void *opaque,int running, +static void memory_vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {
softmmu/runstate.c +1 -1
@@ -316,7 +316,7 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)g_free (e); } -void vm_state_notify (int running,RunState state) +void vm_state_notify (bool running,RunState state) {VMChangeStateEntry *e, *next;
target/arm/kvm.c +1 -1
@@ -844,7 +844,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run)return MEMTXATTRS_UNSPECIFIED ; } -void kvm_arm_vm_state_change (void *opaque,int running,RunState state) +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cs = opaque;ARMCPU *cpu =ARM_CPU (cs);
target/i386/kvm/kvm.c +1 -1
@@ -690,7 +690,7 @@ static int kvm_inject_mce_oldstyle(X86CPU *cpu)return 0 ; } -static void cpu_update_state (void *opaque,int running,RunState state) +static void cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;
target/i386/sev.c +1 -1
@@ -670,7 +670,7 @@ sev_launch_finish(SevGuestState *sev) }static void -sev_vm_state_change (void *opaque,int running,RunState state) +sev_vm_state_change (void *opaque,bool running,RunState state) {SevGuestState *sev = opaque;
target/i386/whpx/whpx-all.c +1 -1
@@ -1318,7 +1318,7 @@ void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu)static Error *whpx_migration_blocker; -static void whpx_cpu_update_state (void *opaque,int running,RunState state) +static void whpx_cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;
target/mips/kvm.c +2 -2
@@ -37,7 +37,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { KVM_CAP_LAST_INFO }; -static void kvm_mips_update_state (void *opaque,int running,RunState state); +static void kvm_mips_update_state (void *opaque,bool running,RunState state);unsigned long kvm_arch_vcpu_id (CPUState *cs) {
@@ -552,7 +552,7 @@ static int kvm_mips_restore_count(CPUState *cs)/* * Handle the VM clock being started or stopped */ -static void kvm_mips_update_state (void *opaque,int running,RunState state) +static void kvm_mips_update_state (void *opaque,bool running,RunState state) {CPUState *cs = opaque;int ret;
ui/gtk.c +1 -1
@@ -672,7 +672,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {/** QEMU Events **/ -static void gd_change_runstate (void *opaque,int running,RunState state) +static void gd_change_runstate (void *opaque,bool running,RunState state) {GtkDisplayState *s = opaque;
ui/spice-core.c +1 -1
@@ -622,7 +622,7 @@ static int add_channel(void *opaque, const char *name, const char *value,return 0 ; } -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {
Signature · 1 line
2.26.2
Quoted 4 lines · Philippe Mathieu-Daudé
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Seems reasonable
Signature · 1 line
Alex Bennée
Quoted 4 lines · Philippe Mathieu-Daudé
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
ppc parts
Quoted 601 lines
--- include/sysemu/runstate.h | 10 ++++++++-- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 2 +- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 49 insertions(+), 43 deletions(-)include/sysemu/runstate.h +8
-2@@ -10,7 +10,7 @@ bool runstate_is_running(void);bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size); -typedef void VMChangeStateHandler (void *opaque,int running,RunState state); +typedef void VMChangeStateHandler (void *opaque,bool running,RunState state);VMChangeStateEntry *qemu_add_vm_change_state_handler (VMChangeStateHandler *cb,void *opaque);@@ -20,7 +20,13 @@ VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev, VMChangeStateHandler *cb, void *opaque);void qemu_del_vm_change_state_handler (VMChangeStateEntry *e); -void vm_state_notify (int running,RunState state); +/** +* vm_state_notify: Notify the state of the VM +* +* @running: whether the VM is running or not. +* @state: the #RunState of the VM. +*/ +void vm_state_notify (bool running,RunState state);static inline bool shutdown_caused_by_guest (ShutdownCause cause) {target/arm/kvm_arm.h +1
-1@@ -352,7 +352,7 @@ void kvm_arm_get_virtual_time(CPUState *cs);*/ void kvm_arm_put_virtual_time (CPUState *cs); -void kvm_arm_vm_state_change (void *opaque,int running,RunState state); +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state);int kvm_arm_vgic_probe (void );target/ppc/cpu-qom.h +1
-1@@ -218,7 +218,7 @@ extern const VMStateDescription vmstate_ppc_timebase; .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state);#endif accel/xen/xen-all.c +1
-1@@ -122,7 +122,7 @@ static void xenstore_record_dm_state(struct xs_handle *xs, const char *state) } -static void xen_change_state_handler (void *opaque,int running, +static void xen_change_state_handler (void *opaque,bool running,RunState state) {if (running) {audio/audio.c +1
-1@@ -1549,7 +1549,7 @@ static int audio_driver_init(AudioState *s, struct audio_driver *drv, } } -static void audio_vm_change_state_handler (void *opaque,int running, +static void audio_vm_change_state_handler (void *opaque,bool running,RunState state) {AudioState *s = opaque;block/block-backend.c +1
-1@@ -163,7 +163,7 @@ static const char *blk_root_get_name(BdrvChild *child)return blk_name (child->opaque); } -static void blk_vm_state_changed (void *opaque,int running,RunState state) +static void blk_vm_state_changed (void *opaque,bool running,RunState state) {Error *local_err =NULL ;BlockBackend *blk = opaque;gdbstub.c +1
-1@@ -2691,7 +2691,7 @@ void gdb_set_stop_cpu(CPUState *cpu) }#ifndef CONFIG_USER_ONLY -static void gdb_vm_state_change (void *opaque,int running,RunState state) +static void gdb_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cpu = gdbserver_state.c_cpu;g_autoptr (GString) buf =g_string_new (NULL );hw/block/pflash_cfi01.c +1
-1@@ -1014,7 +1014,7 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *fl, DriveInfo *dinfo)loc_pop (&loc); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {PFlashCFI01 *pfl = opaque;hw/block/virtio-blk.c +1
-1@@ -870,7 +870,7 @@ static void virtio_blk_dma_restart_bh(void *opaque)virtio_blk_process_queued_requests (s, true); } -static void virtio_blk_dma_restart_cb (void *opaque,int running, +static void virtio_blk_dma_restart_cb (void *opaque,bool running,RunState state) {VirtIOBlock *s = opaque;hw/display/qxl.c +1
-1@@ -1992,7 +1992,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl) } } -static void qxl_vm_change_state_handler (void *opaque,int running, +static void qxl_vm_change_state_handler (void *opaque,bool running,RunState state) {PCIQXLDevice *qxl = opaque;hw/i386/kvm/clock.c +1
-1@@ -162,7 +162,7 @@ static void do_kvmclock_ctrl(CPUState *cpu, run_on_cpu_data data) } } -static void kvmclock_vm_state_change (void *opaque,int running, +static void kvmclock_vm_state_change (void *opaque,bool running,RunState state) {KVMClockState *s = opaque;hw/i386/kvm/i8254.c +1
-1@@ -239,7 +239,7 @@ static void kvm_pit_irq_control(void *opaque, int n, int enable)kvm_pit_put (pit); } -static void kvm_pit_vm_state_change (void *opaque,int running, +static void kvm_pit_vm_state_change (void *opaque,bool running,RunState state) {KVMPITState *s = opaque;hw/i386/kvmvapic.c +1
-1@@ -748,7 +748,7 @@ static void do_vapic_enable(CPUState *cs, run_on_cpu_data data) s->state =VAPIC_ACTIVE ; } -static void kvmvapic_vm_state_change (void *opaque,int running, +static void kvmvapic_vm_state_change (void *opaque,bool running,RunState state) {MachineState *ms =MACHINE (qdev_get_machine ());hw/i386/xen/xen-hvm.c +1
-1@@ -1235,7 +1235,7 @@ static void xen_main_loop_prepare(XenIOState *state) } -static void xen_hvm_change_state_handler (void *opaque,int running, +static void xen_hvm_change_state_handler (void *opaque,bool running,RunState rstate) {XenIOState *state = opaque;hw/ide/core.c +1
-1@@ -2677,7 +2677,7 @@ static void ide_restart_bh(void *opaque) } } -static void ide_restart_cb (void *opaque,int running,RunState state) +static void ide_restart_cb (void *opaque,bool running,RunState state) {IDEBus *bus = opaque;hw/intc/arm_gicv3_its_kvm.c +1
-1@@ -71,7 +71,7 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3ITSState *s = (GICv3ITSState *)opaque;hw/intc/arm_gicv3_kvm.c +1
-1@@ -743,7 +743,7 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] = {* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3State *s = (GICv3State *)opaque;hw/intc/spapr_xive_kvm.c +1
-1@@ -504,7 +504,7 @@ static int kvmppc_xive_get_queues(SpaprXive *xive, Error **errp)* runs again. If an interrupt was queued while the VM was stopped, * simply generate a trigger. */ -static void kvmppc_xive_change_state_handler (void *opaque,int running, +static void kvmppc_xive_change_state_handler (void *opaque,bool running,RunState state) {SpaprXive *xive = opaque;hw/misc/mac_via.c +1
-1@@ -1098,7 +1098,7 @@ static void mac_via_init(Object *obj) TYPE_ADB_BUS, DEVICE(obj), "adb.0"); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {MacVIAState *m =MAC_VIA (opaque);hw/net/e1000e_core.c +1
-1@@ -3298,7 +3298,7 @@ e1000e_autoneg_resume(E1000ECore *core) }static void -e1000e_vm_state_change (void *opaque,int running,RunState state) +e1000e_vm_state_change (void *opaque,bool running,RunState state) {E1000ECore *core = opaque;hw/nvram/spapr_nvram.c +1
-1@@ -217,7 +217,7 @@ static int spapr_nvram_pre_load(void *opaque)return 0 ; } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {SpaprNvram *nvram = opaque;hw/ppc/ppc.c +1
-1@@ -1059,7 +1059,7 @@ static void timebase_load(PPCTimebase *tb) } } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state) {PPCTimebase *tb = opaque;hw/ppc/ppc_booke.c +1
-1@@ -317,7 +317,7 @@ static void ppc_booke_timer_reset_handle(void *opaque)* action will be taken. To avoid this we always clear the watchdog state when * state changes to running. */ -static void cpu_state_change_handler (void *opaque,int running,RunState state) +static void cpu_state_change_handler (void *opaque,bool running,RunState state) {PowerPCCPU *cpu = opaque;CPUPPCState *env = &cpu->env;hw/s390x/tod-kvm.c +1
-1@@ -78,7 +78,7 @@ static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp) } } -static void kvm_s390_tod_vm_state_change (void *opaque,int running, +static void kvm_s390_tod_vm_state_change (void *opaque,bool running,RunState state) {S390TODState *td = opaque;hw/scsi/scsi-bus.c +1
-1@@ -181,7 +181,7 @@ void scsi_req_retry(SCSIRequest *req) req->retry = true; } -static void scsi_dma_restart_cb (void *opaque,int running,RunState state) +static void scsi_dma_restart_cb (void *opaque,bool running,RunState state) {SCSIDevice *s = opaque;hw/usb/hcd-ehci.c +1
-1@@ -2436,7 +2436,7 @@ static int usb_ehci_post_load(void *opaque, int version_id)return 0 ; } -static void usb_ehci_vm_state_change (void *opaque,int running,RunState state) +static void usb_ehci_vm_state_change (void *opaque,bool running,RunState state) {EHCIState *ehci = opaque;hw/usb/host-libusb.c +1
-1@@ -1755,7 +1755,7 @@ type_init(usb_host_register_types)static QEMUTimer *usb_auto_timer;static VMChangeStateEntry *usb_vmstate; -static void usb_host_vm_state (void *unused,int running,RunState state) +static void usb_host_vm_state (void *unused,bool running,RunState state) {if (running) {usb_host_auto_check (unused);hw/usb/redirect.c +1
-1@@ -1395,7 +1395,7 @@ static void usbredir_chardev_event(void *opaque, QEMUChrEvent event)* init + destroy */ -static void usbredir_vm_state_change (void *priv,int running,RunState state) +static void usbredir_vm_state_change (void *priv,bool running,RunState state) {USBRedirDevice *dev = priv;hw/vfio/migration.c +1
-1@@ -727,7 +727,7 @@ static SaveVMHandlers savevm_vfio_handlers = {/* ---------------------------------------------------------------------- */ -static void vfio_vmstate_change (void *opaque,int running,RunState state) +static void vfio_vmstate_change (void *opaque,bool running,RunState state) {VFIODevice *vbasedev = opaque;VFIOMigration *migration = vbasedev->migration;hw/virtio/virtio-rng.c +1
-1@@ -133,7 +133,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t f, Error **errp)return f; } -static void virtio_rng_vm_state_change (void *opaque,int running, +static void virtio_rng_vm_state_change (void *opaque,bool running,RunState state) {VirtIORNG *vrng = opaque;hw/virtio/virtio.c +1
-1@@ -3208,7 +3208,7 @@ void virtio_cleanup(VirtIODevice *vdev)qemu_del_vm_change_state_handler (vdev->vmstate); } -static void virtio_vmstate_change (void *opaque,int running,RunState state) +static void virtio_vmstate_change (void *opaque,bool running,RunState state) {VirtIODevice *vdev = opaque;BusState *qbus =qdev_get_parent_bus (DEVICE (vdev));net/net.c +1
-1@@ -1341,7 +1341,7 @@ void qmp_set_link(const char *name, bool up, Error **errp) } } -static void net_vm_change_state_handler (void *opaque,int running, +static void net_vm_change_state_handler (void *opaque,bool running,RunState state) {NetClientState *nc;softmmu/memory.c +1
-1@@ -2675,7 +2675,7 @@ static void memory_global_dirty_log_do_stop(void)MEMORY_LISTENER_CALL_GLOBAL (log_global_stop, Reverse); } -static void memory_vm_change_state_handler (void *opaque,int running, +static void memory_vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {softmmu/runstate.c +1
-1@@ -316,7 +316,7 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)g_free (e); } -void vm_state_notify (int running,RunState state) +void vm_state_notify (bool running,RunState state) {VMChangeStateEntry *e, *next;target/arm/kvm.c +1
-1@@ -844,7 +844,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run)return MEMTXATTRS_UNSPECIFIED ; } -void kvm_arm_vm_state_change (void *opaque,int running,RunState state) +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cs = opaque;ARMCPU *cpu =ARM_CPU (cs);target/i386/kvm/kvm.c +1
-1@@ -690,7 +690,7 @@ static int kvm_inject_mce_oldstyle(X86CPU *cpu)return 0 ; } -static void cpu_update_state (void *opaque,int running,RunState state) +static void cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;target/i386/sev.c +1
-1@@ -670,7 +670,7 @@ sev_launch_finish(SevGuestState *sev) }static void -sev_vm_state_change (void *opaque,int running,RunState state) +sev_vm_state_change (void *opaque,bool running,RunState state) {SevGuestState *sev = opaque;target/i386/whpx/whpx-all.c +1
-1@@ -1318,7 +1318,7 @@ void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu)static Error *whpx_migration_blocker; -static void whpx_cpu_update_state (void *opaque,int running,RunState state) +static void whpx_cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;target/mips/kvm.c +2
-2@@ -37,7 +37,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { KVM_CAP_LAST_INFO }; -static void kvm_mips_update_state (void *opaque,int running,RunState state); +static void kvm_mips_update_state (void *opaque,bool running,RunState state);unsigned long kvm_arch_vcpu_id (CPUState *cs) {@@ -552,7 +552,7 @@ static int kvm_mips_restore_count(CPUState *cs)/* * Handle the VM clock being started or stopped */ -static void kvm_mips_update_state (void *opaque,int running,RunState state) +static void kvm_mips_update_state (void *opaque,bool running,RunState state) {CPUState *cs = opaque;int ret;ui/gtk.c +1
-1@@ -672,7 +672,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {/** QEMU Events **/ -static void gd_change_runstate (void *opaque,int running,RunState state) +static void gd_change_runstate (void *opaque,bool running,RunState state) {GtkDisplayState *s = opaque;ui/spice-core.c +1
-1@@ -622,7 +622,7 @@ static int add_channel(void *opaque, const char *name, const char *value,return 0 ; } -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Laurent Vivier
AppliedLe 11/01/2021 à 16:20, Philippe Mathieu-Daudé a écrit :
Quoted 598 lines
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/sysemu/runstate.h | 10 ++++++++-- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 2 +- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 49 insertions(+), 43 deletions(-)include/sysemu/runstate.h +8
-2@@ -10,7 +10,7 @@ bool runstate_is_running(void);bool runstate_needs_reset (void );bool runstate_store (char *str,size_t size); -typedef void VMChangeStateHandler (void *opaque,int running,RunState state); +typedef void VMChangeStateHandler (void *opaque,bool running,RunState state);VMChangeStateEntry *qemu_add_vm_change_state_handler (VMChangeStateHandler *cb,void *opaque);@@ -20,7 +20,13 @@ VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev, VMChangeStateHandler *cb, void *opaque);void qemu_del_vm_change_state_handler (VMChangeStateEntry *e); -void vm_state_notify (int running,RunState state); +/** +* vm_state_notify: Notify the state of the VM +* +* @running: whether the VM is running or not. +* @state: the #RunState of the VM. +*/ +void vm_state_notify (bool running,RunState state);static inline bool shutdown_caused_by_guest (ShutdownCause cause) {target/arm/kvm_arm.h +1
-1@@ -352,7 +352,7 @@ void kvm_arm_get_virtual_time(CPUState *cs);*/ void kvm_arm_put_virtual_time (CPUState *cs); -void kvm_arm_vm_state_change (void *opaque,int running,RunState state); +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state);int kvm_arm_vgic_probe (void );target/ppc/cpu-qom.h +1
-1@@ -218,7 +218,7 @@ extern const VMStateDescription vmstate_ppc_timebase; .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state);#endif accel/xen/xen-all.c +1
-1@@ -122,7 +122,7 @@ static void xenstore_record_dm_state(struct xs_handle *xs, const char *state) } -static void xen_change_state_handler (void *opaque,int running, +static void xen_change_state_handler (void *opaque,bool running,RunState state) {if (running) {audio/audio.c +1
-1@@ -1549,7 +1549,7 @@ static int audio_driver_init(AudioState *s, struct audio_driver *drv, } } -static void audio_vm_change_state_handler (void *opaque,int running, +static void audio_vm_change_state_handler (void *opaque,bool running,RunState state) {AudioState *s = opaque;block/block-backend.c +1
-1@@ -163,7 +163,7 @@ static const char *blk_root_get_name(BdrvChild *child)return blk_name (child->opaque); } -static void blk_vm_state_changed (void *opaque,int running,RunState state) +static void blk_vm_state_changed (void *opaque,bool running,RunState state) {Error *local_err =NULL ;BlockBackend *blk = opaque;gdbstub.c +1
-1@@ -2691,7 +2691,7 @@ void gdb_set_stop_cpu(CPUState *cpu) }#ifndef CONFIG_USER_ONLY -static void gdb_vm_state_change (void *opaque,int running,RunState state) +static void gdb_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cpu = gdbserver_state.c_cpu;g_autoptr (GString) buf =g_string_new (NULL );hw/block/pflash_cfi01.c +1
-1@@ -1014,7 +1014,7 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *fl, DriveInfo *dinfo)loc_pop (&loc); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {PFlashCFI01 *pfl = opaque;hw/block/virtio-blk.c +1
-1@@ -870,7 +870,7 @@ static void virtio_blk_dma_restart_bh(void *opaque)virtio_blk_process_queued_requests (s, true); } -static void virtio_blk_dma_restart_cb (void *opaque,int running, +static void virtio_blk_dma_restart_cb (void *opaque,bool running,RunState state) {VirtIOBlock *s = opaque;hw/display/qxl.c +1
-1@@ -1992,7 +1992,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl) } } -static void qxl_vm_change_state_handler (void *opaque,int running, +static void qxl_vm_change_state_handler (void *opaque,bool running,RunState state) {PCIQXLDevice *qxl = opaque;hw/i386/kvm/clock.c +1
-1@@ -162,7 +162,7 @@ static void do_kvmclock_ctrl(CPUState *cpu, run_on_cpu_data data) } } -static void kvmclock_vm_state_change (void *opaque,int running, +static void kvmclock_vm_state_change (void *opaque,bool running,RunState state) {KVMClockState *s = opaque;hw/i386/kvm/i8254.c +1
-1@@ -239,7 +239,7 @@ static void kvm_pit_irq_control(void *opaque, int n, int enable)kvm_pit_put (pit); } -static void kvm_pit_vm_state_change (void *opaque,int running, +static void kvm_pit_vm_state_change (void *opaque,bool running,RunState state) {KVMPITState *s = opaque;hw/i386/kvmvapic.c +1
-1@@ -748,7 +748,7 @@ static void do_vapic_enable(CPUState *cs, run_on_cpu_data data) s->state =VAPIC_ACTIVE ; } -static void kvmvapic_vm_state_change (void *opaque,int running, +static void kvmvapic_vm_state_change (void *opaque,bool running,RunState state) {MachineState *ms =MACHINE (qdev_get_machine ());hw/i386/xen/xen-hvm.c +1
-1@@ -1235,7 +1235,7 @@ static void xen_main_loop_prepare(XenIOState *state) } -static void xen_hvm_change_state_handler (void *opaque,int running, +static void xen_hvm_change_state_handler (void *opaque,bool running,RunState rstate) {XenIOState *state = opaque;hw/ide/core.c +1
-1@@ -2677,7 +2677,7 @@ static void ide_restart_bh(void *opaque) } } -static void ide_restart_cb (void *opaque,int running,RunState state) +static void ide_restart_cb (void *opaque,bool running,RunState state) {IDEBus *bus = opaque;hw/intc/arm_gicv3_its_kvm.c +1
-1@@ -71,7 +71,7 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3ITSState *s = (GICv3ITSState *)opaque;hw/intc/arm_gicv3_kvm.c +1
-1@@ -743,7 +743,7 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] = {* * The tables get flushed to guest RAM whenever the VM gets stopped. */ -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {GICv3State *s = (GICv3State *)opaque;hw/intc/spapr_xive_kvm.c +1
-1@@ -504,7 +504,7 @@ static int kvmppc_xive_get_queues(SpaprXive *xive, Error **errp)* runs again. If an interrupt was queued while the VM was stopped, * simply generate a trigger. */ -static void kvmppc_xive_change_state_handler (void *opaque,int running, +static void kvmppc_xive_change_state_handler (void *opaque,bool running,RunState state) {SpaprXive *xive = opaque;hw/misc/mac_via.c +1
-1@@ -1098,7 +1098,7 @@ static void mac_via_init(Object *obj) TYPE_ADB_BUS, DEVICE(obj), "adb.0"); } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {MacVIAState *m =MAC_VIA (opaque);hw/net/e1000e_core.c +1
-1@@ -3298,7 +3298,7 @@ e1000e_autoneg_resume(E1000ECore *core) }static void -e1000e_vm_state_change (void *opaque,int running,RunState state) +e1000e_vm_state_change (void *opaque,bool running,RunState state) {E1000ECore *core = opaque;hw/nvram/spapr_nvram.c +1
-1@@ -217,7 +217,7 @@ static int spapr_nvram_pre_load(void *opaque)return 0 ; } -static void postload_update_cb (void *opaque,int running,RunState state) +static void postload_update_cb (void *opaque,bool running,RunState state) {SpaprNvram *nvram = opaque;hw/ppc/ppc.c +1
-1@@ -1059,7 +1059,7 @@ static void timebase_load(PPCTimebase *tb) } } -void cpu_ppc_clock_vm_state_change (void *opaque,int running, +void cpu_ppc_clock_vm_state_change (void *opaque,bool running,RunState state) {PPCTimebase *tb = opaque;hw/ppc/ppc_booke.c +1
-1@@ -317,7 +317,7 @@ static void ppc_booke_timer_reset_handle(void *opaque)* action will be taken. To avoid this we always clear the watchdog state when * state changes to running. */ -static void cpu_state_change_handler (void *opaque,int running,RunState state) +static void cpu_state_change_handler (void *opaque,bool running,RunState state) {PowerPCCPU *cpu = opaque;CPUPPCState *env = &cpu->env;hw/s390x/tod-kvm.c +1
-1@@ -78,7 +78,7 @@ static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp) } } -static void kvm_s390_tod_vm_state_change (void *opaque,int running, +static void kvm_s390_tod_vm_state_change (void *opaque,bool running,RunState state) {S390TODState *td = opaque;hw/scsi/scsi-bus.c +1
-1@@ -181,7 +181,7 @@ void scsi_req_retry(SCSIRequest *req) req->retry = true; } -static void scsi_dma_restart_cb (void *opaque,int running,RunState state) +static void scsi_dma_restart_cb (void *opaque,bool running,RunState state) {SCSIDevice *s = opaque;hw/usb/hcd-ehci.c +1
-1@@ -2436,7 +2436,7 @@ static int usb_ehci_post_load(void *opaque, int version_id)return 0 ; } -static void usb_ehci_vm_state_change (void *opaque,int running,RunState state) +static void usb_ehci_vm_state_change (void *opaque,bool running,RunState state) {EHCIState *ehci = opaque;hw/usb/host-libusb.c +1
-1@@ -1755,7 +1755,7 @@ type_init(usb_host_register_types)static QEMUTimer *usb_auto_timer;static VMChangeStateEntry *usb_vmstate; -static void usb_host_vm_state (void *unused,int running,RunState state) +static void usb_host_vm_state (void *unused,bool running,RunState state) {if (running) {usb_host_auto_check (unused);hw/usb/redirect.c +1
-1@@ -1395,7 +1395,7 @@ static void usbredir_chardev_event(void *opaque, QEMUChrEvent event)* init + destroy */ -static void usbredir_vm_state_change (void *priv,int running,RunState state) +static void usbredir_vm_state_change (void *priv,bool running,RunState state) {USBRedirDevice *dev = priv;hw/vfio/migration.c +1
-1@@ -727,7 +727,7 @@ static SaveVMHandlers savevm_vfio_handlers = {/* ---------------------------------------------------------------------- */ -static void vfio_vmstate_change (void *opaque,int running,RunState state) +static void vfio_vmstate_change (void *opaque,bool running,RunState state) {VFIODevice *vbasedev = opaque;VFIOMigration *migration = vbasedev->migration;hw/virtio/virtio-rng.c +1
-1@@ -133,7 +133,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t f, Error **errp)return f; } -static void virtio_rng_vm_state_change (void *opaque,int running, +static void virtio_rng_vm_state_change (void *opaque,bool running,RunState state) {VirtIORNG *vrng = opaque;hw/virtio/virtio.c +1
-1@@ -3208,7 +3208,7 @@ void virtio_cleanup(VirtIODevice *vdev)qemu_del_vm_change_state_handler (vdev->vmstate); } -static void virtio_vmstate_change (void *opaque,int running,RunState state) +static void virtio_vmstate_change (void *opaque,bool running,RunState state) {VirtIODevice *vdev = opaque;BusState *qbus =qdev_get_parent_bus (DEVICE (vdev));net/net.c +1
-1@@ -1341,7 +1341,7 @@ void qmp_set_link(const char *name, bool up, Error **errp) } } -static void net_vm_change_state_handler (void *opaque,int running, +static void net_vm_change_state_handler (void *opaque,bool running,RunState state) {NetClientState *nc;softmmu/memory.c +1
-1@@ -2675,7 +2675,7 @@ static void memory_global_dirty_log_do_stop(void)MEMORY_LISTENER_CALL_GLOBAL (log_global_stop, Reverse); } -static void memory_vm_change_state_handler (void *opaque,int running, +static void memory_vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {softmmu/runstate.c +1
-1@@ -316,7 +316,7 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)g_free (e); } -void vm_state_notify (int running,RunState state) +void vm_state_notify (bool running,RunState state) {VMChangeStateEntry *e, *next;target/arm/kvm.c +1
-1@@ -844,7 +844,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run)return MEMTXATTRS_UNSPECIFIED ; } -void kvm_arm_vm_state_change (void *opaque,int running,RunState state) +void kvm_arm_vm_state_change (void *opaque,bool running,RunState state) {CPUState *cs = opaque;ARMCPU *cpu =ARM_CPU (cs);target/i386/kvm/kvm.c +1
-1@@ -690,7 +690,7 @@ static int kvm_inject_mce_oldstyle(X86CPU *cpu)return 0 ; } -static void cpu_update_state (void *opaque,int running,RunState state) +static void cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;target/i386/sev.c +1
-1@@ -670,7 +670,7 @@ sev_launch_finish(SevGuestState *sev) }static void -sev_vm_state_change (void *opaque,int running,RunState state) +sev_vm_state_change (void *opaque,bool running,RunState state) {SevGuestState *sev = opaque;target/i386/whpx/whpx-all.c +1
-1@@ -1318,7 +1318,7 @@ void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu)static Error *whpx_migration_blocker; -static void whpx_cpu_update_state (void *opaque,int running,RunState state) +static void whpx_cpu_update_state (void *opaque,bool running,RunState state) {CPUX86State *env = opaque;target/mips/kvm.c +2
-2@@ -37,7 +37,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { KVM_CAP_LAST_INFO }; -static void kvm_mips_update_state (void *opaque,int running,RunState state); +static void kvm_mips_update_state (void *opaque,bool running,RunState state);unsigned long kvm_arch_vcpu_id (CPUState *cs) {@@ -552,7 +552,7 @@ static int kvm_mips_restore_count(CPUState *cs)/* * Handle the VM clock being started or stopped */ -static void kvm_mips_update_state (void *opaque,int running,RunState state) +static void kvm_mips_update_state (void *opaque,bool running,RunState state) {CPUState *cs = opaque;int ret;ui/gtk.c +1
-1@@ -672,7 +672,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {/** QEMU Events **/ -static void gd_change_runstate (void *opaque,int running,RunState state) +static void gd_change_runstate (void *opaque,bool running,RunState state) {GtkDisplayState *s = opaque;ui/spice-core.c +0
-0
ui/spice-core.c static int add_channel(void *opaque, const char *name, const char *value, · line 628
Quoted 8 lines
ui/spice-core.c +1
-1@@ -622,7 +622,7 @@ static int add_channel(void *opaque, const char *name, const char *value,return 0 ; } -static void vm_change_state_handler (void *opaque,int running, +static void vm_change_state_handler (void *opaque,bool running,RunState state) {if (running) {
Applied to my trivial-patches branch.
Thanks,
Laurent
Quoted 44 lines · Philippe Mathieu-Daudé
Trivial prototype change to clarify the use of the 'running' argument of VMChangeStateHandler.
Green CI:
https://gitlab.com/philmd/qemu/-/pipelines/239497352Philippe Mathieu-Daudé (2):
sysemu/runstate: Letrunstate_is_running()return bool
sysemu: Let VMChangeStateHandler take boolean 'running' argumentinclude/sysemu/runstate.h | 12 +++++++++--- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 4 ++--
Quoted 13 lines
target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 51 insertions(+), 45 deletions(-)Signature · 1 line
2.26.2
Paolo, this series is fully reviewed, can it go via your misc tree?
Quoted 53 lines · Philippe Mathieu-Daudé
Trivial prototype change to clarify the use of the 'running' argument of VMChangeStateHandler.
Green CI:
https://gitlab.com/philmd/qemu/-/pipelines/239497352Philippe Mathieu-Daudé (2):
sysemu/runstate: Letrunstate_is_running()return bool
sysemu: Let VMChangeStateHandler take boolean 'running' argumentinclude/sysemu/runstate.h | 12 +++++++++--- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 4 ++-- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 51 insertions(+), 45 deletions(-)
ping, qemu-trivial maybe?
Quoted 58 lines · Philippe Mathieu-Daudé
Paolo, this series is fully reviewed, can it go via your misc tree?
Quoted 53 lines · Philippe Mathieu-Daudé
Trivial prototype change to clarify the use of the 'running' argument of VMChangeStateHandler.
Green CI:
https://gitlab.com/philmd/qemu/-/pipelines/239497352Philippe Mathieu-Daudé (2):
sysemu/runstate: Letrunstate_is_running()return bool
sysemu: Let VMChangeStateHandler take boolean 'running' argumentinclude/sysemu/runstate.h | 12 +++++++++--- target/arm/kvm_arm.h | 2 +- target/ppc/cpu-qom.h | 2 +- accel/xen/xen-all.c | 2 +- audio/audio.c | 2 +- block/block-backend.c | 2 +- gdbstub.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/display/qxl.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvmvapic.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/ide/core.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/intc/spapr_xive_kvm.c | 2 +- hw/misc/mac_via.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc_booke.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- net/net.c | 2 +- softmmu/memory.c | 2 +- softmmu/runstate.c | 4 ++-- target/arm/kvm.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/mips/kvm.c | 4 ++-- ui/gtk.c | 2 +- ui/spice-core.c | 2 +- 41 files changed, 51 insertions(+), 45 deletions(-)