Peter Krempa wrote:
On Fri, Jul 31, 2026 at 19:52:03 +0200, Roman Bogorodskiy wrote:
bhyve supports passing disk serial number using the "ser=<SN>" option, so update bhyveBuildAHCIControllerArgStr() to set it from the "serial" element.
Closes: https://gitlab.com/libvirt/libvirt/-/work_items/901 Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 3 +++ .../x86_64/bhyvexml2argv-sata-rotation-rate.args | 2 +- .../x86_64/bhyvexml2argv-sata-rotation-rate.xml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index a4f9c8823b..f0c3cf03c5 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -333,6 +333,9 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, if (disk->rotation_rate) virBufferAsprintf(&device, ",nmrr=%u", disk->rotation_rate);
+ if (disk->serial) + virBufferAsprintf(&device, ",ser=%s", disk->serial);
Note that libvirt doesn't enforce any length limits for 'serial' value.
In qemu it gets silently truncated to the size that qemu supports (which may or may not conform to the "physical"/protocol specification limits.
We had trouble with that in the past when qemu changed the truncation.
How does bhyve behave here?
Bhyve mentions 20 character limits for both AHCI and NVMe. It also silently truncates the user provided value to this 20 char limit. It does not _seem_ that this limit is going to change for AHCI and NVMe.