-
Bug
-
Resolution: Done-Errata
-
Minor
-
rhel-9.4
-
libvirt-10.0.0-1.el9
-
None
-
Low
-
rhel-sst-virtualization
-
ssg_virtualization
-
26
-
None
-
QE ack, Dev ack
-
False
-
-
None
-
None
-
Pass
-
Automated
-
-
Unspecified
-
10.0.0
-
None
What were you trying to do that didn't work?
I set a customized source path for guest agent, and found it get ignored by libvirt.
Please provide the package NVR for which bug is seen:
libvirt-9.10.0-1.el9.x86_64
How reproducible:
100%
Steps to reproduce
- Define a vm with customized source path for guest agent
<channel type="unix"> <source mode="bind" path="/40-a/org.qemu.guest_agent.0"/> <target type="virtio" name="org.qemu.guest_agent.0"/> </channel>
- Check vm dumpxml
# virsh dumpxml vm2 --xpath //channel <channel type="unix"> <target type="virtio" name="org.qemu.guest_agent.0"/> <address type="virtio-serial" controller="0" bus="0" port="1"/> </channel>
- Try other paths:
1) /tmp/40-aa/org.qemu.guest_agent.0 ==> ignored by libvirt
2) /tmp/libvirt/qemu/channel/40-aa/org.qemu.guest_agent.0 ==> ignored by libvirt
3) /tmp/org.qemu.guest_agent.0 ==> not ignored by libvirt
4) /run/libvirt/qemu/channel/2-vm2/org.qemu.guest_agent.0 ==> ignored by libvirt, expected
Expected results
The following path won't be ignored by libvirt:
/40-a/org.qemu.guest_agent.0
/tmp/40-aa/org.qemu.guest_agent.0
/tmp/libvirt/qemu/channel/40-aa/org.qemu.guest_agent.0
/tmp/org.qemu.guest_agent.0 (this one has got expected result)
Actual results
As above.
Additional info
I had a try on https://regex101.com/, I think this can be fixed by adding a "(" and ")" in the pattern.
5438 static bool 5439 qemuDomainChrMatchDefaultPath(const char *prefix, 5440 const char *infix, 5441 const char *target, 5442 const char *path) 5443 { 5444 g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; 5445 g_autofree char *regexp = NULL; 5446 5447 virBufferEscapeRegex(&buf, "^%s", prefix); 5448 if (infix) 5449 virBufferEscapeRegex(&buf, "%s", infix); - 5450 virBufferAddLit(&buf, "/(target/)?([^/]+\\.)|(domain-[^/]+/)|([0-9]+-[^/]+/)"); + 5450 virBufferAddLit(&buf, "/(target/)?(([^/]+\\.)|(domain-[^/]+/)|([0-9]+-[^/]+/))"); 5451 virBufferEscapeRegex(&buf, "%s$", target); 5452 5453 regexp = virBufferContentAndReset(&buf); 5454 5455 return virStringMatch(path, regexp); 5456 }
- blocks
-
RHEL-18165 virsh nodedev-dumpxml dumps invalid xml
- Closed
- is blocked by
-
RHEL-15267 Rebase libvirt in RHEL-9.4.0
- Closed
- links to
-
RHBA-2023:125049 libvirt bug fix and enhancement update