Revision ca821806 kvm-all.c

b/kvm-all.c
1151 1151

  
1152 1152
    return r;
1153 1153
}
1154

  
1155
#ifdef KVM_IOEVENTFD
1156
int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)
1157
{
1158
    struct kvm_ioeventfd kick = {
1159
        .datamatch = val,
1160
        .addr = addr,
1161
        .len = 2,
1162
        .flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,
1163
        .fd = fd,
1164
    };
1165
    int r;
1166
    if (!kvm_enabled())
1167
        return -ENOSYS;
1168
    if (!assign)
1169
        kick.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;
1170
    r = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick);
1171
    if (r < 0)
1172
        return r;
1173
    return 0;
1174
}
1175
#endif

Also available in: Unified diff