Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-20 Thread Laszlo Ersek
On 10/20/15 13:59, Stefano Stabellini wrote:
> On Mon, 19 Oct 2015, Laszlo Ersek wrote:
>> On 10/16/15 21:09, Laszlo Ersek wrote:
>>> On 10/16/15 13:34, Fabio Fantoni wrote:
 Il 16/10/2015 12:47, Stefano Stabellini ha scritto:
> On Fri, 16 Oct 2015, Fabio Fantoni wrote:
>> Il 16/10/2015 12:13, Anthony PERARD ha scritto:
>>> On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:
 Il 15/10/2015 20:02, Anthony PERARD ha scritto:
> On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
>> Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
>>> I would suggest Fabio to avoid AHCI disks altogether and just use
>>> OVMF
>>> with PV disks only and Anthony's patch to libxl to avoid creating
>>> any
>>> IDE disks: http://marc.info/?l=xen-devel=144482080812353.
>>>
>>> Would that work for you?
>> Thanks for the advice, I tried it:
>> https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6
>>
>> I installed W10 pro 64 bit with ide disk, installed the win pv
>> drivers
>> and
>> after changed to xvdX instead hdX, is the only change needed, right?
>> Initial boot is ok (ovmf part about pv disks seems ok) but windows
>> boot
>> fails with problem with pv drivers.
>> In attachment full qemu log with xen_platform trace and domU's xl
>> cfg.
>>
>> Someone have windows domUs with ovmf and pv disks only working?
>> If yes
>> can
>> tell me the difference to understand what can be the problem please?
> When I worked on the PV disk implementation in OVMF, I was able to
> boot
> a Windows 8 with pv disk only.
>
> I don't have access to the guest configuration I was using, but I
> think
> one
> difference would be the viridian setting, I'm pretty sure I did
> not set
> it.
>
 I tried with viridian disabled but did the same thing, looking
 cdrom as
 latest thing before xenbug trace in qemu log I tried also to remove
 it but
 also in this case don't boot correctly, full qemu log in attachment.
 I don't know if is a ovmf thing to improve (like what seems in
 Laszlo and
 Kevin mails) or xen winpv drivers unexpected case, have you tried also
 with
 latest winpv builds? (for exclude regression)
>>> No, I did not tried the latest winpv drivers.
>>>
>>> Sorry I can help much more that that. When I install this win8 guest
>>> tried
>>> to boot it with pv drivers only, that was more than a year ago. I
>>> have not
>>> check if it's still working. (Also I can not try anything more recent,
>>> right now.)
>>>
>> I did many other tests, retrying with ide first boot working but show pv
>> devices not working, I did another reboot (with ide) and pv devices was
>> working, after I retried with pv (xvdX) and boot correctly.
>> After other tests I found that with empty cdrom device (required for xl
>> cd-insert/cd-eject) boot stop at start (tianocore image), same result
>> with ide
>> instead.
>>  From xl cfg:
>> disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']
>>
>> With seabios domU boot also with empty cdrom.
>> In qemu log I found only these that can be related:
>>> xen be: qdisk-51728: error: Could not open image: No such file or
>>> directory
>>> xen be: qdisk-51728: initialise() failed
>> And latest xl dmesg line is:
>>> (d1) Invoking OVMF ...
>> If you need more informations/test tell me and I'll post them.
> Are you saying that without any cdrom drives, it works correctly?
 Yes, I did also another test to be sure, starting with ide, installing
 windows, the pv drivers, rebooting 2 times (with one at boot of time
 boot with ide only and without net and disks pv drivers working) and
 after rebooting with pv disks (xvdX) works.
 With cdrom not empty (with iso) works, with empty not, tried with both
 ide (hdX) and pv (xvdX).
 Empty cdrom not working with ovmf I suppose is ovmf bug or inexpected case.
 About major of winpv drivers problem at boot I suppose can be solved
 improving ovmf and winpv driver removing bad hybrid thing actually, but
 I have too low knowledge to be sure.
 About the problem of pv start after install that requiring at least 2
 reboot can be also a windows 10 problem (only a suppose).

 About empty cdrom with ovmf can be solved please?

>>>
>>> Sorry, I find your problem report impenetrable. :( Please slow down and
>>> try to spend time on punctuation at least.
>>>
>>> For me to make heads or tails of this, I'll need the following:
>>>
>>> - The debug output of an OVMF binary built with the DEBUG_VERBOSE bit

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-20 Thread Stefano Stabellini
On Mon, 19 Oct 2015, Laszlo Ersek wrote:
> On 10/16/15 21:09, Laszlo Ersek wrote:
> > On 10/16/15 13:34, Fabio Fantoni wrote:
> >> Il 16/10/2015 12:47, Stefano Stabellini ha scritto:
> >>> On Fri, 16 Oct 2015, Fabio Fantoni wrote:
>  Il 16/10/2015 12:13, Anthony PERARD ha scritto:
> > On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:
> >> Il 15/10/2015 20:02, Anthony PERARD ha scritto:
> >>> On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
>  Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
> > I would suggest Fabio to avoid AHCI disks altogether and just use
> > OVMF
> > with PV disks only and Anthony's patch to libxl to avoid creating
> > any
> > IDE disks: http://marc.info/?l=xen-devel=144482080812353.
> >
> > Would that work for you?
>  Thanks for the advice, I tried it:
>  https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6
> 
>  I installed W10 pro 64 bit with ide disk, installed the win pv
>  drivers
>  and
>  after changed to xvdX instead hdX, is the only change needed, right?
>  Initial boot is ok (ovmf part about pv disks seems ok) but windows
>  boot
>  fails with problem with pv drivers.
>  In attachment full qemu log with xen_platform trace and domU's xl
>  cfg.
> 
>  Someone have windows domUs with ovmf and pv disks only working?
>  If yes
>  can
>  tell me the difference to understand what can be the problem please?
> >>> When I worked on the PV disk implementation in OVMF, I was able to
> >>> boot
> >>> a Windows 8 with pv disk only.
> >>>
> >>> I don't have access to the guest configuration I was using, but I
> >>> think
> >>> one
> >>> difference would be the viridian setting, I'm pretty sure I did
> >>> not set
> >>> it.
> >>>
> >> I tried with viridian disabled but did the same thing, looking
> >> cdrom as
> >> latest thing before xenbug trace in qemu log I tried also to remove
> >> it but
> >> also in this case don't boot correctly, full qemu log in attachment.
> >> I don't know if is a ovmf thing to improve (like what seems in
> >> Laszlo and
> >> Kevin mails) or xen winpv drivers unexpected case, have you tried also
> >> with
> >> latest winpv builds? (for exclude regression)
> > No, I did not tried the latest winpv drivers.
> >
> > Sorry I can help much more that that. When I install this win8 guest
> > tried
> > to boot it with pv drivers only, that was more than a year ago. I
> > have not
> > check if it's still working. (Also I can not try anything more recent,
> > right now.)
> >
>  I did many other tests, retrying with ide first boot working but show pv
>  devices not working, I did another reboot (with ide) and pv devices was
>  working, after I retried with pv (xvdX) and boot correctly.
>  After other tests I found that with empty cdrom device (required for xl
>  cd-insert/cd-eject) boot stop at start (tianocore image), same result
>  with ide
>  instead.
>   From xl cfg:
>  disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']
> 
>  With seabios domU boot also with empty cdrom.
>  In qemu log I found only these that can be related:
> > xen be: qdisk-51728: error: Could not open image: No such file or
> > directory
> > xen be: qdisk-51728: initialise() failed
>  And latest xl dmesg line is:
> > (d1) Invoking OVMF ...
>  If you need more informations/test tell me and I'll post them.
> >>> Are you saying that without any cdrom drives, it works correctly?
> >> Yes, I did also another test to be sure, starting with ide, installing
> >> windows, the pv drivers, rebooting 2 times (with one at boot of time
> >> boot with ide only and without net and disks pv drivers working) and
> >> after rebooting with pv disks (xvdX) works.
> >> With cdrom not empty (with iso) works, with empty not, tried with both
> >> ide (hdX) and pv (xvdX).
> >> Empty cdrom not working with ovmf I suppose is ovmf bug or inexpected case.
> >> About major of winpv drivers problem at boot I suppose can be solved
> >> improving ovmf and winpv driver removing bad hybrid thing actually, but
> >> I have too low knowledge to be sure.
> >> About the problem of pv start after install that requiring at least 2
> >> reboot can be also a windows 10 problem (only a suppose).
> >>
> >> About empty cdrom with ovmf can be solved please?
> >>
> > 
> > Sorry, I find your problem report impenetrable. :( Please slow down and
> > try to spend time on punctuation at least.
> > 
> > For me to make heads or tails of this, I'll need the following:
> > 
> > - The debug output of an OVMF binary built with the DEBUG_VERBOSE bit
> > (0x0040) enabled in 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-20 Thread Stefano Stabellini
On Tue, 20 Oct 2015, Laszlo Ersek wrote:
> On 10/20/15 13:59, Stefano Stabellini wrote:
> > On Mon, 19 Oct 2015, Laszlo Ersek wrote:
> >> Could that be related to the issue you are experiencing with OVMF?
> >> Because, OVMF implies HVM (or PV-on-HVM), and your report ("empty
> >> paravirt CD-ROM" or some such -- sorry, the report remains unclear)
> >> appears to match the above message.
> >>
> >> Given that this is guest code, shouldn't the same logic be mirrored in
> >> the OVMF guest driver?
> >>
> >> /* do not create a PV cdrom device if we are an HVM guest */
> >>
> >> In other words, given that OVMF implies HVM, shouldn't OVMF too forego
> >> driving a paravirt CD-ROM entirely?
> > 
> > In the case of OVMF I think we can use the PV block interface to access
> > the cdrom, the problem is just that it cannot handle empty cdrom drives
> > at the moment and XenPvBlockFrontInitialization simply returns an error.
> 
> (*)
> 
> > A simple patch like this one should prevent OVMF from getting stuck with
> > an error when an empty cdrom is found:
> > 
> > diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c 
> > b/OvmfPkg/XenPvBlkDxe/BlockFront.c
> > index 256ac55..ae7cab9 100644
> > --- a/OvmfPkg/XenPvBlkDxe/BlockFront.c
> > +++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c
> > @@ -186,6 +186,10 @@ XenPvBlockFrontInitialization (
> >}
> >FreePool (DeviceType);
> >  
> > +  Status = XenBusReadUint64 (XenBusIo, "sectors", TRUE, );
> > +  if (Dev->MediaInfo.CdRom && Status != XENSTORE_STATUS_SUCCESS)
> > + return EFI_NO_MEDIA;
> > +
> >Status = XenBusReadUint64 (XenBusIo, "backend-id", FALSE, );
> >if (Status != XENSTORE_STATUS_SUCCESS || Value > MAX_UINT16) {
> >  DEBUG ((EFI_D_ERROR, "XenPvBlk: Failed to get backend-id (%d)\n",
> 
> (1) Directly returning at that point will leak "Dev". I think you should
> set Status, and then goto Error. XenPvBlockFree() under that label will
> free Dev.

Good idea


> (2) I agree that returning an error code here will propagate through
> XenPvBlkDxeDriverBindingStart() to the caller, and ultimately prevent
> the binding. That's probably the right thing to do.
> 
> But, how does it differ from what you wrote above (*):
>
> > [...] the problem is just that it cannot handle empty cdrom drives
> > at the moment and XenPvBlockFrontInitialization simply returns an
> > error.
> 
> If XenPvBlockFrontInitialization() simply returned an error right now,
> then that would achieve the exact same thing as your proposal -- the
> driver wouldn't bind the device. So either your idea wouldn't make a
> difference, or your analysis that XenPvBlockFrontInitialization()
> currently fails is incorrect.
> 
> I think it's the latter though, and that this patch should be tested.

The patch works, but you are right, the analysis of the problem was
wrong: it gets stuck in XenPvBlkWaitForBackendState, rather than
returning an error.


> If it works in your testing, please submit it to
> . (You have to be subscribed to post, sorry
> about that.) Please fix the leak (1), and add the following line to the
> commit message just before your signoff:
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> 
> What it means is explained in "OvmfPkg/Contributions.txt".

I'll rework the patch and send it to the list.
Thanks,

Stefano



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-19 Thread Laszlo Ersek
On 10/16/15 21:09, Laszlo Ersek wrote:
> On 10/16/15 13:34, Fabio Fantoni wrote:
>> Il 16/10/2015 12:47, Stefano Stabellini ha scritto:
>>> On Fri, 16 Oct 2015, Fabio Fantoni wrote:
 Il 16/10/2015 12:13, Anthony PERARD ha scritto:
> On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:
>> Il 15/10/2015 20:02, Anthony PERARD ha scritto:
>>> On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
 Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
> I would suggest Fabio to avoid AHCI disks altogether and just use
> OVMF
> with PV disks only and Anthony's patch to libxl to avoid creating
> any
> IDE disks: http://marc.info/?l=xen-devel=144482080812353.
>
> Would that work for you?
 Thanks for the advice, I tried it:
 https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6

 I installed W10 pro 64 bit with ide disk, installed the win pv
 drivers
 and
 after changed to xvdX instead hdX, is the only change needed, right?
 Initial boot is ok (ovmf part about pv disks seems ok) but windows
 boot
 fails with problem with pv drivers.
 In attachment full qemu log with xen_platform trace and domU's xl
 cfg.

 Someone have windows domUs with ovmf and pv disks only working?
 If yes
 can
 tell me the difference to understand what can be the problem please?
>>> When I worked on the PV disk implementation in OVMF, I was able to
>>> boot
>>> a Windows 8 with pv disk only.
>>>
>>> I don't have access to the guest configuration I was using, but I
>>> think
>>> one
>>> difference would be the viridian setting, I'm pretty sure I did
>>> not set
>>> it.
>>>
>> I tried with viridian disabled but did the same thing, looking
>> cdrom as
>> latest thing before xenbug trace in qemu log I tried also to remove
>> it but
>> also in this case don't boot correctly, full qemu log in attachment.
>> I don't know if is a ovmf thing to improve (like what seems in
>> Laszlo and
>> Kevin mails) or xen winpv drivers unexpected case, have you tried also
>> with
>> latest winpv builds? (for exclude regression)
> No, I did not tried the latest winpv drivers.
>
> Sorry I can help much more that that. When I install this win8 guest
> tried
> to boot it with pv drivers only, that was more than a year ago. I
> have not
> check if it's still working. (Also I can not try anything more recent,
> right now.)
>
 I did many other tests, retrying with ide first boot working but show pv
 devices not working, I did another reboot (with ide) and pv devices was
 working, after I retried with pv (xvdX) and boot correctly.
 After other tests I found that with empty cdrom device (required for xl
 cd-insert/cd-eject) boot stop at start (tianocore image), same result
 with ide
 instead.
  From xl cfg:
 disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']

 With seabios domU boot also with empty cdrom.
 In qemu log I found only these that can be related:
> xen be: qdisk-51728: error: Could not open image: No such file or
> directory
> xen be: qdisk-51728: initialise() failed
 And latest xl dmesg line is:
> (d1) Invoking OVMF ...
 If you need more informations/test tell me and I'll post them.
>>> Are you saying that without any cdrom drives, it works correctly?
>> Yes, I did also another test to be sure, starting with ide, installing
>> windows, the pv drivers, rebooting 2 times (with one at boot of time
>> boot with ide only and without net and disks pv drivers working) and
>> after rebooting with pv disks (xvdX) works.
>> With cdrom not empty (with iso) works, with empty not, tried with both
>> ide (hdX) and pv (xvdX).
>> Empty cdrom not working with ovmf I suppose is ovmf bug or inexpected case.
>> About major of winpv drivers problem at boot I suppose can be solved
>> improving ovmf and winpv driver removing bad hybrid thing actually, but
>> I have too low knowledge to be sure.
>> About the problem of pv start after install that requiring at least 2
>> reboot can be also a windows 10 problem (only a suppose).
>>
>> About empty cdrom with ovmf can be solved please?
>>
> 
> Sorry, I find your problem report impenetrable. :( Please slow down and
> try to spend time on punctuation at least.
> 
> For me to make heads or tails of this, I'll need the following:
> 
> - The debug output of an OVMF binary built with the DEBUG_VERBOSE bit
> (0x0040) enabled in PcdDebugPrintErrorLevel, in addition to the
> default setting.
> 
> - Preferably, I'll need two logs, one for the "working" case, and
> another for the "non-working" case.
> 
> - A description of the virtual hardware (disks etc) that is
> understandable to someone who 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Laszlo Ersek
On 10/16/15 13:34, Fabio Fantoni wrote:
> Il 16/10/2015 12:47, Stefano Stabellini ha scritto:
>> On Fri, 16 Oct 2015, Fabio Fantoni wrote:
>>> Il 16/10/2015 12:13, Anthony PERARD ha scritto:
 On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:
> Il 15/10/2015 20:02, Anthony PERARD ha scritto:
>> On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
>>> Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
 I would suggest Fabio to avoid AHCI disks altogether and just use
 OVMF
 with PV disks only and Anthony's patch to libxl to avoid creating
 any
 IDE disks: http://marc.info/?l=xen-devel=144482080812353.

 Would that work for you?
>>> Thanks for the advice, I tried it:
>>> https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6
>>>
>>> I installed W10 pro 64 bit with ide disk, installed the win pv
>>> drivers
>>> and
>>> after changed to xvdX instead hdX, is the only change needed, right?
>>> Initial boot is ok (ovmf part about pv disks seems ok) but windows
>>> boot
>>> fails with problem with pv drivers.
>>> In attachment full qemu log with xen_platform trace and domU's xl
>>> cfg.
>>>
>>> Someone have windows domUs with ovmf and pv disks only working?
>>> If yes
>>> can
>>> tell me the difference to understand what can be the problem please?
>> When I worked on the PV disk implementation in OVMF, I was able to
>> boot
>> a Windows 8 with pv disk only.
>>
>> I don't have access to the guest configuration I was using, but I
>> think
>> one
>> difference would be the viridian setting, I'm pretty sure I did
>> not set
>> it.
>>
> I tried with viridian disabled but did the same thing, looking
> cdrom as
> latest thing before xenbug trace in qemu log I tried also to remove
> it but
> also in this case don't boot correctly, full qemu log in attachment.
> I don't know if is a ovmf thing to improve (like what seems in
> Laszlo and
> Kevin mails) or xen winpv drivers unexpected case, have you tried also
> with
> latest winpv builds? (for exclude regression)
 No, I did not tried the latest winpv drivers.

 Sorry I can help much more that that. When I install this win8 guest
 tried
 to boot it with pv drivers only, that was more than a year ago. I
 have not
 check if it's still working. (Also I can not try anything more recent,
 right now.)

>>> I did many other tests, retrying with ide first boot working but show pv
>>> devices not working, I did another reboot (with ide) and pv devices was
>>> working, after I retried with pv (xvdX) and boot correctly.
>>> After other tests I found that with empty cdrom device (required for xl
>>> cd-insert/cd-eject) boot stop at start (tianocore image), same result
>>> with ide
>>> instead.
>>>  From xl cfg:
>>> disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']
>>>
>>> With seabios domU boot also with empty cdrom.
>>> In qemu log I found only these that can be related:
 xen be: qdisk-51728: error: Could not open image: No such file or
 directory
 xen be: qdisk-51728: initialise() failed
>>> And latest xl dmesg line is:
 (d1) Invoking OVMF ...
>>> If you need more informations/test tell me and I'll post them.
>> Are you saying that without any cdrom drives, it works correctly?
> Yes, I did also another test to be sure, starting with ide, installing
> windows, the pv drivers, rebooting 2 times (with one at boot of time
> boot with ide only and without net and disks pv drivers working) and
> after rebooting with pv disks (xvdX) works.
> With cdrom not empty (with iso) works, with empty not, tried with both
> ide (hdX) and pv (xvdX).
> Empty cdrom not working with ovmf I suppose is ovmf bug or inexpected case.
> About major of winpv drivers problem at boot I suppose can be solved
> improving ovmf and winpv driver removing bad hybrid thing actually, but
> I have too low knowledge to be sure.
> About the problem of pv start after install that requiring at least 2
> reboot can be also a windows 10 problem (only a suppose).
> 
> About empty cdrom with ovmf can be solved please?
> 

Sorry, I find your problem report impenetrable. :( Please slow down and
try to spend time on punctuation at least.

For me to make heads or tails of this, I'll need the following:

- The debug output of an OVMF binary built with the DEBUG_VERBOSE bit
(0x0040) enabled in PcdDebugPrintErrorLevel, in addition to the
default setting.

- Preferably, I'll need two logs, one for the "working" case, and
another for the "non-working" case.

- A description of the virtual hardware (disks etc) that is
understandable to someone who hasn't booted Xen in several years; for
both cases above.

- Please try to make an exact, itemized list of the steps you perform
before executing the successful vs. 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:53 hat Paul Durrant geschrieben:
> > > > > > Just tell your admin what virtual hardware you really need. (Or tell
> > > > > > them to give you a proper interface to configure your VMs yourself.)
> > > > > >
> > > > >
> > > > > My point is that the virtual hardware that the OS user wants will
> > > > > change. Before they install PV drivers, they will need emulated
> > > > > device. After installing PV drivers they will want PV devices. Should
> > > > > they really have to contact their cloud provider to make the switch,
> > > > > when at the moment it happens automatically and transparently (the
> > > > > AHCI problem aside)?
> > > >
> > > > My point is that such a magic change shouldn't happen. It doesn't happen
> > > > on real hardware either and people still get things installed to non-IDE
> > > > disks.
> > > >
> > > > There is no reason to install the OS onto a different device than will
> > > > be used later. With Linux, it's no problem at all because the PV drivers
> > > > are already included on the installation media anyway, and on Windows
> > or
> > > > presumably any other OS you can load and install the drivers right from
> > > > the beginning.
> > > >
> > > > In fact, I would be surprised if using xendisk instead of IDE for
> > > > installing Windows didn't result in a noticably faster installation.
> > > >
> > >
> > > It most certainly would, but requiring users do it this way is likely to 
> > > meet
> > some resistance I suspect.
> > 
> > Why do you think so? Installing the PV drivers afterwards doesn't seem
> > easier than just providing them during the installation.
> > 
> 
> My experience of XenServer customers tells me that any form of manual
> intervention during guest install is likely to meet with resistance,
> unfortunately.

Do they consider the guest install complete before they manually
intervene for installing the PV drivers?

I'm no Windows expert, but I'm sure there is a way to automate
installation even when a driver disk is needed.

> > > > Now, if you really insist on providing a legacy interface even to guests
> > > > that eventually use PV drivers, there actually are sane ways to
> > > > implement this. It will be tricky to make that transition now without
> > > > breaking compatibility, but it could have been done from the start.
> > > >
> > > > Sane means for example that you don't open the same image twice (and
> > > > even read-write!) at the same time. This is a recipe for disaster and
> > > > it's surprising that you don't see corrupted images more often.
> > > >
> > >
> > > We don't because unplug is supposed to ensure the emulated device is
> > > gone before the PV frontend is started
> > 
> > The important part is the backend, but it seems that you open the second
> > instance of the image only when starting the PV frontend?
> 
> I believe this is the case, yes.
> 
> > 
> > As long as you don't enable the user to use most of qemu's functionality
> > like starting block jobs (which would keep the IDE instance around even
> > after unplugging the disk), it might actually be safe assuming that the
> > guest cooperates. Not sure what a malicious guest could do, though, as
> > nobody seems to check whether IDE is really unplugged before the second
> > instance is opened.
> 
> The Windows drivers do check. After the unplug Windows is asked to
> re-enumerate the IDE buses and we make sure the disks we expect to be
> gone are really gone.

You can't use guest code to protect against malicious guests.

> > raw and qcow2 should be safe these days, but in
> > earlier times it would probably have been possible for the guest to
> > overwrite the image header and access arbitrary files on the host as
> > backing file. It might still be true for other image formats.
> > 
> > > > So if you wanted to have a clean solution, try to think how real
> > > > hardware would solve the problem. If you want me to suggest something
> > > > off the top of my head, I would come up with an extended IDE device
> > (one
> > > > single device!) that provides the IDE I/O ports and additionally some
> > > > MMIO BAR that enables access to PV functionality.
> > > >
> > > > Once you enable PV functionality, the IDE ports stop working; device
> > > > reset disables the PV ring and goes back to IDE mode. No hard disk
> > > > suddenly disappearing from the machine, no image corruption if the IDE
> > > > device is written to before enabling PV, etc.
> > > >
> > >
> > > That's not sufficient though. The IDE device must not be enumerated by
> > > the OS and, in Windows at least, that enumeration occurs before the PV
> > > frontend has started up.
> > 
> > The trick is that it's only a single device, so there is no second
> > device that must be prevented from being enumerated. You provide a
> > driver for this specific IDE controller, so Windows wouldn't even try
> > the generic IDE driver when your driver is available.
> > 
> 
> But the whole point is that we want Windows to use the 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Fabio Fantoni

Il 16/10/2015 12:13, Anthony PERARD ha scritto:

On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:

Il 15/10/2015 20:02, Anthony PERARD ha scritto:

On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:

Il 14/10/2015 13:06, Stefano Stabellini ha scritto:

I would suggest Fabio to avoid AHCI disks altogether and just use OVMF
with PV disks only and Anthony's patch to libxl to avoid creating any
IDE disks: http://marc.info/?l=xen-devel=144482080812353.

Would that work for you?

Thanks for the advice, I tried it:
https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6

I installed W10 pro 64 bit with ide disk, installed the win pv drivers and
after changed to xvdX instead hdX, is the only change needed, right?
Initial boot is ok (ovmf part about pv disks seems ok) but windows boot
fails with problem with pv drivers.
In attachment full qemu log with xen_platform trace and domU's xl cfg.

Someone have windows domUs with ovmf and pv disks only working? If yes can
tell me the difference to understand what can be the problem please?

When I worked on the PV disk implementation in OVMF, I was able to boot
a Windows 8 with pv disk only.

I don't have access to the guest configuration I was using, but I think one
difference would be the viridian setting, I'm pretty sure I did not set it.


I tried with viridian disabled but did the same thing, looking cdrom as
latest thing before xenbug trace in qemu log I tried also to remove it but
also in this case don't boot correctly, full qemu log in attachment.
I don't know if is a ovmf thing to improve (like what seems in Laszlo and
Kevin mails) or xen winpv drivers unexpected case, have you tried also with
latest winpv builds? (for exclude regression)

No, I did not tried the latest winpv drivers.

Sorry I can help much more that that. When I install this win8 guest tried
to boot it with pv drivers only, that was more than a year ago. I have not
check if it's still working. (Also I can not try anything more recent,
right now.)



I did many other tests, retrying with ide first boot working but show pv 
devices not working, I did another reboot (with ide) and pv devices was 
working, after I retried with pv (xvdX) and boot correctly.
After other tests I found that with empty cdrom device (required for xl 
cd-insert/cd-eject) boot stop at start (tianocore image), same result 
with ide instead.
From xl cfg: 
disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']

With seabios domU boot also with empty cdrom.
In qemu log I found only these that can be related:
xen be: qdisk-51728: error: Could not open image: No such file or 
directory

xen be: qdisk-51728: initialise() failed

And latest xl dmesg line is:

(d1) Invoking OVMF ...


If you need more informations/test tell me and I'll post them.

Thanks for any reply and sorry for my bad english.



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Stefano Stabellini
On Fri, 16 Oct 2015, Fabio Fantoni wrote:
> Il 16/10/2015 12:13, Anthony PERARD ha scritto:
> > On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote:
> > > Il 15/10/2015 20:02, Anthony PERARD ha scritto:
> > > > On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
> > > > > Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
> > > > > > I would suggest Fabio to avoid AHCI disks altogether and just use
> > > > > > OVMF
> > > > > > with PV disks only and Anthony's patch to libxl to avoid creating
> > > > > > any
> > > > > > IDE disks: http://marc.info/?l=xen-devel=144482080812353.
> > > > > > 
> > > > > > Would that work for you?
> > > > > Thanks for the advice, I tried it:
> > > > > https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6
> > > > > 
> > > > > I installed W10 pro 64 bit with ide disk, installed the win pv drivers
> > > > > and
> > > > > after changed to xvdX instead hdX, is the only change needed, right?
> > > > > Initial boot is ok (ovmf part about pv disks seems ok) but windows
> > > > > boot
> > > > > fails with problem with pv drivers.
> > > > > In attachment full qemu log with xen_platform trace and domU's xl cfg.
> > > > > 
> > > > > Someone have windows domUs with ovmf and pv disks only working? If yes
> > > > > can
> > > > > tell me the difference to understand what can be the problem please?
> > > > When I worked on the PV disk implementation in OVMF, I was able to boot
> > > > a Windows 8 with pv disk only.
> > > > 
> > > > I don't have access to the guest configuration I was using, but I think
> > > > one
> > > > difference would be the viridian setting, I'm pretty sure I did not set
> > > > it.
> > > > 
> > > I tried with viridian disabled but did the same thing, looking cdrom as
> > > latest thing before xenbug trace in qemu log I tried also to remove it but
> > > also in this case don't boot correctly, full qemu log in attachment.
> > > I don't know if is a ovmf thing to improve (like what seems in Laszlo and
> > > Kevin mails) or xen winpv drivers unexpected case, have you tried also
> > > with
> > > latest winpv builds? (for exclude regression)
> > No, I did not tried the latest winpv drivers.
> > 
> > Sorry I can help much more that that. When I install this win8 guest tried
> > to boot it with pv drivers only, that was more than a year ago. I have not
> > check if it's still working. (Also I can not try anything more recent,
> > right now.)
> > 
> 
> I did many other tests, retrying with ide first boot working but show pv
> devices not working, I did another reboot (with ide) and pv devices was
> working, after I retried with pv (xvdX) and boot correctly.
> After other tests I found that with empty cdrom device (required for xl
> cd-insert/cd-eject) boot stop at start (tianocore image), same result with ide
> instead.
> From xl cfg:
> disk=['/mnt/vm/disks/W10UEFI.disk1.cow-sn1,qcow2,xvda,rw',',raw,xvdb,ro,cdrom']
> With seabios domU boot also with empty cdrom.
> In qemu log I found only these that can be related:
> > xen be: qdisk-51728: error: Could not open image: No such file or directory
> > xen be: qdisk-51728: initialise() failed
> And latest xl dmesg line is:
> > (d1) Invoking OVMF ...
> 
> If you need more informations/test tell me and I'll post them.

Are you saying that without any cdrom drives, it works correctly?



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > -Original Message-
> > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > Sent: 14 October 2015 12:12
> > To: Kevin Wolf; Stefano Stabellini
> > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> > missed in qemu
> > 
> > 
> > 
> > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > [ CC qemu-block ]
> > >
> > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > >> On Tue, 13 Oct 2015, John Snow wrote:
> > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> >  I added ahci disk support in libxl and using it for week seems that was
> >  ok, after a reply of Stefano Stabellini seems that xen disk unplug
> >  support only ide disks:
> > 
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > c905374ee8663d5d8
> > 
> >  Today Paul Durrant told me that even if pv disk is ok also with ahci 
> >  and
> >  the emulated one is offline can be a risk:
> >  http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> > 10/msg00021.html
> > 
> > 
> >  I tried to take a fast look in qemu code but I not understand the
> > needed
> >  thing for add the xen disk unplug support also for ahci, can someone do
> >  it or tell me useful information for do it please?
> > 
> >  Thanks for any reply and sorry for my bad english.
> > 
> > >>> I'm not entirely sure what features you need AHCI to support in order
> > >>> for Xen to be happy.
> > >>>
> > >>> I'd guess hotplugging, but where I get confused is that IDE disks don't
> > >>> support hotplugging either, so I guess I'm not sure sure what you need.
> > >>>
> > >>> Stefano, can you help bridge my Xen knowledge gap?
> > >>
> > >> Hi John,
> > >>
> > >> we need something like hw/i386/xen/xen_platform.c:unplug_disks but
> > that
> > >> can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > >> pci_piix3_xen_ide_unplug does for ide.
> > > Maybe this would be the right time to stop the craziness with your
> > > hybrid IDE/xendisk setup. It's a horrible thing that would never happen
> > > on real hardware.
> 
> Unfortunately, it's going to be difficult to remove such 'craziness' when you 
> don't know a priori whether the VM has PV drivers or not. 

Why wouldn't you know that beforehand? I mean, even on real hardware you
can have different disk interfaces (IDE, AHCI, SCSI) and you install
the exact driver that your hardware needs. You just do the same thing on
VM: If your hardware is PV, you install a PV driver. If your hardware is
IDE, you install an IDE driver. Whether it's PV or IDE is something that
you, the user, decided when configuring the VM, so you definitely know.

Kevin



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message-
> From: Kevin Wolf [mailto:kw...@redhat.com]
> Sent: 16 October 2015 16:02
> To: Paul Durrant
> Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> missed in qemu
> 
> Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > > -Original Message-
> > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > Sent: 16 October 2015 15:04
> > > To: Paul Durrant
> > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> ahci
> > > missed in qemu
> > >
> > > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > > -Original Message-
> > > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > > Sent: 14 October 2015 12:12
> > > > > To: Kevin Wolf; Stefano Stabellini
> > > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support
> for
> > > ahci
> > > > > missed in qemu
> > > > >
> > > > >
> > > > >
> > > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > > [ CC qemu-block ]
> > > > > >
> > > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > >>>> I added ahci disk support in libxl and using it for week seems
> that
> > > was
> > > > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk 
> > > > > >>>> unplug
> > > > > >>>> support only ide disks:
> > > > > >>>>
> > > > >
> > >
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > > c905374ee8663d5d8
> > > > > >>>>
> > > > > >>>> Today Paul Durrant told me that even if pv disk is ok also with
> ahci
> > > and
> > > > > >>>> the emulated one is offline can be a risk:
> > > > > >>>> http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> > > > > 10/msg00021.html
> > > > > >>>>
> > > > > >>>>
> > > > > >>>> I tried to take a fast look in qemu code but I not understand the
> > > > > needed
> > > > > >>>> thing for add the xen disk unplug support also for ahci, can
> > > someone do
> > > > > >>>> it or tell me useful information for do it please?
> > > > > >>>>
> > > > > >>>> Thanks for any reply and sorry for my bad english.
> > > > > >>>>
> > > > > >>> I'm not entirely sure what features you need AHCI to support in
> > > order
> > > > > >>> for Xen to be happy.
> > > > > >>>
> > > > > >>> I'd guess hotplugging, but where I get confused is that IDE disks
> don't
> > > > > >>> support hotplugging either, so I guess I'm not sure sure what you
> > > need.
> > > > > >>>
> > > > > >>> Stefano, can you help bridge my Xen knowledge gap?
> > > > > >>
> > > > > >> Hi John,
> > > > > >>
> > > > > >> we need something like
> hw/i386/xen/xen_platform.c:unplug_disks
> > > but
> > > > > that
> > > > > >> can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > > > > >> pci_piix3_xen_ide_unplug does for ide.
> > > > > > Maybe this would be the right time to stop the craziness with your
> > > > > > hybrid IDE/xendisk setup. It's a horrible thing that would never
> happen
> > > > > > on real hardware.
> > > >
> > > > Unfortunately, it's going to be difficult to remove such 'crazine

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > -Original Message-
> > From: Kevin Wolf [mailto:kw...@redhat.com]
> > Sent: 16 October 2015 15:04
> > To: Paul Durrant
> > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> > missed in qemu
> > 
> > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > -Original Message-
> > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > Sent: 14 October 2015 12:12
> > > > To: Kevin Wolf; Stefano Stabellini
> > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> > ahci
> > > > missed in qemu
> > > >
> > > >
> > > >
> > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > [ CC qemu-block ]
> > > > >
> > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > >>>> I added ahci disk support in libxl and using it for week seems that
> > was
> > > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk unplug
> > > > >>>> support only ide disks:
> > > > >>>>
> > > >
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > c905374ee8663d5d8
> > > > >>>>
> > > > >>>> Today Paul Durrant told me that even if pv disk is ok also with 
> > > > >>>> ahci
> > and
> > > > >>>> the emulated one is offline can be a risk:
> > > > >>>> http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> > > > 10/msg00021.html
> > > > >>>>
> > > > >>>>
> > > > >>>> I tried to take a fast look in qemu code but I not understand the
> > > > needed
> > > > >>>> thing for add the xen disk unplug support also for ahci, can
> > someone do
> > > > >>>> it or tell me useful information for do it please?
> > > > >>>>
> > > > >>>> Thanks for any reply and sorry for my bad english.
> > > > >>>>
> > > > >>> I'm not entirely sure what features you need AHCI to support in
> > order
> > > > >>> for Xen to be happy.
> > > > >>>
> > > > >>> I'd guess hotplugging, but where I get confused is that IDE disks 
> > > > >>> don't
> > > > >>> support hotplugging either, so I guess I'm not sure sure what you
> > need.
> > > > >>>
> > > > >>> Stefano, can you help bridge my Xen knowledge gap?
> > > > >>
> > > > >> Hi John,
> > > > >>
> > > > >> we need something like hw/i386/xen/xen_platform.c:unplug_disks
> > but
> > > > that
> > > > >> can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > > > >> pci_piix3_xen_ide_unplug does for ide.
> > > > > Maybe this would be the right time to stop the craziness with your
> > > > > hybrid IDE/xendisk setup. It's a horrible thing that would never 
> > > > > happen
> > > > > on real hardware.
> > >
> > > Unfortunately, it's going to be difficult to remove such 'craziness' when 
> > > you
> > don't know a priori whether the VM has PV drivers or not.
> > 
> > Why wouldn't you know that beforehand? I mean, even on real hardware
> > you
> > can have different disk interfaces (IDE, AHCI, SCSI) and you install
> > the exact driver that your hardware needs. You just do the same thing on
> > VM: If your hardware is PV, you install a PV driver. If your hardware is
> > IDE, you install an IDE driver. Whether it's PV or IDE is something that
> > you, the user, decided when configuring the VM, so you definitely know.
> > 
> 
> That's not necessarily true. The host admin that provisions the VM does not 
> necessarily know what OS 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message-
> From: Kevin Wolf [mailto:kw...@redhat.com]
> Sent: 16 October 2015 15:04
> To: Paul Durrant
> Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> missed in qemu
> 
> Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > -Original Message-
> > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > Sent: 14 October 2015 12:12
> > > To: Kevin Wolf; Stefano Stabellini
> > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> ahci
> > > missed in qemu
> > >
> > >
> > >
> > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > [ CC qemu-block ]
> > > >
> > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > >>>> I added ahci disk support in libxl and using it for week seems that
> was
> > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk unplug
> > > >>>> support only ide disks:
> > > >>>>
> > >
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > c905374ee8663d5d8
> > > >>>>
> > > >>>> Today Paul Durrant told me that even if pv disk is ok also with ahci
> and
> > > >>>> the emulated one is offline can be a risk:
> > > >>>> http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> > > 10/msg00021.html
> > > >>>>
> > > >>>>
> > > >>>> I tried to take a fast look in qemu code but I not understand the
> > > needed
> > > >>>> thing for add the xen disk unplug support also for ahci, can
> someone do
> > > >>>> it or tell me useful information for do it please?
> > > >>>>
> > > >>>> Thanks for any reply and sorry for my bad english.
> > > >>>>
> > > >>> I'm not entirely sure what features you need AHCI to support in
> order
> > > >>> for Xen to be happy.
> > > >>>
> > > >>> I'd guess hotplugging, but where I get confused is that IDE disks 
> > > >>> don't
> > > >>> support hotplugging either, so I guess I'm not sure sure what you
> need.
> > > >>>
> > > >>> Stefano, can you help bridge my Xen knowledge gap?
> > > >>
> > > >> Hi John,
> > > >>
> > > >> we need something like hw/i386/xen/xen_platform.c:unplug_disks
> but
> > > that
> > > >> can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > > >> pci_piix3_xen_ide_unplug does for ide.
> > > > Maybe this would be the right time to stop the craziness with your
> > > > hybrid IDE/xendisk setup. It's a horrible thing that would never happen
> > > > on real hardware.
> >
> > Unfortunately, it's going to be difficult to remove such 'craziness' when 
> > you
> don't know a priori whether the VM has PV drivers or not.
> 
> Why wouldn't you know that beforehand? I mean, even on real hardware
> you
> can have different disk interfaces (IDE, AHCI, SCSI) and you install
> the exact driver that your hardware needs. You just do the same thing on
> VM: If your hardware is PV, you install a PV driver. If your hardware is
> IDE, you install an IDE driver. Whether it's PV or IDE is something that
> you, the user, decided when configuring the VM, so you definitely know.
> 

That's not necessarily true. The host admin that provisions the VM does not 
necessarily know what OS the user of that VM will install. The admin may just 
be providing a generic VM with an emulated CD drive that the user can point at 
any ISO they want.

So, as a host admin, if you provide a VM with only PV backends and your user is 
trying to boot an OS with no PV drivers they are not going to be happy, so you 
provide emulated devices. Then, at some point later, when the user installs PV 
drivers, there really should be some way for those drivers to start up without 
any need to contact the host admin and have the VM reconfigured.

  Paul

> Kevin



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben:
> > -Original Message-
> > From: Kevin Wolf [mailto:kw...@redhat.com]
> > Sent: 16 October 2015 16:02
> > To: Paul Durrant
> > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> > missed in qemu
> > 
> > Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > > > -Original Message-
> > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > Sent: 16 October 2015 15:04
> > > > To: Paul Durrant
> > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> > ahci
> > > > missed in qemu
> > > >
> > > > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > > > -Original Message-
> > > > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > > > Sent: 14 October 2015 12:12
> > > > > > To: Kevin Wolf; Stefano Stabellini
> > > > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support
> > for
> > > > ahci
> > > > > > missed in qemu
> > > > > >
> > > > > >
> > > > > >
> > > > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > > > [ CC qemu-block ]
> > > > > > >
> > > > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > > >>>> I added ahci disk support in libxl and using it for week seems
> > that
> > > > was
> > > > > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk 
> > > > > > >>>> unplug
> > > > > > >>>> support only ide disks:
> > > > > > >>>>
> > > > > >
> > > >
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > > > c905374ee8663d5d8
> > > > > > >>>>
> > > > > > >>>> Today Paul Durrant told me that even if pv disk is ok also with
> > ahci
> > > > and
> > > > > > >>>> the emulated one is offline can be a risk:
> > > > > > >>>> http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> > > > > > 10/msg00021.html
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>> I tried to take a fast look in qemu code but I not understand 
> > > > > > >>>> the
> > > > > > needed
> > > > > > >>>> thing for add the xen disk unplug support also for ahci, can
> > > > someone do
> > > > > > >>>> it or tell me useful information for do it please?
> > > > > > >>>>
> > > > > > >>>> Thanks for any reply and sorry for my bad english.
> > > > > > >>>>
> > > > > > >>> I'm not entirely sure what features you need AHCI to support in
> > > > order
> > > > > > >>> for Xen to be happy.
> > > > > > >>>
> > > > > > >>> I'd guess hotplugging, but where I get confused is that IDE 
> > > > > > >>> disks
> > don't
> > > > > > >>> support hotplugging either, so I guess I'm not sure sure what 
> > > > > > >>> you
> > > > need.
> > > > > > >>>
> > > > > > >>> Stefano, can you help bridge my Xen knowledge gap?
> > > > > > >>
> > > > > > >> Hi John,
> > > > > > >>
> > > > > > >> we need something like
> > hw/i386/xen/xen_plat

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message-
> From: Kevin Wolf [mailto:kw...@redhat.com]
> Sent: 16 October 2015 17:12
> To: Paul Durrant
> Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> missed in qemu
> 
> Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben:
> > > -Original Message-
> > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > Sent: 16 October 2015 16:02
> > > To: Paul Durrant
> > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> ahci
> > > missed in qemu
> > >
> > > Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > > > > -Original Message-
> > > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > > Sent: 16 October 2015 15:04
> > > > > To: Paul Durrant
> > > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard;
> qemu-
> > > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-
> bl...@nongnu.org
> > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support
> for
> > > ahci
> > > > > missed in qemu
> > > > >
> > > > > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > > > > -Original Message-
> > > > > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > > > > Sent: 14 October 2015 12:12
> > > > > > > To: Kevin Wolf; Stefano Stabellini
> > > > > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > > > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug
> support
> > > for
> > > > > ahci
> > > > > > > missed in qemu
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > > > > [ CC qemu-block ]
> > > > > > > >
> > > > > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > > > >>>> I added ahci disk support in libxl and using it for week 
> > > > > > > >>>> seems
> > > that
> > > > > was
> > > > > > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk
> unplug
> > > > > > > >>>> support only ide disks:
> > > > > > > >>>>
> > > > > > >
> > > > >
> > >
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > > > > c905374ee8663d5d8
> > > > > > > >>>>
> > > > > > > >>>> Today Paul Durrant told me that even if pv disk is ok also
> with
> > > ahci
> > > > > and
> > > > > > > >>>> the emulated one is offline can be a risk:
> > > > > > > >>>> http://lists.xenproject.org/archives/html/win-pv-
> devel/2015-
> > > > > > > 10/msg00021.html
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>>> I tried to take a fast look in qemu code but I not understand
> the
> > > > > > > needed
> > > > > > > >>>> thing for add the xen disk unplug support also for ahci, can
> > > > > someone do
> > > > > > > >>>> it or tell me useful information for do it please?
> > > > > > > >>>>
> > > > > > > >>>> Thanks for any reply and sorry for my bad english.
> > > > > > > >>>>
> > > > > > > >>> I'm not entirely sure what features you need AHCI to support
> in
> > > > > order
> > > > > > > >>> for Xen to 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:20 hat Paul Durrant geschrieben:
> > -Original Message-
> > From: Kevin Wolf [mailto:kw...@redhat.com]
> > Sent: 16 October 2015 17:12
> > To: Paul Durrant
> > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> > missed in qemu
> > 
> > Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben:
> > > > -Original Message-
> > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > Sent: 16 October 2015 16:02
> > > > To: Paul Durrant
> > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> > ahci
> > > > missed in qemu
> > > >
> > > > Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > > > > > -Original Message-
> > > > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > > > Sent: 16 October 2015 15:04
> > > > > > To: Paul Durrant
> > > > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard;
> > qemu-
> > > > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-
> > bl...@nongnu.org
> > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support
> > for
> > > > ahci
> > > > > > missed in qemu
> > > > > >
> > > > > > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > > > > > -Original Message-
> > > > > > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > > > > > Sent: 14 October 2015 12:12
> > > > > > > > To: Kevin Wolf; Stefano Stabellini
> > > > > > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> > > > > > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug
> > support
> > > > for
> > > > > > ahci
> > > > > > > > missed in qemu
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > > > > > [ CC qemu-block ]
> > > > > > > > >
> > > > > > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > > > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > > > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > > > > >>>> I added ahci disk support in libxl and using it for week 
> > > > > > > > >>>> seems
> > > > that
> > > > > > was
> > > > > > > > >>>> ok, after a reply of Stefano Stabellini seems that xen disk
> > unplug
> > > > > > > > >>>> support only ide disks:
> > > > > > > > >>>>
> > > > > > > >
> > > > > >
> > > >
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > > > > > c905374ee8663d5d8
> > > > > > > > >>>>
> > > > > > > > >>>> Today Paul Durrant told me that even if pv disk is ok also
> > with
> > > > ahci
> > > > > > and
> > > > > > > > >>>> the emulated one is offline can be a risk:
> > > > > > > > >>>> http://lists.xenproject.org/archives/html/win-pv-
> > devel/2015-
> > > > > > > > 10/msg00021.html
> > > > > > > > >>>>
> > > > > > > > >>>>
> > > > > > > > >>>> I tried to take a fast look in qemu code but I not 
> > > > > > > > >>>> understand
> > the
> > > > > > > > needed
> > > > > > > > >>>> thing for add the xen disk unplug support also for ahci, 
> > > > > &

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message-
> From: Kevin Wolf [mailto:kw...@redhat.com]
> Sent: 16 October 2015 17:43
> To: Paul Durrant
> Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> missed in qemu
> 
> Am 16.10.2015 um 18:20 hat Paul Durrant geschrieben:
> > > -Original Message-
> > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > Sent: 16 October 2015 17:12
> > > To: Paul Durrant
> > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu-
> > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org
> > > Subject: Re: [Qemu-devel] Question about xen disk unplug support for
> ahci
> > > missed in qemu
> > >
> > > Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben:
> > > > > -Original Message-
> > > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > > Sent: 16 October 2015 16:02
> > > > > To: Paul Durrant
> > > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard;
> qemu-
> > > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-
> bl...@nongnu.org
> > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug support
> for
> > > ahci
> > > > > missed in qemu
> > > > >
> > > > > Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben:
> > > > > > > -Original Message-
> > > > > > > From: Kevin Wolf [mailto:kw...@redhat.com]
> > > > > > > Sent: 16 October 2015 15:04
> > > > > > > To: Paul Durrant
> > > > > > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard;
> > > qemu-
> > > > > > > de...@nongnu.org; xen-de...@lists.xen.org; qemu-
> > > bl...@nongnu.org
> > > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug
> support
> > > for
> > > > > ahci
> > > > > > > missed in qemu
> > > > > > >
> > > > > > > Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben:
> > > > > > > > > -Original Message-
> > > > > > > > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> > > > > > > > > Sent: 14 October 2015 12:12
> > > > > > > > > To: Kevin Wolf; Stefano Stabellini
> > > > > > > > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org;
> xen-
> > > > > > > > > de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> > > > > > > > > Subject: Re: [Qemu-devel] Question about xen disk unplug
> > > support
> > > > > for
> > > > > > > ahci
> > > > > > > > > missed in qemu
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > > > > > > > > > [ CC qemu-block ]
> > > > > > > > > >
> > > > > > > > > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > > > > > > >> On Tue, 13 Oct 2015, John Snow wrote:
> > > > > > > > > >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > > > > > >>>> I added ahci disk support in libxl and using it for week
> seems
> > > > > that
> > > > > > > was
> > > > > > > > > >>>> ok, after a reply of Stefano Stabellini seems that xen 
> > > > > > > > > >>>> disk
> > > unplug
> > > > > > > > > >>>> support only ide disks:
> > > > > > > > > >>>>
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> > > > > > > > > c905374ee8663d5d8
> > > > > > > > > >>>>
> > > > > > > > > >>>> Today Paul Durrant told me that even if pv disk is ok 
> > > > > > > > > >>>>

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Laszlo Ersek
On 10/14/15 14:48, Paul Durrant wrote:
>> -Original Message-
>> From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
>> Sent: 14 October 2015 12:12
>> To: Kevin Wolf; Stefano Stabellini
>> Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
>> de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
>> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
>> missed in qemu
>>
>>
>>
>> Il 14/10/2015 11:47, Kevin Wolf ha scritto:
>>> [ CC qemu-block ]
>>>
>>> Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
 On Tue, 13 Oct 2015, John Snow wrote:
> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
>> I added ahci disk support in libxl and using it for week seems that was
>> ok, after a reply of Stefano Stabellini seems that xen disk unplug
>> support only ide disks:
>>
>> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
>> c905374ee8663d5d8
>>
>> Today Paul Durrant told me that even if pv disk is ok also with ahci and
>> the emulated one is offline can be a risk:
>> http://lists.xenproject.org/archives/html/win-pv-devel/2015-
>> 10/msg00021.html
>>
>>
>> I tried to take a fast look in qemu code but I not understand the
>> needed
>> thing for add the xen disk unplug support also for ahci, can someone do
>> it or tell me useful information for do it please?
>>
>> Thanks for any reply and sorry for my bad english.
>>
> I'm not entirely sure what features you need AHCI to support in order
> for Xen to be happy.
>
> I'd guess hotplugging, but where I get confused is that IDE disks don't
> support hotplugging either, so I guess I'm not sure sure what you need.
>
> Stefano, can you help bridge my Xen knowledge gap?

 Hi John,

 we need something like hw/i386/xen/xen_platform.c:unplug_disks but
>> that
 can unplug AHCI disk. And by unplug, I mean "make disappear" like
 pci_piix3_xen_ide_unplug does for ide.
>>> Maybe this would be the right time to stop the craziness with your
>>> hybrid IDE/xendisk setup. It's a horrible thing that would never happen
>>> on real hardware.
> 
> Unfortunately, it's going to be difficult to remove such 'craziness' when you 
> don't know a priori whether the VM has PV drivers or not. 
> 
>>>
>>> Can't you just teach SeaBIOS how to deal with your PV disks and then
>>> only add that to your VM and forget about IDE/AHCI? I mean, that's how
>>> it's done for virtio-blk, and it doesn't involve any insanities like
>>> ripping out non-hotpluggable devices.
>>>
> 
> Does Windows have in-box virtio-blk drivers? If not, how does it boot?

The firmwares have virtio drivers (SeaBIOS and OVMF). The Windows
installer can be booted far enough, on top of the firmware services,
that Windows explicitly asks for a driver disk -- not only for the
installation *target* disk, but even for the CD-ROM that it is being
installed *from*.

In practice, you can install modern Windows (Windows 8 and later
definitely, I *think* maybe even Windows 7), from a virtio-scsi CD-ROM,
to, say, a virtio-block disk, and provide *only* the virtio drivers on a
separate IDE CD-ROM (which you can later remove completely, on the
device level).

The Windows installer's boot loader loads an initial ramdisk into
memory, using firmware services. Then its kernel starts and has access
to a number of basic drivers, like IDE CD-ROM drivers. That is
sufficient to load the virtio-scsi driver from the virtio-win ISO, and
then the installation can continue from the original virtio-scsi CD-ROM.

I always install windows guests like this; it is quite flexible. (In
brief: 1 virtio-block target disk, 1 virtio-scsi CD-ROM holding the
Windows ISO, 1 IDE CD-ROM (to be removed permanently from the guest
config, later) holding the virtio-win driver ISO.)

> 
>>> Hm... How does a reboot of a machine that had its IDE already removed
>>> actually work? Do you restart the qemu process on reboot?
>>>
> 
> The IDE disks are always present during boot, but before the OS
> enumerates them they are 'unplugged' and then PV drivers are used
> instead.

Supporting this in RHEL-5 and RHEL-6 guests was *incredible* pain.

Also, when you consider kexec / kdump in the guest, that was an unending
source of bug reports. If I recall correctly, the PV devices (net and
block) could not be used by the kdump kernel, because the main (crashed)
kernel may have left them in a bad state (and I'm not sure if it was
possible to reinit them.) And the emulated devices were slow... assuming
the kdump kernel didn't try to unplug them first!

(Maybe Vitaly (CC'd) knows more about the current status in this area;
I'm admittedly fuzzy, sorry. My intent is not to spread FUD.)

(I'll also admit that running kdump in the guest (that's already
crashed) is a bad idea in general, given that the host is there right
under it, capable of dumping the guests memory without issues. Maybe not
so flexible for some 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Fabio Fantoni

Il 14/10/2015 13:06, Stefano Stabellini ha scritto:

On Wed, 14 Oct 2015, Kevin Wolf wrote:

[ CC qemu-block ]

Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:

On Tue, 13 Oct 2015, John Snow wrote:

On 10/13/2015 11:55 AM, Fabio Fantoni wrote:

I added ahci disk support in libxl and using it for week seems that was
ok, after a reply of Stefano Stabellini seems that xen disk unplug
support only ide disks:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39c905374ee8663d5d8

Today Paul Durrant told me that even if pv disk is ok also with ahci and
the emulated one is offline can be a risk:
http://lists.xenproject.org/archives/html/win-pv-devel/2015-10/msg00021.html


I tried to take a fast look in qemu code but I not understand the needed
thing for add the xen disk unplug support also for ahci, can someone do
it or tell me useful information for do it please?

Thanks for any reply and sorry for my bad english.


I'm not entirely sure what features you need AHCI to support in order
for Xen to be happy.

I'd guess hotplugging, but where I get confused is that IDE disks don't
support hotplugging either, so I guess I'm not sure sure what you need.

Stefano, can you help bridge my Xen knowledge gap?
  
Hi John,


we need something like hw/i386/xen/xen_platform.c:unplug_disks but that
can unplug AHCI disk. And by unplug, I mean "make disappear" like
pci_piix3_xen_ide_unplug does for ide.

Maybe this would be the right time to stop the craziness with your
hybrid IDE/xendisk setup. It's a horrible thing that would never happen
on real hardware.

I would be quite happy to stop (or even get rid of) the craziness.



Can't you just teach SeaBIOS how to deal with your PV disks and then
only add that to your VM and forget about IDE/AHCI? I mean, that's how
it's done for virtio-blk, and it doesn't involve any insanities like
ripping out non-hotpluggable devices.

Teaching SeaBIOS to deal with PV disks can be done, in fact we already
support PV disks in OVMF. It is possible to boot Windows with OVMF
without any IDE disks (patch pending for libxl to create a VM without
emulated IDE disks).

However we have to be honest that implementing PV disk support in
SeaBIOS is a different magnitude of effort compared to implementing AHCI
"unplug".

I would suggest Fabio to avoid AHCI disks altogether and just use OVMF
with PV disks only and Anthony's patch to libxl to avoid creating any
IDE disks: http://marc.info/?l=xen-devel=144482080812353.

Would that work for you?


Thanks for the advice, I tried it:
https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6

I installed W10 pro 64 bit with ide disk, installed the win pv drivers 
and after changed to xvdX instead hdX, is the only change needed, right?
Initial boot is ok (ovmf part about pv disks seems ok) but windows boot 
fails with problem with pv drivers.

In attachment full qemu log with xen_platform trace and domU's xl cfg.

Someone have windows domUs with ovmf and pv disks only working? If yes 
can tell me the difference to understand what can be the problem please?






Hm... How does a reboot of a machine that had its IDE already removed
actually work? Do you restart the qemu process on reboot?

Restart QEMU, yes.


main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 8.258000 ms, bitrate 727789623 
bps (694.074271 Mbps)
inputs_connect: inputs channel client create
red_dispatcher_set_cursor_peer: 
xen_platform_log xen platform: XEN|DllInitialize: 8.2.0 (80) (17.09.2015)
xen_platform_log xen platform: XEN|AcpiFindRsdp: 0x000EA020
xen_platform_log xen platform: XEN|SystemGetStartOptions:  TESTSIGNING  
NOEXECUTE=OPTIN  NOVGA
xen_platform_log xen platform: XEN|SystemGetVersionInformation: KERNEL: 10.0 
(BUILD 10240) PLATFORM WIN32_NT (x64)
xen_platform_log xen platform: XEN|SystemGetVersionInformation: SUITES:
xen_platform_log xen platform: XEN|SystemGetVersionInformation: - TERMINAL
xen_platform_log xen platform: XEN|SystemGetVersionInformation: - SINGLEUSERTS
xen_platform_log xen platform: XEN|SystemGetVersionInformation: TYPE: 
WORKSTATION
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[0] 
.1000 - .0009efff
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[1] 
.0010 - .eed94fff
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[2] 
.eee12000 - .efe91fff
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[3] 
.efef6000 - .effc
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[4] 
.efff - .efff
xen_platform_log xen platform: XEN|SystemGetMemoryInformation: RANGE[5] 
0001. - 0001.07eaafff
xen_platform_log xen platform: XEN|AcpiGetXsdt: 0xFC012BA0
xen_platform_log xen platform: XEN|SystemProcessorInformation: > (0:0)
xen_platform_log xen platform: XEN|SystemProcessorInformation: 

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Anthony PERARD
On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote:
> Il 14/10/2015 13:06, Stefano Stabellini ha scritto:
> >I would suggest Fabio to avoid AHCI disks altogether and just use OVMF
> >with PV disks only and Anthony's patch to libxl to avoid creating any
> >IDE disks: http://marc.info/?l=xen-devel=144482080812353.
> >
> >Would that work for you?
> 
> Thanks for the advice, I tried it:
> https://github.com/Fantu/Xen/commits/rebase/m2r-testing-4.6
> 
> I installed W10 pro 64 bit with ide disk, installed the win pv drivers and
> after changed to xvdX instead hdX, is the only change needed, right?
> Initial boot is ok (ovmf part about pv disks seems ok) but windows boot
> fails with problem with pv drivers.
> In attachment full qemu log with xen_platform trace and domU's xl cfg.
> 
> Someone have windows domUs with ovmf and pv disks only working? If yes can
> tell me the difference to understand what can be the problem please?

When I worked on the PV disk implementation in OVMF, I was able to boot
a Windows 8 with pv disk only.

I don't have access to the guest configuration I was using, but I think one
difference would be the viridian setting, I'm pretty sure I did not set it.

-- 
Anthony PERARD



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-14 Thread Kevin Wolf
Am 14.10.2015 um 13:06 hat Stefano Stabellini geschrieben:
> On Wed, 14 Oct 2015, Kevin Wolf wrote:
> > [ CC qemu-block ]
> > 
> > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > On Tue, 13 Oct 2015, John Snow wrote:
> > > > On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > I added ahci disk support in libxl and using it for week seems that 
> > > > > was
> > > > > ok, after a reply of Stefano Stabellini seems that xen disk unplug
> > > > > support only ide disks:
> > > > > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39c905374ee8663d5d8
> > > > > 
> > > > > Today Paul Durrant told me that even if pv disk is ok also with ahci 
> > > > > and
> > > > > the emulated one is offline can be a risk:
> > > > > http://lists.xenproject.org/archives/html/win-pv-devel/2015-10/msg00021.html
> > > > > 
> > > > > 
> > > > > I tried to take a fast look in qemu code but I not understand the 
> > > > > needed
> > > > > thing for add the xen disk unplug support also for ahci, can someone 
> > > > > do
> > > > > it or tell me useful information for do it please?
> > > > > 
> > > > > Thanks for any reply and sorry for my bad english.
> > > > > 
> > > > 
> > > > I'm not entirely sure what features you need AHCI to support in order
> > > > for Xen to be happy.
> > > > 
> > > > I'd guess hotplugging, but where I get confused is that IDE disks don't
> > > > support hotplugging either, so I guess I'm not sure sure what you need.
> > > > 
> > > > Stefano, can you help bridge my Xen knowledge gap?
> > >  
> > > Hi John,
> > > 
> > > we need something like hw/i386/xen/xen_platform.c:unplug_disks but that
> > > can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > > pci_piix3_xen_ide_unplug does for ide.
> > 
> > Maybe this would be the right time to stop the craziness with your
> > hybrid IDE/xendisk setup. It's a horrible thing that would never happen
> > on real hardware.
> 
> I would be quite happy to stop (or even get rid of) the craziness.
> 
> 
> > Can't you just teach SeaBIOS how to deal with your PV disks and then
> > only add that to your VM and forget about IDE/AHCI? I mean, that's how
> > it's done for virtio-blk, and it doesn't involve any insanities like
> > ripping out non-hotpluggable devices.
> 
> Teaching SeaBIOS to deal with PV disks can be done, in fact we already
> support PV disks in OVMF. It is possible to boot Windows with OVMF
> without any IDE disks (patch pending for libxl to create a VM without
> emulated IDE disks).
> 
> However we have to be honest that implementing PV disk support in
> SeaBIOS is a different magnitude of effort compared to implementing AHCI
> "unplug".

Agreed. But we generally try to do the right thing and not the easy
thing.

Maybe I'm missing something, but my impression was that the hybrid setup
was only used so that you can boot from a PV disk even though the BIOS
doesn't have a PV driver. In that case, why would you even want to use
AHCI instead of IDE? During the early boot performance shouldn't be much
different as there is no parallelism, and afterwards the PV driver is
used.

> I would suggest Fabio to avoid AHCI disks altogether and just use OVMF
> with PV disks only and Anthony's patch to libxl to avoid creating any
> IDE disks: http://marc.info/?l=xen-devel=144482080812353.
> 
> Would that work for you?

That sounds certainly like a better step forward than adding a crude
hack to AHCI.

And if you want to make me completely happy, plan to extend SeaBIOS so
that we can even drop the existing hack in IDE.

Kevin



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-14 Thread Stefano Stabellini
On Wed, 14 Oct 2015, Kevin Wolf wrote:
> Am 14.10.2015 um 13:06 hat Stefano Stabellini geschrieben:
> > On Wed, 14 Oct 2015, Kevin Wolf wrote:
> > > [ CC qemu-block ]
> > > 
> > > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> > > > On Tue, 13 Oct 2015, John Snow wrote:
> > > > > On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
> > > > > > I added ahci disk support in libxl and using it for week seems that 
> > > > > > was
> > > > > > ok, after a reply of Stefano Stabellini seems that xen disk unplug
> > > > > > support only ide disks:
> > > > > > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39c905374ee8663d5d8
> > > > > > 
> > > > > > Today Paul Durrant told me that even if pv disk is ok also with 
> > > > > > ahci and
> > > > > > the emulated one is offline can be a risk:
> > > > > > http://lists.xenproject.org/archives/html/win-pv-devel/2015-10/msg00021.html
> > > > > > 
> > > > > > 
> > > > > > I tried to take a fast look in qemu code but I not understand the 
> > > > > > needed
> > > > > > thing for add the xen disk unplug support also for ahci, can 
> > > > > > someone do
> > > > > > it or tell me useful information for do it please?
> > > > > > 
> > > > > > Thanks for any reply and sorry for my bad english.
> > > > > > 
> > > > > 
> > > > > I'm not entirely sure what features you need AHCI to support in order
> > > > > for Xen to be happy.
> > > > > 
> > > > > I'd guess hotplugging, but where I get confused is that IDE disks 
> > > > > don't
> > > > > support hotplugging either, so I guess I'm not sure sure what you 
> > > > > need.
> > > > > 
> > > > > Stefano, can you help bridge my Xen knowledge gap?
> > > >  
> > > > Hi John,
> > > > 
> > > > we need something like hw/i386/xen/xen_platform.c:unplug_disks but that
> > > > can unplug AHCI disk. And by unplug, I mean "make disappear" like
> > > > pci_piix3_xen_ide_unplug does for ide.
> > > 
> > > Maybe this would be the right time to stop the craziness with your
> > > hybrid IDE/xendisk setup. It's a horrible thing that would never happen
> > > on real hardware.
> > 
> > I would be quite happy to stop (or even get rid of) the craziness.
> > 
> > 
> > > Can't you just teach SeaBIOS how to deal with your PV disks and then
> > > only add that to your VM and forget about IDE/AHCI? I mean, that's how
> > > it's done for virtio-blk, and it doesn't involve any insanities like
> > > ripping out non-hotpluggable devices.
> > 
> > Teaching SeaBIOS to deal with PV disks can be done, in fact we already
> > support PV disks in OVMF. It is possible to boot Windows with OVMF
> > without any IDE disks (patch pending for libxl to create a VM without
> > emulated IDE disks).
> > 
> > However we have to be honest that implementing PV disk support in
> > SeaBIOS is a different magnitude of effort compared to implementing AHCI
> > "unplug".
> 
> Agreed. But we generally try to do the right thing and not the easy
> thing.

Sure. I am quite happy to let other people do it though :-)


> Maybe I'm missing something, but my impression was that the hybrid setup
> was only used so that you can boot from a PV disk even though the BIOS
> doesn't have a PV driver. In that case, why would you even want to use
> AHCI instead of IDE? During the early boot performance shouldn't be much
> different as there is no parallelism, and afterwards the PV driver is
> used.

The "unplug" code and the design choice predate me -- I am not sure why
it was done like that.  In those days there was no SeaBIOS: maybe they
thought that writing a PV disk frontend in rombios would be madness? 

In addition isn't it true that some guests, once they see a PIIX3
chipset and they know that there is one disk, they might just try to
access it directly via the IDE interface?  I am thinking of some old
versions of Windows. Are they really able to cope with the case where
they can only access the disk via the legacy BIOS until non-IDE drivers
come along?


> > I would suggest Fabio to avoid AHCI disks altogether and just use OVMF
> > with PV disks only and Anthony's patch to libxl to avoid creating any
> > IDE disks: http://marc.info/?l=xen-devel=144482080812353.
> > 
> > Would that work for you?
> 
> That sounds certainly like a better step forward than adding a crude
> hack to AHCI.
> 
> And if you want to make me completely happy, plan to extend SeaBIOS so
> that we can even drop the existing hack in IDE.

There are lots of existing guests which write to the magic ioport to
"unplug" disks.  We would need some sort of deprecation plan.



Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-14 Thread Paul Durrant
> -Original Message-
> From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz]
> Sent: 14 October 2015 12:12
> To: Kevin Wolf; Stefano Stabellini
> Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen-
> de...@lists.xen.org; qemu-block@nongnu.org; Paul Durrant
> Subject: Re: [Qemu-devel] Question about xen disk unplug support for ahci
> missed in qemu
> 
> 
> 
> Il 14/10/2015 11:47, Kevin Wolf ha scritto:
> > [ CC qemu-block ]
> >
> > Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben:
> >> On Tue, 13 Oct 2015, John Snow wrote:
> >>> On 10/13/2015 11:55 AM, Fabio Fantoni wrote:
>  I added ahci disk support in libxl and using it for week seems that was
>  ok, after a reply of Stefano Stabellini seems that xen disk unplug
>  support only ide disks:
> 
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=679f4f8b178e7c66fbc2f39
> c905374ee8663d5d8
> 
>  Today Paul Durrant told me that even if pv disk is ok also with ahci and
>  the emulated one is offline can be a risk:
>  http://lists.xenproject.org/archives/html/win-pv-devel/2015-
> 10/msg00021.html
> 
> 
>  I tried to take a fast look in qemu code but I not understand the
> needed
>  thing for add the xen disk unplug support also for ahci, can someone do
>  it or tell me useful information for do it please?
> 
>  Thanks for any reply and sorry for my bad english.
> 
> >>> I'm not entirely sure what features you need AHCI to support in order
> >>> for Xen to be happy.
> >>>
> >>> I'd guess hotplugging, but where I get confused is that IDE disks don't
> >>> support hotplugging either, so I guess I'm not sure sure what you need.
> >>>
> >>> Stefano, can you help bridge my Xen knowledge gap?
> >>
> >> Hi John,
> >>
> >> we need something like hw/i386/xen/xen_platform.c:unplug_disks but
> that
> >> can unplug AHCI disk. And by unplug, I mean "make disappear" like
> >> pci_piix3_xen_ide_unplug does for ide.
> > Maybe this would be the right time to stop the craziness with your
> > hybrid IDE/xendisk setup. It's a horrible thing that would never happen
> > on real hardware.

Unfortunately, it's going to be difficult to remove such 'craziness' when you 
don't know a priori whether the VM has PV drivers or not. 

> >
> > Can't you just teach SeaBIOS how to deal with your PV disks and then
> > only add that to your VM and forget about IDE/AHCI? I mean, that's how
> > it's done for virtio-blk, and it doesn't involve any insanities like
> > ripping out non-hotpluggable devices.
> >

Does Windows have in-box virtio-blk drivers? If not, how does it boot?

> > Hm... How does a reboot of a machine that had its IDE already removed
> > actually work? Do you restart the qemu process on reboot?
> >

The IDE disks are always present during boot, but before the OS enumerates them 
they are 'unplugged' and then PV drivers are used instead. The only other way 
would be to somehow obscure them from OS enumeration so they could be left 
lying around but remain unused. That's feasible for Windows, but I don't know 
about other OS.

  Paul

> > Kevin
> I thinkthat would be a good idea, unfortunately I'm not able to do that
> and I do not know if the developers of xen would agree to such modification.
> 
> If will be done, for example having new disk type "xenpv" require the pv
> drivers installed, with linux having drivers included should not be a
> problem but on windows yes FWIK.
> Like virtio driver should be installed before (or adding them in windows
> install), I don't know if will be ok specifying them in install for with
> xen driver, another possibility can be start domU with ide disk type,
> install the xen pv drivers and reboot selecting xenpv disk type instead.
> Doing it FWIK require not only xen and qemu changes but also pv drivers
> change, I added on cc also Paul Durrant for see what think about.
> With actual unplug based on my tests in some years I had many problem
> with windows domUs (with both old and new pv drivers) resulting in
> "windows boot blue screen error", I suppose that changing/improving
> unplug method can decrease them, is it correct?
> 
> About reboot xen do different from kvm recreating full domU each time
> (and new qemu process), I don't know if is possible and good change the
> method.
> 
> Thanks for any reply and sorry for my bad english.