On 16/03/2015 15:49, Max Reitz wrote: >>> >> Right, but a better model than block.c should be for example >> block/raw-posix.c, which returns ENOTSUP (I checked now...). > > Maybe we should catch ENOTSUP in bdrv_co_discard() and override it?
That's what it does: if (ret && ret != -ENOTSUP) { return ret; } Returning 0 for NBD's flush_to_disk, by the way, is okay. Paolo