Gerd Hoffmann <kra...@redhat.com> writes: > On 11/02/10 11:08, Markus Armbruster wrote: >> Alexander Graf<ag...@suse.de> writes: >> >>> From: Gerd Hoffmann<kra...@redhat.com> >>> >>> This patch converts the xen backend code to qdev. >> >> qdev conversions are always welcome. This one's not complete (search >> for #if 0). > > It is a tricky one too. > > Creating the xen backend device instances is controlled via xenstore > (either emulated in case of xenner or xenstored when running on > Xen). When creating block/net backends via qemu command line switches > all qemu does is creating the xenstore entries. Having a external > entity (i.e. xend) creating the xenstore entries works too. > > This workflow is a bit hard to fit into the qdev model ...
I'm fine with imperfect qdev conversions, as long as the issues make things no worse then they were before (check, I think), they're clearly documented in the source (check, although the comment could be improved), and in the commit message (fail, but easy enough to fix). >>> + do { >>> + done = 1; >>> + QLIST_FOREACH(qdev,&xenbus->qbus.children, sibling) { >>> + xendev = container_of(qdev, struct XenDevice, qdev); > > [ ... ] > >>> + done = 0; >>> + break; >>> + } >>> + } while (!done); >> >> This loop nest confuses me. Why can't we just QLIST_FOREACH_SAFE()? > > Just historical reasons I guess. QLIST_FOREACH_SAFE() wasn't there > from the start but got added later. I'd like that to be cleaned up then.