From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFMDs-0005Wm-CH for qemu-devel@nongnu.org; Thu, 07 Aug 2014 07:51:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFMDo-000550-JL for qemu-devel@nongnu.org; Thu, 07 Aug 2014 07:51:08 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:38267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFMDn-000509-88 for qemu-devel@nongnu.org; Thu, 07 Aug 2014 07:51:04 -0400 From: "Gonglei (Arei)" Date: Thu, 7 Aug 2014 11:50:43 +0000 Message-ID: <33183CC9F5247A488A2544077AF1902086C29068@SZXEMA503-MBS.china.huawei.com> References: <1407156382-2836-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1407156382-2836-1-git-send-email-arei.gonglei@huawei.com> Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v5 0/8] modify boot order of guest, and take effect after rebooting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" Cc: "chenliang (T)" , "Huangweidong (C)" , "mst@redhat.com" , "aik@ozlabs.ru" , "hutao@cn.fujitsu.com" , "armbru@redhat.com" , "kraxel@redhat.com" , "akong@redhat.com" , "peter.maydell@linaro.org" , "agraf@suse.de" , "aliguori@amazon.com" , "gaowanlong@cn.fujitsu.com" , Eduardo Habkost , Luonengjun , "Huangpeng (Peter)" , "hani@linux.com" , "stefanha@redhat.com" , "pbonzini@redhat.com" , "lcapitulino@redhat.com" , "kwolf@redhat.com" , "peter.crosthwaite@xilinx.com" , "imammedo@redhat.com" , "afaerber@suse.de" Hi, Ping... please.=20 TBH, I am confused which maintainer can maintain the patch serials about bo= otindex. Gerd is seemingly not in maillist later two weeks. Markus? Paolo? MST? PMM? Eduardo? Thanks for any help. Best regards, -Gonglei > -----Original Message----- > From: Gonglei (Arei) > Sent: Monday, August 04, 2014 8:46 PM > To: qemu-devel@nongnu.org > Cc: aliguori@amazon.com; mst@redhat.com; pbonzini@redhat.com; > akong@redhat.com; hutao@cn.fujitsu.com; ehabkost@redhat.com; > gaowanlong@cn.fujitsu.com; eblake@redhat.com; afaerber@suse.de; > armbru@redhat.com; imammedo@redhat.com; aik@ozlabs.ru; > kraxel@redhat.com; peter.crosthwaite@xilinx.com; lcapitulino@redhat.com; > hani@linux.com; stefanha@redhat.com; agraf@suse.de; chenliang (T); > Huangweidong (C); Luonengjun; Huangpeng (Peter); kwolf@redhat.com; > Gonglei (Arei) > Subject: [PATCH v5 0/8] modify boot order of guest, and take effect after > rebooting >=20 > From: Gonglei >=20 > Sometimes, we want to modify boot order of a guest, but no need to > shutdown it. We can call dynamic changing bootindex of a guest, which > can be assured taking effect just after the guest rebooting. >=20 > For example, in P2V scene, we boot a guest and then attach a > new system disk, for copying some thing. We want to assign the > new disk as the booting disk, which means its bootindex=3D1. >=20 > Different nics can be assigen different bootindex dynamically > also make sense. >=20 > The patchsets add one qmp interface, and add an fw_cfg_machine_reset() > to achieve it. >=20 > Steps of testing: >=20 > ./qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name redhat6.2 -drive \ > file=3D/home/redhat6.2.img,if=3Dnone,id=3Ddrive-ide0-0-0 \ > -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,= bootindex=3D1 \ > -drive file=3D/home/RH-DVD1.iso,if=3Dnone,id=3Ddrive-ide0-0-1 \ > -device ide-cd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,= bootindex=3D4 \ > -vnc 0.0.0.0:10 -netdev type=3Duser,id=3Dnet0 \ > -device virtio-net-pci,netdev=3Dnet0,bootindex=3D3,id=3Dnic1 \ > -netdev type=3Duser,id=3Dnet1 -device e1000,netdev=3Dnet1,bootindex=3D2,i= d=3Dnic2 \ > -drive file=3D/home/virtio-disk.vfd,if=3Dnone,id=3Ddrive-fdc0-0-0,format= =3Draw \ > -device isa-fdc,driveA=3Ddrive-fdc0-0-0,id=3Dfloppy1,bootindexA=3D5 -moni= tor stdio > QEMU 2.0.93 monitor - type 'help' for more information > (qemu) info bootindex > id bootindex suffix > "floppy1" 5 "/floppy@0" > "ide0-0-1" 4 "/disk@1" > "nic1" 3 "/ethernet-phy@0" > "nic2" 2 "/ethernet-phy@0" > "ide0-0-0" 1 "/disk@0" > (qemu) set-bootindex ide0-0-1 1 > The bootindex 1 has already been used > (qemu) set-bootindex ide0-0-1 6 "/disk@1" > (qemu) set-bootindex ide0-0-1 0 > (qemu) system_reset > (qemu) set-bootindex ide0-0-1 1 > The bootindex 1 has already been used > (qemu) set-bootindex nic1 0 > The bootindex 0 has already been used > (qemu) set-bootindex ide0-0-1 -1 > (qemu) set-bootindex nic1 0 > (qemu) info bootindex > id bootindex suffix > "floppy1" 5 "/floppy@0" > "nic2" 2 "/ethernet-phy@0" > "ide0-0-0" 1 "/disk@0" > "nic1" 0 "/ethernet-phy@0" > (qemu) system_reset > (qemu) >=20 >=20 > Changes since v4: > - using error_setg() instead of qerror_report() in patch 1/8. > - call del_boot_device_path() from device_finalize() instead > of placing it into each individual device in patch 4/8. >=20 > Changes since v3: > - rework del_* and modify_* function, because of virtio devices' special= ation. > For example, virtio-net's id is NULL, and its parent virtio-net-pci's = id was > assigned. > Though the global fw_boot_order stored the virtio-net device. > - call dell_boot_device_path in each individual device avoiding waste re= souce. > - introduce qmp "query-bootindex" command > - introcude hmp "info bootindex" command > - Fixes by Eric's reviewing comments, thanks. >=20 > Changes since v2: > *address Gerd's reviewing suggestion: > - use the old entry's suffix, if the caller do not pass it in. > - call del_boot_device_path() from device_finalize() instead > of placing it into each individual device. >=20 > Thanks Gerd. >=20 > Changes since v1: > *rework by Gerd's suggestion: > - split modify and del fw_boot_order for single function. > - change modify bootindex's realization which simply lookup > the device and modify the bootindex. if the new bootindex > has already used by another device just throw an error. > - change to del_boot_device_path(DeviceState *dev) and simply delete all > entries belonging to the device. >=20 > Gonglei (8): > bootindex: add modify_boot_device_path function > bootindex: add del_boot_device_path function > fw_cfg: add fw_cfg_machine_reset function > bootindex: delete bootindex when device is removed > qmp: add set-bootindex command > qemu-monitor: HMP set-bootindex wrapper > qmp: add query-bootindex command > qemu-monitor: add HMP "info-bootindex" command >=20 > hmp-commands.hx | 17 +++++++ > hmp.c | 33 +++++++++++++ > hmp.h | 2 + > hw/core/qdev.c | 4 ++ > hw/nvram/fw_cfg.c | 54 ++++++++++++++++++--- > include/hw/nvram/fw_cfg.h | 2 + > include/sysemu/sysemu.h | 3 ++ > monitor.c | 7 +++ > qapi-schema.json | 46 ++++++++++++++++++ > qmp-commands.hx | 66 ++++++++++++++++++++++++++ > qmp.c | 17 +++++++ > vl.c | 117 > ++++++++++++++++++++++++++++++++++++++++++++++ > 12 files changed, 361 insertions(+), 7 deletions(-) >=20 > -- > 1.7.12.4 >=20