diff --git a/kvm-all.c b/kvm-all.c index 42e5e23d5d9d5cd2a6d5ecdd90c7a980d744179c..ba2cee10f2dfd4441a792603ad4cb035574e20ff 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -79,7 +79,10 @@ struct KVMState int pit_state2; int xsave, xcrs; int many_ioeventfds; - int irqchip_inject_ioctl; + /* The man page (and posix) say ioctl numbers are signed int, but + * they're not. Linux, glibc and *BSD all treat ioctl numbers as + * unsigned, and treating them as signed here can break things */ + unsigned irqchip_inject_ioctl; #ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing *irq_routes; int nr_allocated_irq_routes;