Avi, This is the updated patch for libkvm part to adapt get/set irqchip ioctls.
Thanks, Qing kvm: libkvm: in-kernel irqchip get/set ioctls This patch allows save and restore of in-kernel irqchips Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]> Signed-off-by: Qing He <[EMAIL PROTECTED]> ---- kvmctl.c | 24 ++++++++++++++++++++++++ kvmctl.h | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/user/kvmctl.c b/user/kvmctl.c index 50f5021..51d1fc8 100644 --- a/user/kvmctl.c +++ b/user/kvmctl.c @@ -432,6 +432,30 @@ int kvm_set_irq_level(kvm_context_t kvm, int irq, int level) return 1; } +int kvm_get_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip) +{ + int r; + + if (!kvm->irqchip_in_kernel) + return 0; + r = ioctl(kvm->vm_fd, KVM_GET_IRQCHIP, chip); + if (r == -1) + perror("kvm_get_irqchip\n"); + return 1; +} + +int kvm_set_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip) +{ + int r; + + if (!kvm->irqchip_in_kernel) + return 0; + r = ioctl(kvm->vm_fd, KVM_SET_IRQCHIP, chip); + if (r == -1) + perror("kvm_set_irqchip\n"); + return 1; +} + static int handle_io_abi10(kvm_context_t kvm, struct kvm_run_abi10 *run, int vcpu) { diff --git a/user/kvmctl.h b/user/kvmctl.h index 0c65f4e..e3e3ebf 100644 --- a/user/kvmctl.h +++ b/user/kvmctl.h @@ -421,4 +421,27 @@ int kvm_dirty_pages_log_reset(kvm_context_t kvm); */ int kvm_irqchip_in_kernel(kvm_context_t kvm); +/*! + * \brief Dump in kernel IRQCHIP contents + * + * Dump one of the in kernel irq chip devices, including PIC (master/slave) + * and IOAPIC into a kvm_irqchip structure + * + * \param kvm Pointer to the current kvm_context + * \param chip The irq chip device to be dumped + */ +int kvm_get_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip); + +/*! + * \brief Set in kernel IRQCHIP contents + * + * Write one of the in kernel irq chip devices, including PIC (master/slave) + * and IOAPIC + * + * + * \param kvm Pointer to the current kvm_context + * \param chip THe irq chip device to be written + */ +int kvm_set_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip); + #endif
kvm-live-pic-libkvm.patch
Description: kvm-live-pic-libkvm.patch
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel