All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] ahci drive: how to make it non-bootable?
@ 2012-05-07 18:48 Michael Tokarev
  2012-05-08  5:20 ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tokarev @ 2012-05-07 18:48 UTC (permalink / raw)
  To: qemu-devel

I'm trying to experiment with ahci, but can't
even get my win guest to install drivers for
it.  My usualy procedure is, for an existing
guest, to add a dummy drive of required type,
boot the guest, let it to recognize the new
device and to install drivers needed for it,
shut it down and change boot drive to the one
of required type.  This worked fine so far,
eg, for virtio or scsi.

But now I can't use the same technique for ahci.

 qemu .. -drive file=winguest.raw,if=virtio \
  -device ahci,id=a \
  -drive file=dummy.raw,id=d,if=none \
  -device ide-disk,bus=a.0,drive=d,bootindex=X

Now, no matter what I use for the bootindex
parameter, the guest _always_ boots off a dummy
ahci drive.  Even using bootindex=-1 or some huge
value, the guest still boots from ahci.

The only workaround I found so far is to boot
using -boot menu=on, and manually choose the
second entry (which is the virtio image), but
obviously this is not good at all.

How to let the guest to boot from the virtio
drive?

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-07 18:48 [Qemu-devel] ahci drive: how to make it non-bootable? Michael Tokarev
@ 2012-05-08  5:20 ` Gerd Hoffmann
  2012-05-08  5:45   ` Michael Tokarev
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2012-05-08  5:20 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel

On 05/07/12 20:48, Michael Tokarev wrote:
> I'm trying to experiment with ahci, but can't
> even get my win guest to install drivers for
> it.  My usualy procedure is, for an existing
> guest, to add a dummy drive of required type,
> boot the guest, let it to recognize the new
> device and to install drivers needed for it,
> shut it down and change boot drive to the one
> of required type.  This worked fine so far,
> eg, for virtio or scsi.
> 
> But now I can't use the same technique for ahci.
> 
>  qemu .. -drive file=winguest.raw,if=virtio \
>   -device ahci,id=a \
>   -drive file=dummy.raw,id=d,if=none \
>   -device ide-disk,bus=a.0,drive=d,bootindex=X
> 
> Now, no matter what I use for the bootindex
> parameter, the guest _always_ boots off a dummy
> ahci drive.  Even using bootindex=-1 or some huge
> value, the guest still boots from ahci.
> 
> The only workaround I found so far is to boot
> using -boot menu=on, and manually choose the
> second entry (which is the virtio image), but
> obviously this is not good at all.
> 
> How to let the guest to boot from the virtio
> drive?

bootindex=1 for virtio
bootindex=2 for ahci

ordering in the boot menu then should be virtio first, ahci second, then
everything else (cdrom, nic, ..).

cheers,
  Gerd

> 
> Thanks,
> 
> /mjt
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-08  5:20 ` Gerd Hoffmann
@ 2012-05-08  5:45   ` Michael Tokarev
  2012-05-08  6:43     ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tokarev @ 2012-05-08  5:45 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 08.05.2012 09:20, Gerd Hoffmann wrote:
> On 05/07/12 20:48, Michael Tokarev wrote:
>> I'm trying to experiment with ahci, but can't
>> even get my win guest to install drivers for
>> it.  My usualy procedure is, for an existing
>> guest, to add a dummy drive of required type,
>> boot the guest, let it to recognize the new
>> device and to install drivers needed for it,
>> shut it down and change boot drive to the one
>> of required type.  This worked fine so far,
>> eg, for virtio or scsi.
>>
>> But now I can't use the same technique for ahci.
>>
>>  qemu .. -drive file=winguest.raw,if=virtio \
>>   -device ahci,id=a \
>>   -drive file=dummy.raw,id=d,if=none \
>>   -device ide-disk,bus=a.0,drive=d,bootindex=X
>>
>> Now, no matter what I use for the bootindex
>> parameter, the guest _always_ boots off a dummy
>> ahci drive.  Even using bootindex=-1 or some huge
>> value, the guest still boots from ahci.
>>
>> The only workaround I found so far is to boot
>> using -boot menu=on, and manually choose the
>> second entry (which is the virtio image), but
>> obviously this is not good at all.
>>
>> How to let the guest to boot from the virtio
>> drive?
> 
> bootindex=1 for virtio

-drive file=winguest.raw,if=virtio,bootindex=1 --

this does not work:

 qemu: -drive file=winguest.raw,if=virtio,bootindex=1: Invalid parameter 'bootindex'

I understand that I probably can replace this single
-drive with 3 parameters -- -device virtio-blk-pci,
-drive if=none, and -device ide-drive.

But this is already too much for ahci, so now I'm forced to
use the same very long syntax for virtio and ide too?
Is there a saner way?

Also, still, the question in the $subj: how to make the ahci
drive non-bootable?

> bootindex=2 for ahci
> 
> ordering in the boot menu then should be virtio first, ahci second, then
> everything else (cdrom, nic, ..).
> 
> cheers,
>   Gerd

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-08  5:45   ` Michael Tokarev
@ 2012-05-08  6:43     ` Gerd Hoffmann
  2012-05-08 17:56       ` Michael Tokarev
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2012-05-08  6:43 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel

  Hi,

>> bootindex=1 for virtio
> 
> -drive file=winguest.raw,if=virtio,bootindex=1 --
> 
> this does not work:

Oops.  I through it does, but seems this is only the case for the old &
deprecated boot=on (and maybe even that only in qemu-kvm).

>  qemu: -drive file=winguest.raw,if=virtio,bootindex=1: Invalid parameter 'bootindex'
> 
> I understand that I probably can replace this single
> -drive with 3 parameters -- -device virtio-blk-pci,
> -drive if=none, and -device ide-drive.

It's two only:
  -drive if=none,id=<name>,...
  -device virtio-blk-pci,drive=<name>

> Also, still, the question in the $subj: how to make the ahci
> drive non-bootable?

I think you can't.

seabios uses a few numbers just above 100 for the internal default
ordering (hd first, then cdrom, then nic, then others) in case no
bootindex is specified.  So you can try bootindex=200, that should get
ahci to the bottom of the boot menu, maybe that is good enougth.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-08  6:43     ` Gerd Hoffmann
@ 2012-05-08 17:56       ` Michael Tokarev
  2012-05-09  8:02         ` Gleb Natapov
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tokarev @ 2012-05-08 17:56 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 08.05.2012 10:43, Gerd Hoffmann wrote:
>   Hi,
> 
>>> bootindex=1 for virtio
>>
>> -drive file=winguest.raw,if=virtio,bootindex=1 --
>>
>> this does not work:
> 
> Oops.  I through it does, but seems this is only the case for the old &
> deprecated boot=on (and maybe even that only in qemu-kvm).

boot=on has been removed in qemu-kvm too.  I had to resurrect it for
Debian, so in debian it is supported still.  And _that_ actually works,
so I actually saved myself by providing the dropped feature.  I can
do the obvious (adding boot=on to the virtio drive) and it boots from
it, despite the presence of ahci.  Yay, thank you Gerd! :)

>>  qemu: -drive file=winguest.raw,if=virtio,bootindex=1: Invalid parameter 'bootindex'
>>
>> I understand that I probably can replace this single
>> -drive with 3 parameters -- -device virtio-blk-pci,
>> -drive if=none, and -device ide-drive.
> 
> It's two only:
>   -drive if=none,id=<name>,...
>   -device virtio-blk-pci,drive=<name>

Ok, at least it is not entirely insane :)

>> Also, still, the question in the $subj: how to make the ahci
>> drive non-bootable?
> 
> I think you can't.
> 
> seabios uses a few numbers just above 100 for the internal default
> ordering (hd first, then cdrom, then nic, then others) in case no
> bootindex is specified.  So you can try bootindex=200, that should get
> ahci to the bottom of the boot menu, maybe that is good enougth.

I tried 1000 - it still places ahci before virtio.  Unless I use
boot=on for virtio case.

I guess I'll remove the deprecation warning for Debian too, since
this boot=on thing is the only sane way to specify boot drive... :(

Thank you!

/mjt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-08 17:56       ` Michael Tokarev
@ 2012-05-09  8:02         ` Gleb Natapov
  2012-05-09 16:10           ` Michael Tokarev
  0 siblings, 1 reply; 9+ messages in thread
From: Gleb Natapov @ 2012-05-09  8:02 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Gerd Hoffmann, qemu-devel

On Tue, May 08, 2012 at 09:56:10PM +0400, Michael Tokarev wrote:
> On 08.05.2012 10:43, Gerd Hoffmann wrote:
> >   Hi,
> > 
> >>> bootindex=1 for virtio
> >>
> >> -drive file=winguest.raw,if=virtio,bootindex=1 --
> >>
> >> this does not work:
> > 
> > Oops.  I through it does, but seems this is only the case for the old &
> > deprecated boot=on (and maybe even that only in qemu-kvm).
> 
> boot=on has been removed in qemu-kvm too.  I had to resurrect it for
> Debian, so in debian it is supported still.  And _that_ actually works,
> so I actually saved myself by providing the dropped feature.  I can
> do the obvious (adding boot=on to the virtio drive) and it boots from
> it, despite the presence of ahci.  Yay, thank you Gerd! :)
> 
> >>  qemu: -drive file=winguest.raw,if=virtio,bootindex=1: Invalid parameter 'bootindex'
> >>
> >> I understand that I probably can replace this single
> >> -drive with 3 parameters -- -device virtio-blk-pci,
> >> -drive if=none, and -device ide-drive.
> > 
> > It's two only:
> >   -drive if=none,id=<name>,...
> >   -device virtio-blk-pci,drive=<name>
> 
> Ok, at least it is not entirely insane :)
That's the way you suppose to do that. Does it work if you specify
bootindex for virtio this way? If it does then use it. Restoring
deprecated hacks is not the way to deal with it. If it does not, then
it is a bug that should be fixed.

> 
> >> Also, still, the question in the $subj: how to make the ahci
> >> drive non-bootable?
> > 
> > I think you can't.
> > 
> > seabios uses a few numbers just above 100 for the internal default
> > ordering (hd first, then cdrom, then nic, then others) in case no
> > bootindex is specified.  So you can try bootindex=200, that should get
> > ahci to the bottom of the boot menu, maybe that is good enougth.
> 
> I tried 1000 - it still places ahci before virtio.  Unless I use
> boot=on for virtio case.
> 
> I guess I'll remove the deprecation warning for Debian too, since
> this boot=on thing is the only sane way to specify boot drive... :(
> 
> Thank you!
> 
> /mjt

--
			Gleb.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-09  8:02         ` Gleb Natapov
@ 2012-05-09 16:10           ` Michael Tokarev
  2012-05-10  7:33             ` Paolo Bonzini
  2012-05-10 12:27             ` Gleb Natapov
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Tokarev @ 2012-05-09 16:10 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: Gerd Hoffmann, qemu-devel

On 09.05.2012 12:02, Gleb Natapov wrote:
> On Tue, May 08, 2012 at 09:56:10PM +0400, Michael Tokarev wrote:
[]
>>> It's two only:
>>>   -drive if=none,id=<name>,...
>>>   -device virtio-blk-pci,drive=<name>
>>
>> Ok, at least it is not entirely insane :)

> That's the way you suppose to do that. Does it work if you specify
> bootindex for virtio this way? If it does then use it. Restoring
> deprecated hacks is not the way to deal with it. If it does not, then
> it is a bug that should be fixed.

Using the "too verbose" version is, well, difficult to type, when
you have to start many guests - eg, testing etc.  That's why I think
that 3 options for ahci drives is somewhat insane.

Technically there is no problem at all at combining, eg, -netdev and
-device rtl8139, in the same way as current -drive file=foo,if=bar
works, and it is MUCH easier to type and hence is MUCH user-friendly.
And much less error-prone, too.

I think it'd be a good solution to allow bootindex and some other
options to be recognizable in context of, eg -drive with if!=none,
by combining options recognizable from if= with the ones recognizable
by -drive.  Ditto for -netdev..-device: let -netdev to recognize
model=, and allow model-specific (e1000|8130|virtio-net-pci|whatever)
to be recognized as well.  This way there will be no need to specify
id=foo and netdev=foo, the command line will be shorter and also more
understandable.

Please don't say that the only sane option to start qemu guests is
to use libvirt.  Qemu has its great value exactly because it allows
starting guests from command line, which is well-scriptable.

The old hacks which were prematurely removed from qemu-kvm makes the
life easier for the _user_, which is the main target of the software.
I'd love to stop using them but sometimes it is not possible.  With
this extboot thing, qemu-kvm dropped ability to boot from SCSI for
example, and it turns out there are quite some users of this interface
exists - despite the fact SCSI is broken, there is a proprietary
bootrom exists etc -- we just broke users setups without providing
viable alternative, which, to my view, is unacceptable.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-09 16:10           ` Michael Tokarev
@ 2012-05-10  7:33             ` Paolo Bonzini
  2012-05-10 12:27             ` Gleb Natapov
  1 sibling, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2012-05-10  7:33 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Gerd Hoffmann, Gleb Natapov, qemu-devel

Il 09/05/2012 18:10, Michael Tokarev ha scritto:
> 
> The old hacks which were prematurely removed from qemu-kvm makes the
> life easier for the _user_, which is the main target of the software.
> I'd love to stop using them but sometimes it is not possible.  With
> this extboot thing, qemu-kvm dropped ability to boot from SCSI for
> example, and it turns out there are quite some users of this interface
> exists - despite the fact SCSI is broken, there is a proprietary
> bootrom exists etc -- we just broke users setups without providing
> viable alternative, which, to my view, is unacceptable.

You were using a fork, and this implies some risks of things being
broken when upstream decides to do differently (e.g. extboot vs.
implementing boot support in SeaBIOS).

As far as I know, no feature was removed from upstream QEMU.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] ahci drive: how to make it non-bootable?
  2012-05-09 16:10           ` Michael Tokarev
  2012-05-10  7:33             ` Paolo Bonzini
@ 2012-05-10 12:27             ` Gleb Natapov
  1 sibling, 0 replies; 9+ messages in thread
From: Gleb Natapov @ 2012-05-10 12:27 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Gerd Hoffmann, qemu-devel

On Wed, May 09, 2012 at 08:10:07PM +0400, Michael Tokarev wrote:
> On 09.05.2012 12:02, Gleb Natapov wrote:
> > On Tue, May 08, 2012 at 09:56:10PM +0400, Michael Tokarev wrote:
> []
> >>> It's two only:
> >>>   -drive if=none,id=<name>,...
> >>>   -device virtio-blk-pci,drive=<name>
> >>
> >> Ok, at least it is not entirely insane :)
> 
> > That's the way you suppose to do that. Does it work if you specify
> > bootindex for virtio this way? If it does then use it. Restoring
> > deprecated hacks is not the way to deal with it. If it does not, then
> > it is a bug that should be fixed.
> 
> Using the "too verbose" version is, well, difficult to type, when
> you have to start many guests - eg, testing etc.  That's why I think
> that 3 options for ahci drives is somewhat insane.
> 
You are complaining to later. Verbose syntax is the only syntax going
forward AFAIK. All other syntaxes are legacy and, as you can see, new
devices will not support them.

But you didn't answer my question :) Does specifying bootindex correctly
solves your problem?

> Technically there is no problem at all at combining, eg, -netdev and
> -device rtl8139, in the same way as current -drive file=foo,if=bar
> works, and it is MUCH easier to type and hence is MUCH user-friendly.
> And much less error-prone, too.
> 
For the record, I do not like this verbosity too.

> I think it'd be a good solution to allow bootindex and some other
> options to be recognizable in context of, eg -drive with if!=none,
> by combining options recognizable from if= with the ones recognizable
> by -drive.  Ditto for -netdev..-device: let -netdev to recognize
> model=, and allow model-specific (e1000|8130|virtio-net-pci|whatever)
> to be recognized as well.  This way there will be no need to specify
> id=foo and netdev=foo, the command line will be shorter and also more
> understandable.
> 
But I do not thing that correct solution is to support multiple command
line syntaxes forever. Lets have one that works even if it is too
verbose.

> Please don't say that the only sane option to start qemu guests is
> to use libvirt.  Qemu has its great value exactly because it allows
> starting guests from command line, which is well-scriptable.
I do not use libvirt. Verbose command line is still scriptable.

> 
> The old hacks which were prematurely removed from qemu-kvm makes the
> life easier for the _user_, which is the main target of the software.
What makes you think it was removed prematurely? If user refuses to
learn proper command line syntax it will not be able to use more things
than bootindex. AHCI for one and IIRC you need verbose syntax to enable
vhost. Changing most of device properties require verbose syntax.

> I'd love to stop using them but sometimes it is not possible.  With
> this extboot thing, qemu-kvm dropped ability to boot from SCSI for
> example, and it turns out there are quite some users of this interface
That's the only example and extboot was never written for booting from
SCSI, that was merely unintended side effect. LSI was always too broken
to be used. Debian would be much better compiling it out from the start
(IMHO).

> exists - despite the fact SCSI is broken, there is a proprietary
virtio-scsi is not broken.

> bootrom exists etc -- we just broke users setups without providing
> viable alternative, which, to my view, is unacceptable.
> 
Use proprietary bootrom.

--
			Gleb.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-10 12:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07 18:48 [Qemu-devel] ahci drive: how to make it non-bootable? Michael Tokarev
2012-05-08  5:20 ` Gerd Hoffmann
2012-05-08  5:45   ` Michael Tokarev
2012-05-08  6:43     ` Gerd Hoffmann
2012-05-08 17:56       ` Michael Tokarev
2012-05-09  8:02         ` Gleb Natapov
2012-05-09 16:10           ` Michael Tokarev
2012-05-10  7:33             ` Paolo Bonzini
2012-05-10 12:27             ` Gleb Natapov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.