-
Notifications
You must be signed in to change notification settings - Fork 18
acrn: initial libvirt/ACRN import #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acrn: initial libvirt/ACRN import #30
Conversation
|
Thank you for your interest in the libvirt project. Since this repository is a read-only mirror of the project's master We kindly request that contributors fork the project at https://gitlab.com/libvirt/libvirt/ push changes to the fork, and then open a new merge request at https://gitlab.com/libvirt/libvirt/-/merge_requests/new Thank you for your time and understanding. |
|
Port the dev-acrn-v6.1.0 branch from the following commit to dev-acrn-v10.0.0: commit e142344 Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Currently, only cputime is required by the orchestrators. Report fake cputime since this is currently unsupported by the hypervisor. Signed-off-by: Peter Fang <peter.fang@intel.com>
Update acrnConnectDriver for the remote driver to respond correctly to "acrn:///system" and not hijack it. Additionally, add implementation for connectURIProbe and update acrnConnectOpen to comply with the current behavior of virConnectOpenInternal. Signed-off-by: Peter Fang <peter.fang@intel.com>
Libvirtd will eventually be phased out, so add support for virtacrnd systemd services. Signed-off-by: Peter Fang <peter.fang@intel.com>
Return approproiate error codes in acrnGetPlatform to be able to handle the errors differently on caller's side. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
Return appropriate error codes in acrnInitPlatform to be able to handle the errors differently on caller's side. In particular propagate error code when possible. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
To be able to run libvirt on any system we must not fail if there is no ARCN hypervisor available. Simply skip initialization with proper cleanup but without failure in this case. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
RTVM support is added using XML namespace "acrn": - <acrn:config>: indicate RTVM via <acrn:rtvm/> - <acrn:commandline>: miscellaneous supporting command-line args via <acrn:arg value='x'/> Signed-off-by: Peter Fang <peter.fang@intel.com>
Signed-off-by: Peter Fang <peter.fang@intel.com>
Since rtvm property lives in ACRN specific namespace data which is stored as opaque namespaceData pointer in the domain definition, it always can be derived from the actual domain definition. Provide an accessor to the rtvm property via domain definition and use it wherever possible. Furthermore use this acrnAllocateVm() which already uses the domain definition and thus can access the rtvm property without the need to pass it as parameter. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
Starting a predefined ACRN VM fails: root@nuc7i7dnh:~# virsh list --all Id Name State -------------------------------- - DebianBuster0 shut off root@nuc7i7dnh:~# virsh start DebianBuster0 error: Failed to start domain DebianBuster0 error: internal error: vm(00000000-0000-0000-0000-000000000000) not found The libvirtd log shows libvirtd: 1623: error : acrnDomainCreateWithFlags:1619 : internal error: vm(00000000-0000-0000-0000-000000000000) not found Fix this by allocating a VM for each predefined ACRN domain in acrnStateInitialize(). Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
Since the ACRN vm list has to be obtained in acrnStateInitialize() for iterating through all domains, reuse this list for acrnInitPlatform() to avoid unnecessary duplicate read of ACRN platform data during initialization. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
Allow an XML file to configure the MTU size of a tap device. This is required to properly support VXLAN in OpenStack. Signed-off-by: Peter Fang <peter.fang@intel.com>
Update platform information data sturcture since it is updated in the kernel v5.10. Update offline cpu path since it since it changes to /sys/devices/virtual/misc/acrn_hsm/remove_cpu for kernel v5.10. Tracked-On: projectacrn/acrn-hypervisor#6564 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
To support guest domain auto-start, the guest domain should be persistent. In the current ACRN driver, user can't get persistent status of a guest domain since related call back is not implemented in the ACRN driver. There is a bug about persistent domain initialization since acrnPersistentDomainInit is invoked for any guest domain. In this patch, add a call back to check guest persistent state, and make acrnPersistentDomainInit only to initialize persistent guest domain. Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Enable and disable the automatic starting of a guest domain when the libvirt daemon starts. Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Currently, acrn driver uses GET_PLATFORM_INFO ioctl in ACRN to get VM configuration, then calculate cpu affinity and UUID for user VM. GET_PLATFORM_INFO ioctl will be not supported in ACRN v2.7, this patch will refine calculation logic of cpu affinity and UUID. The following changes are made: - Get cpu affiniity from cpuset in XML file directly. - Get UUID from XML file directly. - Remove get platform information related code and vm list code. Todo: will refine vcpu allocation logic to support vcpu allocation when users only specify cpu number in XML file. Will add some checks for RTVM since this VM needs exclusive vcpu. Tracked-On: projectacrn/acrn-hypervisor#6724 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
UUID parameter of acrn-dm will be removed in ACRN v2.7, so don't need to pass UUID to acrn-dm. Tracked-On: projectacrn/acrn-hypervisor#6685 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Currently, in acrnOfflineCpus, only one charater is used to store CPU ID of the processor which will be offlined, if the CPU ID of a processor is more than 9, acrn driver will fail to offline this procesor. In this patch, use four charaters to store CPU ID, can support CPU ID (0 ~ 999). Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Command parameter -A is used to make ACRN DM generate a ACPI table for a user VM. Currently, Command parameter -A have been removed in ACRN DM, ACRN DM generates ACPI table automatically, acrn-driver in Libvirt doesn't need to generate this parameter for user VM. Tracked-On: projectacrn#17 Reviewed-by: Xiangyang Wu <xiangyang.wu@intel.com> Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
The following updates are made in this patch to support vm desroy: - Create socket folder for acrn DM command monitor; - Pass socket path to DM through command arguments; - Implement a monitor to interact with DM command monitor; - Implement event loop to watch DM command monitor socket events, such as read event, disconnect event to receive reply and sync user VM state with acrn DM. Tracked-On: #5921 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
The following updates are maded to support shutdown user VM gracefully: - Implement a acrn manager to interact with ACRN lifecycle manager. - Send user_vm_shutdown command to ACRN lifecycle manager to shutdown a specified user VM. Tracked-On: #5921 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
The follwing updates are made to support user VM reboot: - Implement acrnDomainReboot in acrn driver; - Send user_vm_reboot command to ACRN lifecycle manager. Tracked-On: #5921 Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
CPU affinity support is added using XML namespace "acrn": - <acrn:config>: indicate CPU affinity via <acrn:cpu_affinity value='0,2,...'/> The value of CPU affinity should be target pCPU's local APIC id. The 'cpuset' attribute of CPU allocation will be invalid but will not report warning. Tracked-On: projectacrn#19 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
For acrn-dm enable `lapic_pt` automatically for rtvm for better performance and reserve `--lapic_pt` for future use, translate `<acrn:rtvm/>` to `--rtvm` instead of `--lapic_pt`. Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Add cpu_affinity to check list when parse acrn name space. Tracked-On: projectacrn#19 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Analysis '/proc/cpuinfo' and create a mapping between processor and apicid before offline CPUs. When libvit allocate cpus for VM, this map can be used to generate '--cpu_affinity' parameter. Tracked-On: projectacrn#19 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
If a VM only set the max CPU number and not set the CPUs to use, this patch will allocate vCPUs to the VM. The CPUs that have been used the least times will be select. The selection will start from the last CPU. Tracked-On: projectacrn#19 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
vCPU allocated by `acrn:cpu_affinity` is delivered to acrn-dm directly, and vCPU preparation processs is bypassed. So add vCPU info which used to record durring vCPU preparation in this patch: 1. Set vCPU online state of the util configuration (struct virDomainDef). 2. Add the vCPU to allocMap. Tracked-On: projectacrn#19 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Modify ethernet parameter to keep consistent with acrn-dm. Tracked-On: projectacrn#24 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Offline CPUs in Service VM before offlining them in ACRN Hypervisor. Tracked-On: projectacrn#26 Signed-off-by: Fei Li <fei1.li@intel.com>
9240880 to
d937d42
Compare
chejianj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch resolved the compilation issues with Meson and Ninja Signed-off-by: Chenli Wei <chenli.wei@intel.com>
chejianj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Port the dev-acrn-v6.1.0 branch from the following commit to dev-acrn-v10.0.0:
commit 666d8e6