Rusty Russell wrote: >> +static int __init kvm_devices_init(void) >> +{ >> + if (!MACHINE_IS_KVM) >> + return -ENODEV; >> + >> + if (device_register(&kvm_root) != 0) >> + panic("Could not register kvm root"); >> + >> + if (add_shared_memory((max_pfn) << PAGE_SHIFT, PAGE_SIZE)) { >> + device_unregister(&kvm_root); >> + return -ENOMEM; >> + } > > Hmm, panic on device_register fail, but -ENOMEM on add_shared_memory fail? > My theory was that since this is boot time, panic() is the right thing. We can't tell whether or not this is an important device or not. Maybe the guest is running with ramdisk as rootfs and can have a happy life if we don't kill it here. Return the rc from device register seems to be the right thing to me, if it was an important device we'll see "panic: cannot mount rootfs" or something later.
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel