On Wed, Sep 5, 2012 at 11:31 AM, Sasha Levin <levinsasha928@xxxxxxxxx> wrote: > This patch series is mostly about cleanups: > > - Clean all the global variables we have to store configuration options. > - Remove externed config options between objects. > - Adding several exit routines to clean up on exit. > - Remove the global 'kvm' object. > - Contain arch specific init/exit calls within the corresponding non-arch > specific code instead of the global init. > > This patch series also adds a method to call init/exit functions automatically > after we've finished intializing config options. > > Doing so clears out a big chunk of repetetive code in our builtin-run init > function, and makes adding new modules easier since there's now no need to > link them to builtin-run. I'm getting an instant SIGSEGV for "vm run" with these patches: [penberg@tux kvm]$ gdb --args ./lkvm run GNU gdb (GDB) Fedora (7.3.50.20110722-13.fc16) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/penberg/linux/tools/kvm/lkvm...done. (gdb) r Starting program: /home/penberg/linux/tools/kvm/lkvm run [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". # lkvm run -k ../../arch/x86/boot/bzImage -m 448 -c 4 --name guest-6703 [New Thread 0x7fffdbfd5700 (LWP 6707)] [New Thread 0x7fffdb7d4700 (LWP 6708)] warning: Range for type (null) has invalid bounds 0..-109 Program received signal SIGSEGV, Segmentation fault. 0x000000000040fb14 in kvm__pause (kvm=0x712010) at kvm.c:419 419 if (!kvm->cpus[0] || kvm->cpus[0]->thread == 0) Missing separate debuginfos, use: debuginfo-install SDL-1.2.14-13.fc16.x86_64 glibc-2.14.90-24.fc16.7.x86_64 zlib-1.2.5-6.fc16.x86_64 (gdb) bt #0 0x000000000040fb14 in kvm__pause (kvm=0x712010) at kvm.c:419 #1 0x000000000040f898 in ioport__register (kvm=0x712010, port=3324, ops=0x638ce0, count=4, param=0x0) at ioport.c:63 #2 0x000000000040f6c4 in pci__init (kvm=0x712010) at pci.c:194 #3 0x0000000000414f94 in init_list__init (kvm=0x712010) at util/init.c:41 #4 0x000000000041dc4e in kvm_cmd_run_init.2726 (argc=0, argv=0x7fffffffe168) at builtin-run.c:655 #5 0x0000000000419d8e in kvm_cmd_run (argc=0, argv=0x7fffffffe168, prefix=0x0) at builtin-run.c:689 #6 0x00000000004198ce in handle_command (command=0x6396e0, argc=1, argv=0x7fffffffe160) at kvm-cmd.c:84 #7 0x0000000000419797 in handle_kvm_command.5445 (argc=1, argv=0x7fffffffe160) at main.c:11 #8 0x000000000042753e in main (argc=2, argv=0x7fffffffe158) at main.c:18 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html