qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"aik@ozlabs.ru" <aik@ozlabs.ru>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"agraf@suse.de" <agraf@suse.de>,
	"dmitry@daynix.com" <dmitry@daynix.com>,
	"akong@redhat.com" <akong@redhat.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"lersek@redhat.com" <lersek@redhat.com>,
	"marcel.a@redhat.com" <marcel.a@redhat.com>,
	"somlo@cmu.edu" <somlo@cmu.edu>,
	Luonengjun <luonengjun@huawei.com>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"lcapitulino@redhat.com" <lcapitulino@redhat.com>,
	"rth@twiddle.net" <rth@twiddle.net>,
	"kwolf@redhat.com" <kwolf@redhat.com>,
	"peter.crosthwaite@xilinx.com" <peter.crosthwaite@xilinx.com>,
	"chenliang (T)" <chenliang88@huawei.com>,
	"imammedo@redhat.com" <imammedo@redhat.com>,
	"afaerber@suse.de" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 1/6] bootindex: add {del, modify}_boot_device_path function
Date: Thu, 24 Jul 2014 15:25:04 +0200	[thread overview]
Message-ID: <1406208304.13444.16.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF1902086C1CE14@SZXEMA503-MBS.china.huawei.com>

  Hi,

> > Hmm.  I think we should simply lookup the device and modify the
> > bootindex, leaving the entry as-is otherwise.  In case the new bootindex
> > is already used by another device just throw an error.
> > 
> If we just throw an error but not change the bootindex is already used,
> we cannot achieve our purpose. For example, we configure a hard disk,
> which bootindex=1, a nic which bootindex=2. If we want to boot the guest
> from nic firstly, we should must set the nic's bootindex to 1. AFAICT, the 
> bootindex=1 always be used.

No.  The devices are simply sorted by bootindex.  You don't have to use
'1'.  And you can have holes in your numbering and use --for example --
3+5.

So you can start qemu with hd=2,cdrom=3,nic=4, then set nic=1 or cdrom=1
for a guest install, change it back when done.

> > Should be del_boot_device_path(DeviceState *dev) and simply delete all
> > entries belonging to the device.  Patch #3 can be much simpler then as
> > we can call the function from generic device cleanup code.
> > 
> Because the IDE device may configure two kind of disk, HD and CDROM, we
> have to distinguish them by suffix.

Yes, the suffix indicated whenever the device is a disk or cdrom.  But
you'll never have both cdrom+disk paths attached to a single device.
Therefore the device is enough to identify the bootpath entry, you don't
need the suffix for that.

cheers,
  Gerd

  reply	other threads:[~2014-07-24 13:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24  8:38 [Qemu-devel] [PATCH 0/6] modify boot order of guest, and take effect after rebooting arei.gonglei
2014-07-24  8:38 ` [Qemu-devel] [PATCH 1/6] bootindex: add {del, modify}_boot_device_path function arei.gonglei
2014-07-24 10:08   ` Gerd Hoffmann
2014-07-24 12:39     ` Gonglei (Arei)
2014-07-24 13:25       ` Gerd Hoffmann [this message]
2014-07-25  3:31         ` Gonglei (Arei)
2014-07-24  8:38 ` [Qemu-devel] [PATCH 2/6] fw_cfg: add fw_cfg_machine_reset function arei.gonglei
2014-07-24  8:38 ` [Qemu-devel] [PATCH 3/6] bootindex: delete bootindex when device is removed arei.gonglei
2014-07-24  8:39 ` [Qemu-devel] [PATCH 4/6] qmp: add set-bootindex command arei.gonglei
2014-07-24  8:39 ` [Qemu-devel] [PATCH 5/6] qemu-monitor: HMP set-bootindex wrapper arei.gonglei
2014-07-24  8:39 ` [Qemu-devel] [PATCH 6/6] spapr: fix possible memory leak arei.gonglei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406208304.13444.16.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=chenliang88@huawei.com \
    --cc=dmitry@daynix.com \
    --cc=imammedo@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=somlo@cmu.edu \
    --cc=stefanha@redhat.com \
    --cc=weidong.huang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).