tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vnd.c 1.254



On Jan 16,  7:21pm, Manuel Bouyer wrote:
}
} what problem are you trying to solve with this commit to sys/dev/vnd.c ?
} revision 1.251
} date: 2015/11/09 17:41:24;  author: christos;  state: Exp;  lines: +3 -5
} Return ENXIO if the get ioctl exceeds the number of configured devices.
} XXX: pullup-7

     The issue was that under some conditions, vnconfig -l would
loop forever, displaying:

vnd<i>: not in use
vnd<j>: not in use
vnd<k>: not in use
...

I don't recall the exact trigger condition, but I have seen it happen.

} This broke vnconfig -l (and so Xen block-device scripts):
} xen1:/tmp#vnconfig -l
} vnd0: /domains (/dev/wd0f) inode 3
} vnconfig: VNDIOCGET: Device not configured

     It stops an older vnconfig with a newer kernel from looping
forever.  Exactly how old vnconfig has to be and how new the kernel
has to be is left as an exercise for the reader.  :->

} There are 7 more vnd devices in /dev/ waiting to be configured on this system.
} 
} This has been pulled up to netbsd-7 and netbsd-7-0 as part of
} ticket 1038, so vnconfig (and Xen dom0) is broken here too,
} as reported in PR 50659

     When trying to locate a free vnd(4), xl (technically, it calls
out to a script that) does this:

-----
                # Store the list of available vnd(4) devices in
                #``available_disks'', and mark them as ``free''.
                list=`ls -1 /dev/vnd[0-9]*d | sed "s,/dev/vnd,,;s,d,," | sort -n
`
                for i in $list; do
                        disk="vnd$i"
                        available_disks="$available_disks $disk"
                        eval $disk=free
                done
                # Mark the used vnd(4) devices as ``used''.
                for disk in `sysctl hw.disknames`; do
                        case $disk in
                        vnd[0-9]*) eval $disk=used ;;
                        esac
                done
                # Configure the first free vnd(4) device.
                for disk in $available_disks; do
                        eval status=\$$disk
                        if [ "$status" = "free" ] && \
                            vnconfig /dev/${disk}d $xparams >/dev/null; then
                                device=/dev/${disk}d
                                break
                        fi
                done
                if [ x$device = x ] ; then
                        error "no available vnd device"
                fi
-----

It would appear that the call to vnconfig is failing.  The question
is, why?  What happens if you have 9 or fewer /dev/vnds?  My thought
here is about sort order where vnd10 would come before vnd2 and
what happens if you try to configure them out of order.

}-- End of excerpt from Manuel Bouyer


Home | Main Index | Thread Index | Old Index