@@ -835,13 +835,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
vidmode = 0;
memset(real_cmdline, 0, sizeof(real_cmdline));
- strcpy(real_cmdline, "noapic noacpi pci=conf1 reboot=k panic=1 i8042.direct=1 "
- "i8042.dumbkbd=1 i8042.nopnp=1");
- if (vnc || sdl) {
- strcat(real_cmdline, " video=vesafb console=tty0");
- } else
- strcat(real_cmdline, " console=ttyS0 earlyprintk=serial i8042.noaux=1");
- strcat(real_cmdline, " ");
+ kvm__arch_set_cmdline(real_cmdline, vnc || sdl);
+
+ if (strlen(real_cmdline) > 0)
+ strcat(real_cmdline, " ");
+
if (kernel_cmdline)
strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));
@@ -53,6 +53,7 @@ int kvm__get_sock_by_instance(const char *name);
int kvm__enumerate_instances(int (*callback)(const char *name, int pid));
void kvm__remove_socket(const char *name);
+void kvm__arch_set_cmdline(char *cmdline, bool video);
void kvm__arch_init(struct kvm *kvm, const char *kvm_dev, u64 ram_size, const char *name);
void kvm__arch_setup_firmware(struct kvm *kvm);
bool kvm__arch_cpu_supports_vm(void);
@@ -119,6 +119,17 @@ void kvm__init_ram(struct kvm *kvm)
}
}
+/* Arch-specific commandline setup */
+void kvm__arch_set_cmdline(char *cmdline, bool video)
+{
+ strcpy(cmdline, "noapic noacpi pci=conf1 reboot=k panic=1 i8042.direct=1 "
+ "i8042.dumbkbd=1 i8042.nopnp=1");
+ if (video) {
+ strcat(cmdline, " video=vesafb console=tty0");
+ } else
+ strcat(cmdline, " console=ttyS0 earlyprintk=serial i8042.noaux=1");
+}
+
/* Architecture-specific KVM init */
void kvm__arch_init(struct kvm *kvm, const char *kvm_dev, u64 ram_size, const char *name)
{
Different systems will want different base kernel commandlines, e.g. non-x86 systems probably don't need noapic, i8042.* etc., so set the commandline up in arch-specific code. Then, if the resulting commandline is empty, don't strcat a space onto the front. Signed-off-by: Matt Evans <matt@ozlabs.org> --- tools/kvm/builtin-run.c | 12 +++++------- tools/kvm/include/kvm/kvm.h | 1 + tools/kvm/x86/kvm.c | 11 +++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html