kvm tools: don't die if sdl wasn't compiled in and we don't try using it
PATCH 1/1 kvm tools: don't die if sdl wasn't compiled in and we don't try using it
If SDL isn't compiled in we shouldn't die unless we actually try using it.
--- tools/kvm/include/kvm/sdl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
tools/kvm/include/kvm/sdl.h +8 -2
@@ -11,11 +11,17 @@ int sdl__exit(struct kvm *kvm);#else static inline int sdl__init (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }static inline int sdl__exit (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }#endif
Signature · 1 line
1.7.12
Quoted 32 lines · Sasha Levin
If SDL isn't compiled in we shouldn't die unless we actually try using it.
Signed-off-by Sasha Levin <[email protected]>--- tools/kvm/include/kvm/sdl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)tools/kvm/include/kvm/sdl.h +8
-3@@ -11,11 +11,17 @@ int sdl__exit(struct kvm *kvm);#else static inline int sdl__init (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }static inline int sdl__exit (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }#endif --
Quoted 2 lines
1.7.12
Patch applies.
But when I run the 'lkvm' binary (after recompiling the kernel and kvm tool) , I see this:
#---------------------------------------------------------------------------------------------------------------#
[kashyap@moon kvm]$ ./lkvm run -k ../../arch/x86/boot/bzImage
# lkvm run -k ../../arch/x86/boot/bzImage -m 448 -c 4 --name guest-17105 PPrroobbiinngg EEDDDD ((eedddd==ooffff ttoo ddiissaabbllee))...... ookk . . .
[ 1.492530] host=192.168.33.15, domain=, nis-domain=(none) [ 1.493443] bootserver=192.168.33.1, rootserver=0.0.0.0, rootpath= [ 1.494458] ALSA device list: [ 1.494901] No soundcards found. [ 1.497106] VFS: Mounted root (9p filesystem) on device 0:13. [ 1.498617] devtmpfs: mounted [ 1.500555] Freeing unused kernel memory: 512k freed [ 1.501981] Write protecting the kernel read-only data: 12288k [ 1.511605] Freeing unused kernel memory: 1820k freed [ 1.520470] Freeing unused kernel memory: 1576k freed Mounting... [ 1.533811] KGDB: BP remove failed: ffffffff8105212f
#---------------------------------------------------------------------------------------------------------------#
Any hints?
Quoted 62 lines · Kashyap Chamarthy
Quoted 32 lines · Sasha Levin
If SDL isn't compiled in we shouldn't die unless we actually try using it.
Signed-off-by Sasha Levin <[email protected]>--- tools/kvm/include/kvm/sdl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)tools/kvm/include/kvm/sdl.h +8
-3@@ -11,11 +11,17 @@ int sdl__exit(struct kvm *kvm);#else static inline int sdl__init (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }static inline int sdl__exit (struct kvm *kvm) { -die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); +if (kvm->cfg.sdl) +die ("SDL support not compiled in. (install the SDL-dev[el] package)" ); + +return 0 ; }#endif --Quoted 2 lines
1.7.12
Patch applies.
But when I run the 'lkvm' binary (after recompiling the kernel and kvm tool) , I see this:
#---------------------------------------------------------------------------------------------------------------#
[kashyap@moon kvm]$ ./lkvm run -k ../../arch/x86/boot/bzImage# lkvm run -k ../../arch/x86/boot/bzImage -m 448 -c 4 --name guest-17105 PPrroobbiinngg EEDDDD ((eedddd==ooffff ttoo ddiissaabbllee))...... ookk . . .[ 1.492530] host=192.168.33.15, domain=, nis-domain=(none) [ 1.493443] bootserver=192.168.33.1, rootserver=0.0.0.0, rootpath= [ 1.494458] ALSA device list: [ 1.494901] No soundcards found. [ 1.497106] VFS: Mounted root (9p filesystem) on device 0:13. [ 1.498617] devtmpfs: mounted [ 1.500555] Freeing unused kernel memory: 512k freed [ 1.501981] Write protecting the kernel read-only data: 12288k [ 1.511605] Freeing unused kernel memory: 1820k freed [ 1.520470] Freeing unused kernel memory: 1576k freed Mounting... [ 1.533811] KGDB: BP remove failed: ffffffff8105212f
Quoted 3 lines
#---------------------------------------------------------------------------------------------------------------#
Any hints?
Discussed w/ Sasha on #pv. He pointed I had the directive CONFIG_KGDB_TESTS_ON_BOOT set . (Silly me!)
Builds fine, once booted, guest shell access over a serial console is presented successfully.
#---------------------------------------------------------------------------------------------------------------#
[kashyap@moon kvm]$ ./kvm run --balloon -k ../../arch/x86/boot/bzImage
# kvm run -k ../../arch/x86/boot/bzImage -m 448 -c 4 --name guest-4418 PPrroobbiinngg EEDDDD ((eedddd==ooffff ttoo ddiissaabbllee))...... ookk
Decompressing Linux... Parsing ELF... done.
Booting the kernel.
.
.
.
[ 1.466336] device=eth0, addr=192.168.33.15, mask=255.255.255.0, gw=192.168.33.1 [ 1.467964] host=192.168.33.15, domain=, nis-domain=(none) [ 1.469212] bootserver=192.168.33.1, rootserver=0.0.0.0, rootpath= [ 1.470599] ALSA device list: [ 1.471257] No soundcards found. [ 1.473453] VFS: Mounted root (9p filesystem) on device 0:13. [ 1.474961] devtmpfs: mounted [ 1.477103] Freeing unused kernel memory: 512k freed [ 1.478598] Write protecting the kernel read-only data: 12288k [ 1.488213] Freeing unused kernel memory: 1820k freed [ 1.497327] Freeing unused kernel memory: 1576k freed
Mounting...
sh-4.2#
#---------------------------------------------------------------------------------------------------------------#
ACK.