On Mon, Jan 07, 2013 at 07:40:32PM +0100, fred.kon...@greensocs.com wrote: > @@ -130,7 +124,9 @@ static void virtio_net_set_status(struct VirtIODevice > *vdev, uint8_t status) > > static void virtio_net_set_link_status(NetClientState *nc) > { > - VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque; > + void *opaque = DO_UPCAST(NICState, nc, nc)->opaque; > + VirtIONet *n = VIRTIO_NET(opaque); > + VirtIODevice *vdev = VIRTIO_DEVICE(n); > uint16_t old_status = n->status; > > if (nc->link_down)
I note this adds more pointer chasing due to runtime casts on data path operations. Can well be trivial but this really needs to be verified with a performance test. Was this done? Same comment applies to block. An alternative is to add _fast casts without runtime checks. -- MST