Hello,

El 30/04/15 a les 16.04, Gustau Pérez ha escrit:
> 
> 
> El 30/04/2015 a les 11:57, Roger Pau Monné ha escrit:
>> I've been digging into this, and it looks like it's going to be more
>> complicated than what I thought. FreeBSD blkback is not prepared to work
>> with hotplug scripts so we also need to modify it.
>>
>> I hope I'm going to have some time next week to prepare a patch to both
>> the FreeBSD kernel and libxl, sorry for the delay.
> 
>    Hi Roger and thanks for your time and efforts.
> 
>    I thought XENBUS_PATH was some sort of a reference to the xenstore
> path of the VM being executed and that the libxl would export that to
> the hotplug scripts. I thought that simply allowing the libxl to execute
> hotplug script for blk devices would be enough.
> 
>    Can I be of any help? Feel free to pass me work I you're busy.
> 
>    OTOH, I wasn't aware it could involve the Dom0 kernel. I'm confused
> about that, could you please explain me why it does involve the dom0
> kernel?

Sure, in order to provide paravirtualized network and disks to the
guests Xen uses what is called a split device model. In the block case,
this is done by having a specific driver in the guest kernel, called
blkfront, and another driver in the host kernel (Dom0) called blkback.
When the guest starts a region of the guest memory is mapped by blkback
in order to have a transparent exchange of data between the host and the
guest, and that's how disk PV drivers are implemented.

blkback runs inside of the FreeBSD kernel and in order to know which
file or block device is the backend of a guest virtual disk it reads a
node in xenstore, which is called "params". This is directly written by
libxl and is the path to the block or raw file in the common case (but
when using iSCSI it just contains the information needed to connect to
the target, which blkback doesn't understand at all).

On Linux for example blkback doesn't read "params" directly, and instead
uses another node that's written by the hotplug script upon execution,
so blkback attachment is deferred until hotplug script execution has
finished. We need something like this in FreeBSD blkback, in order to
have the following workflow:

1. libxl populates xenstore nodes.
2. hotplug script execution.
3. blkback attaches the disk.

With the current blkback code there's no way to guarantee that 3 happens
after 2.

>    Thank you,
> 
>    Gus
> 
>    PS: a bit offtopic, but I've been reviewing the commits to FreeBSD
> HEAD and I don't see this:
> 
>          https://people.freebsd.org/~royger/mem.patch
> 
>    IIRC that patch solved the problem of domU PV guests with some
> hardware. Could you commit that upstream?

Yes, I was waiting to see if Justin had any comments on it. If nothing
comes up next week I will just commit it.

Roger.

_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to