Skip to content

Conversation

@weichenli-intel
Copy link

Port the dev-acrn-v6.1.0 branch from the following commit to dev-acrn-v10.0.0:

commit 666d8e6

@github-actions
Copy link

Thank you for your interest in the libvirt project.

Since this repository is a read-only mirror of the project's master
repostory hosted on GitLab, merge requests opened here are not
processed.

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.

@github-actions github-actions bot closed this Jul 24, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2025
@NanlinXie NanlinXie reopened this Jul 25, 2025
@NanlinXie NanlinXie requested a review from chejianj July 25, 2025 02:19
@chejianj
Copy link

chejianj commented Jul 28, 2025

  1. The latest version/tag of upstream libvirt is v11.5.0. Is there any special reason that we just rebase to v10.0.0?
  2. Is this PR just to rebase the original commits for ACRN from v6.1.0 to v10.0.0? If so, why not keep the original commit history?

Chenli Wei and others added 24 commits July 29, 2025 14:14
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 <[email protected]>
Currently, only cputime is required by the orchestrators.

Report fake cputime since this is currently unsupported by the
hypervisor.

Signed-off-by: Peter Fang <[email protected]>
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 <[email protected]>
Libvirtd will eventually be phased out, so add support for virtacrnd
systemd services.

Signed-off-by: Peter Fang <[email protected]>
Return approproiate error codes in acrnGetPlatform to be able to handle
the errors differently on caller's side.

Signed-off-by: Helmut Buchsbaum <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Peter Fang <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Enable and disable the automatic starting of
a guest domain when the libvirt daemon starts.

Signed-off-by: Xiangyang Wu <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Yuanyuan Zhao <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Yuanyuan Zhao and others added 7 commits July 29, 2025 14:34
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 <[email protected]>
Add cpu_affinity to check list when parse acrn name space.

Tracked-On: projectacrn#19
Signed-off-by: Yuanyuan Zhao <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Modify ethernet parameter to keep consistent with acrn-dm.

Tracked-On: projectacrn#24
Signed-off-by: Yuanyuan Zhao <[email protected]>
Offline CPUs in Service VM before offlining them in ACRN Hypervisor.

Tracked-On: projectacrn#26
Signed-off-by: Fei Li <[email protected]>
Copy link

@chejianj chejianj left a 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 <[email protected]>
Copy link

@chejianj chejianj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NanlinXie NanlinXie merged commit c5f80a1 into projectacrn:dev-acrn-v10.0.0 Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants