Converting ctl.conf to UCL

Ryan Stone <[email protected]>
Newsgroups gmane.os.freebsd.devel.scsi
Message-ID <CAFMmRNwSJKdfUX7_oVNcaYLP9BCNjqJNOQ_TG1zw1sSeJvvXfg@mail.gmail.com>
I'm trying to use configure ctld to create virtual disks suitable for
use with virtio-scsi (I'm working with a VM that is hardcoded to
require scsi disks, so the other virtio disk providers unfortunately
can't be used in my case).  I would like to use ctl.conf in UCL format
so I can use UCL's file inclusion facilities, which will simplify
managing my configuration.  Unfortunately, I'm having trouble
converting a file to UCL format and I'm beginning to suspect that the
manpage is missing something.  Here is my test configuration, which
does work for me:

lun foo_test_storage0 {
        serial "f1-1-1";
        path "/usr/local/vmrc/vm/foo-test/storageHDD0.img";
}

lun foo_test_storage1 {
        serial "f1-1-2";
        path "/usr/local/vmrc/vm/foo-test/storageHDD1.img";
}

target "iqn.com.example:foo-test" {
        port "ioctl/11/1"
        lun 0 foo_test_storage0
        lun 1 foo_test_storage1
}

My attempt at a UCL version resulted in this:

lun {
        foo_test_storage0 {
                serial = "f1-1-1"
                path = "/usr/local/vmrc/vm/foo-test/storageHDD0.img"
        }

        foo_test_storage1 {
                serial = "f1-1-2"
                path = "/usr/local/vmrc/vm/foo-test/storageHDD1.img"
        }
}

target {
        "iqn.com.example:foo-test" {
                port = "ioctl/11/1"
                lun = [
                        { number = 0, name = foo_test_storage0 },
                        { number = 1, name = foo_test_storage1 } ,
                ]
        }
}

But I just get the error:

Starting ctld.
ctld: no LUNs defined for target "iqn.com.example:foo-test"

This seems to match the sample in the manpage, so I'm confused as to
what has gone wrong.  Does anybody have any pointers?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.