blob: e53fba88e0427c7ce2e1e7d226a7507df266cda3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
x86: 0.946
boot: 0.931
kernel: 0.928
architecture: 0.887
files: 0.881
device: 0.819
ppc: 0.799
graphic: 0.754
performance: 0.744
semantic: 0.729
PID: 0.646
vnc: 0.610
permissions: 0.604
register: 0.591
i386: 0.557
risc-v: 0.555
virtual: 0.526
arm: 0.518
VMM: 0.517
mistranslation: 0.470
hypervisor: 0.462
TCG: 0.434
network: 0.424
debug: 0.422
socket: 0.388
KVM: 0.366
user-level: 0.317
assembly: 0.281
peripherals: 0.200
QEMU does not reload kernel image on guest reboot (direct kernel boot)
Description of problem:
I am using virtiofs as root filesystem with QEMU direct kernel boot. The kernel is loaded from the guests directory structure that is exported from the host.
The problem is that QEMU does not reload the kernel image file from disk during a guest reboot. This means it is not possible to update the kernel from inside the guest and do a simple reboot to load it. A full power cycle of the guest is required to load the updated kernel image.
Steps to reproduce:
1. Migrate a Linux guest to virtiofs as root fs.
2. Enable QEMU direct kernel boot and point to guest's kernel in the exported root filesystem.
3. Boot.
4. Update the kernel inside the guest. Overwrite the existing kernel image
5. Issue `reboot` inside the guest.
6. When the guest reboots, the old kernel is still booted, even though the image file was overwritten.
7. Issue `poweroff` inside the guest.
8. Issue `virsh start <guest-vm>`
9. Now the new kernel image is booted.
Additional information:
XML:
```
<type arch='x86_64' machine='pc-q35-7.0'>hvm</type>
<kernel>/media/vm/libvirt/images/alpine-q/root/boot/vmlinuz-virt</kernel>
<initrd>/media/vm/libvirt/images/alpine-q/root/boot/initramfs-virt</initrd>
<cmdline>rootfstype=virtiofs root=root rw</cmdline>
<boot dev='hd'/>
<bootmenu enable='no'/>
</os>
...
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<binary path='/usr/libexec/virtiofsd' xattr='on'>
<cache mode='always'/>
<lock posix='on' flock='on'/>
</binary>
<source dir='/media/vm/libvirt/images/alpine-q/root'/>
<target dir='root'/>
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</filesystem>
```
|