Questions on device-added and device-removed events
by Han Han
Hi developers,
When the guest OS is booting, the event for live attachment could be caught
by libvirt, while the event for live detachment could not.
Version:
libvirt-7.9
qemu-kvm-6.1
Steps:
Terminal 1:
➜ ~ virsh event --loop --all
Terminal 2:
➜ ~ virsh start avocado-vt-vm1; qemu-img create /tmp/vdb 10M; virsh
attach-disk avocado-vt-vm1 /tmp/vdb vdb; virsh detach-disk avocado-vt-vm1
vdb
The outputs from terminal 1:
event 'agent-lifecycle' for domain 'avocado-vt-vm1': state: 'disconnected'
reason: 'domain started'
event 'lifecycle' for domain 'avocado-vt-vm1': Resumed Unpaused
event 'lifecycle' for domain 'avocado-vt-vm1': Started Booted
event 'device-added' for domain 'avocado-vt-vm1': virtio-disk1
event 'agent-lifecycle' for domain 'avocado-vt-vm1': state: 'connected'
reason: 'channel event'
As you can see, the device live attachment and the device detachment are
both executed when the guest OS is booting, but there is only the event
'device-added' is recorded.
So my questions are:
1. Is it the expected results for the results above?
2. If so, what is the internal difference between 'device-added' and
'device-removed'?
3. I notice there is the DEVICE_DELETED event in qmp? Any relation between
the 'device-removed' of libvirt and the DEVICE_DELETED of qmp?
3 years
how to use vhost-user-vsock
by Jiatong Shen
Hello community,
I am looking for a way to configure vhost-user-vsock using libvirt, but
looks like it is not written in doc. How can I use vhost-user-vsock using
libvirt? Thank you.
--
Best Regards,
Jiatong Shen
3 years
Cannot access KVM using virsh console after KVM rebooted or shut off
by Yifei Liu
Dear all,
I used ssh with -X option to connect to an Ubuntu remote server where I applied virsh
(libvirt) to manage my KVM virtual machines, and my local machine is MacOS. Then,
I used virt-install to install a Tiny Core Linux VM, and I got a pop-up Virt Viewer window
(via XQuartz) which is the console for my Tiny Core VM. However, if I rebooted my VM,
then I checked the VM state by virsh list --all which was running. Then, I tried
`virsh console my_vm_domain` but this command got stuck on:
> Connected to domain my_vm_domain
> Escape character is ^]
The `virsh console` command hung without any response. This issue also happened when
I used virsh console after I shut down and later started the VM. Even the VM was already
started, I cannot return to the VM console by `virsh console`.
I can get the VM console in Virt Viewer at the first boot (using virt-install).
But, if I shutdown the VM once, I can never access the VM console by virsh console even
the VM state is running. Any idea about how to use virsh console?
Thanks,
Yifei
3 years
can't connect to virtlogd: Unable to open system token /run/libvirt/common/system.token: Permission denied
by 梁朝军
Hi all,
I have encountered a new issue when start a VM with new builded libvirt.
I failed to start VM from defined xml and hit the error like "can't connect to virtlogd: Unable to open system token /run/libvirt/common/system.token: Permission denied”
Any inputs are appreciated.
The libvit version:
libvirtd -V
setlocale: No such file or directory
libvirtd (libvirt) 7.6.0
Os : cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
Linux kernel:
uname -a
Linux localhost.localdomain 4.18.0-305.el8.x86_64 #1 SMP Thu Apr 29 08:54:30 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
QEMU version:
usr/libexec/qemu-kvm --help
QEMU emulator version 5.1.0 (qemu-kvm-5.1.0-1.el8)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
Thanks!
3 years
CPU vendor_id handling
by Toolybird
Hello,
There are times when spoofing the CPU vendor_id is convenient. For example, some x86 guest OS's only run on Intel and refuse to run on an AMD host. Libvirt does support this in the "host-model" case, but it doesn't work for CPU "host-passthrough". On the QEMU command line it's as easy as:
$ qemu-system-x86_64 -cpu host,vendor=GenuineIntel
This works fine in libvirt XML:
<cpu mode='host-model'>
<model vendor_id='GenuineIntel'/>
</cpu>
This doesn't:
<cpu mode='host-passthrough'>
<model vendor_id='GenuineIntel'/>
</cpu>
Libvirt silently strips out the model line after saving "virsh edit ..."
Is there any reason why libvirt cannot support this in the host-passthrough case? The status quo means that some folks end up resorting to <qemu:arg value='-cpu'/> hacks which of course causes all sorts of confusion with multiple -cpu lines getting passed to QEMU.
Thanks
3 years
creating specific cpu model
by daggs
Greetings,
I want to create a new cpu model which is a cross section of cpu flags of 2 different cpus and libvirt capabilites.
I've extracted the supported cpu flags of each cpu using lscpu.
I've created a cross section of both.
I've pulled the suppored cpu flags from libvirt and created a cross section of it with the subset from above.
now I want to create a new cpu model out of it.
I assume that creating a xml file at /usr/share/libvirt/cpu_map/ with the x86_ prefix that matches the format listed there will suffice for libvirt and later for qemu?
Thanks,
Dagg.
3 years