From patchwork Mon Sep 7 14:00:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ozawa Tsuyoshi X-Patchwork-Id: 46112 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n87E12Qn019415 for ; Mon, 7 Sep 2009 14:01:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbZIGOAj (ORCPT ); Mon, 7 Sep 2009 10:00:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753297AbZIGOAj (ORCPT ); Mon, 7 Sep 2009 10:00:39 -0400 Received: from mail-px0-f184.google.com ([209.85.216.184]:65024 "EHLO mail-px0-f184.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149AbZIGOAi (ORCPT ); Mon, 7 Sep 2009 10:00:38 -0400 Received: by pxi14 with SMTP id 14so2507762pxi.19 for ; Mon, 07 Sep 2009 07:00:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.201.19 with SMTP id y19mr524908wff.305.1252332041301; Mon, 07 Sep 2009 07:00:41 -0700 (PDT) X-Originating-IP: [130.158.83.151] Date: Mon, 7 Sep 2009 23:00:41 +0900 X-Google-Sender-Auth: f15066bcdaf59e53 Message-ID: <411a180c0909070700m2d893e7fx748f801fff762cb@mail.gmail.com> Subject: [qemu-kvm][PATCH] Add "sda" alias options to "hda" options From: Ozawa Tsuyoshi To: kvm@vger.kernel.org Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org qemu-kvm: Add "sda" alias options to "hda" options I know that the name "hda" come from IDE drive, but I felt strange when I use qemu to boot linux kernel directly as follows: $ qemu-system-x86 -kernel vmlinux-2.6.28.15 -initrd initrd.img-2.6.28.15 -hda vdisk.img By applying this patch, the command will change to: $ qemu-system-x86 -kernel vmlinux-2.6.28.15 -initrd initrd.img-2.6.28.15 -sda vdisk.img The latter one seems to be more intuitive for me. diff --git a/qemu-options.hx b/qemu-options.hx index c1ec976..91cd931 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -68,6 +68,13 @@ Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}). ETEXI +DEF("sda", HAS_ARG, QEMU_OPTION_sda, + "-sda/-sdb file use 'file' as IDE hard disk 0/1 image\n") +DEF("sdb", HAS_ARG, QEMU_OPTION_sdb, "") +DEF("sdc", HAS_ARG, QEMU_OPTION_sdc, + "-sdc/-sdd file use 'file' as IDE hard disk 2/3 image\n") +DEF("sdd", HAS_ARG, QEMU_OPTION_sdd, "") + DEF("hda", HAS_ARG, QEMU_OPTION_hda, "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n") DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "") diff --git a/vl.c b/vl.c index 3485ce6..62d1d91 100644 --- a/vl.c +++ b/vl.c @@ -5085,6 +5085,7 @@ int main(int argc, char **argv, char **envp) initrd_filename = optarg; break; case QEMU_OPTION_hda: + case QEMU_OPTION_sda: if (cyls == 0) hda_opts = drive_add(optarg, HD_ALIAS, 0); else @@ -5096,6 +5097,9 @@ int main(int argc, char **argv, char **envp) translation == BIOS_ATA_TRANSLATION_NONE ? ",trans=none" : ""); break; + case QEMU_OPTION_sdb: + case QEMU_OPTION_sdc: + case QEMU_OPTION_sdd: case QEMU_OPTION_hdb: case QEMU_OPTION_hdc: case QEMU_OPTION_hdd: