do {
int ret;
- if (kvm->cfg.active_console == CONSOLE_HV)
+ if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
ret = term_putc_iov(&iov, 1, 0);
else
ret = 0;
union hv_chario data;
struct iovec iov;
- if (kvm->cfg.active_console != CONSOLE_HV)
+ if (vcpu->kvm->cfg.active_console != CONSOLE_HV)
return H_SUCCESS;
if (term_readable(0)) {
iov.iov_base = data.buf;
iov.iov_len = 16;
- *len = term_getc_iov(&iov, 1, 0);
+ *len = term_getc_iov(vcpu->kvm, &iov, 1, 0);
*char0_7 = be64_to_cpu(data.a.char0_7);
*char8_15 = be64_to_cpu(data.a.char8_15);
} else {
uint32_t nret, target_ulong rets)
{
char c = rtas_ld(vcpu->kvm, args, 0);
- term_putc(CONSOLE_HV, &c, 1, 0);
+ term_putc(&c, 1, 0);
rtas_st(vcpu->kvm, rets, 0, 0);
}
uint32_t nret, target_ulong rets)
{
char c = rtas_ld(vcpu->kvm, args, 0);
- term_putc(CONSOLE_HV, &c, 1, 0);
+
+ if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
+ term_putc(&c, 1, 0);
+
rtas_st(vcpu->kvm, rets, 0, 0);
}
uint32_t nret, target_ulong rets)
{
int c;
- if (term_readable(CONSOLE_HV, 0) &&
- (c = term_getc(CONSOLE_HV, 0)) >= 0) {
+
+ if (vcpu->kvm->cfg.active_console == CONSOLE_HV && term_readable(0) &&
+ (c = term_getc(vcpu->kvm, 0)) >= 0) {
rtas_st(vcpu->kvm, rets, 0, 0);
rtas_st(vcpu->kvm, rets, 1, c);
} else {
rtas_st(vcpu->kvm, rets, 0, -3);
return;
}
- kvm_cpu__reboot();
+ kvm_cpu__reboot(vcpu->kvm);
}
static void rtas_query_cpu_stopped_state(struct kvm_cpu *vcpu,