X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Ftmpdisk.c;h=0be279fc739cb9b77ca100f7cacc31ba67875082;hb=f7e83e5d2d00ba107ccda346da4660ab523471bb;hp=96bffef48c6f28ccd893dd11eeb187253810ed0e;hpb=72420d58d18ec71d4777d029daaf0c6a1c820b32;p=palacios.git diff --git a/palacios/src/devices/tmpdisk.c b/palacios/src/devices/tmpdisk.c index 96bffef..0be279f 100644 --- a/palacios/src/devices/tmpdisk.c +++ b/palacios/src/devices/tmpdisk.c @@ -73,8 +73,11 @@ static int blk_write(uint8_t * buf, uint64_t lba, uint64_t num_bytes, void * pr } -static int blk_free(struct vm_device * dev) { - return -1; +static int blk_free(struct blk_state * blk) { + V3_FreePages((void *)blk->blk_base_addr, blk->capacity / 4096); + + V3_Free(blk); + return 0; } @@ -87,7 +90,7 @@ static struct v3_dev_blk_ops blk_ops = { static struct v3_device_ops dev_ops = { - .free = blk_free, + .free = (int (*)(void *))blk_free, };