[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] bootindex: add {del, modify}_boot_device_pa
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] bootindex: add {del, modify}_boot_device_path function |
Date: |
Fri, 25 Jul 2014 03:31:05 +0000 |
> -----Original Message-----
> From: Gerd Hoffmann [mailto:address@hidden
> Sent: Thursday, July 24, 2014 9:25 PM
> Subject: Re: [PATCH 1/6] bootindex: add {del,modify}_boot_device_path
> function
>
> 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.
>
Yes, you are right. I make a mistake because libvirt will default assign the
first
disk as bootindex=1.
> 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.
>
Yes.
> > > 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.
>
Agreed. Thank you so much, Gerd.
A new version will be posted later.
Best regards,
-Gonglei
[Qemu-devel] [PATCH 2/6] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/07/24
[Qemu-devel] [PATCH 5/6] qemu-monitor: HMP set-bootindex wrapper, arei.gonglei, 2014/07/24
[Qemu-devel] [PATCH 4/6] qmp: add set-bootindex command, arei.gonglei, 2014/07/24
[Qemu-devel] [PATCH 3/6] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/07/24
[Qemu-devel] [PATCH 6/6] spapr: fix possible memory leak, arei.gonglei, 2014/07/24