FreeBSD-current/Xen and block device enumeration

Adrian Chadd adrian at freebsd.org
Mon May 18 19:05:12 UTC 2009


(Cross-posting to -current because of the way a badly confused Xen
DomU confuses GEOM and populates invalid stuff.)

2009/5/19 Adrian Chadd <adrian at freebsd.org>:
> This config:
>
> disk = [
>        'phy:/dev/hosting2_data2/XEN_freebsd_root,0x01,w',
>        'phy:/dev/hosting2_data2/XEN_freebsd_swap,0x02,w'
>        ]

Confuses some "linux" device unit naming type magic in the blkfront device code.

Anyway. To get xbd0 and xbd1 I need to use 0xCA00 and 0xCA10. The code
matches on major 202 (0xca) and shifts the minor bits right to get
partition ids (which I'm not using here.)

This outlines some sanity checking and debugging which should be
improved a little.

> Gives this output in dmesg:
>
> xbd0: 10240MB <Virtual Block Device> at device/vbd/1 on xenbus0
> GEOM: new disk xbd0
> xbd1: 512MB <Virtual Block Device> at device/vbd/2 on xenbus0
> WARNING: WITNESS option enabled, expect reduced performance.
> GEOM: new disk xbd0

.. since I shouldn't be able to do that.

>
> and then ls -l /dev/xbd* :
>
> freebsd_domu# ls -l /dev/xbd*
> crw-r-----  1 root  operator    0,  41 May 18 02:51 /dev/xbd0
> crw-r-----  1 root  operator    0,  41 May 18 02:51 /dev/xbd0

.. or that.


Adrian


More information about the freebsd-xen mailing list