Subject: xen and ccd
To: None <port-xen@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: port-xen
Date: 03/31/2005 12:03:22
Hi again!

I'm running 3.99.2 (/usr/src updated and kernel rebuilt today).
I have some space allocated for CCD on my harddisk:

# /dev/rwd0d:
16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
  a:   8192016        63     4.2BSD   2048 16384 27560
  b:    263088   8192079       swap
  c: 312499937        63     unused      0     0     0
  d: 312500000         0     unused      0     0     0
  e: 104857600   8455167     4.2BSD      0     0     0
  f: 194992929 113312767        ccd
  g:   4194304 308305696        ccd


The configuration file for CCD looks like this:

ccd0            16      none    /dev/wd0f
ccd1            16      none    /dev/wd0g


I have created a disklabel for ccd0:

# /dev/rccd0d:
16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
  d: 194992928         0     unused      0     0
  e:  20971520         0        ccd
  f:  20971520  20971520        ccd
  g:  20971520  41943040        ccd
  h:  20971520  62914560        ccd
  i:  20971520  83886080        ccd
  j:  20971520 104857600        ccd
  k:  20971520 125829120        ccd
  l:  20971520 146800640        ccd
  m:  27220768 167772160        ccd


Here's the xen config file I'm using:

#kernel = "/xen/kernel/netbsd-XENU"
kernel = "/xen/kernel/netbsd-INSTALL_XENU"
memory = 128
name = "netbsd1"
cpu = -1
disk = [ 'phy:/dev/cd0a,cd0a,r', 'phy:/dev/ccd0e,wd0d,w' ]
root = "/dev/wd0d"


If I now try to start this domU and inside it suspend the
NetBSD installer and try to zero the disk I get an error:

# dmesg
...
xbd: using irq 5
xbd0 at hypervisor0: Xen Virtual Block Device 10240 MB
xbd1 at hypervisor0: Xen Virtual Block Device 404 MB

# dd if=/dev/zero of=/dev/rxbd0d
dd: /dev/rxbd0d: Input/output error
2+0 records in
1+0 records out
512 bytes transferred in 0.001 secs (512000 bytes/sec)

This appears in /var/log/messages. Nothing appears in
xend.log or xend-debug.log:

Mar 31 13:52:54 n86 /netbsd: xbd IO domain 1: error 30


And now the questions:

- am I doing something wrong with ccd?

- what type should I use for ccd0[e-m] if I want to use each
   as a "harddisk" for domU?