]> Git Repo - qemu.git/blobdiff - block/nfs.c
block: Add .bdrv_truncate() error messages
[qemu.git] / block / nfs.c
index 5ae665abd48bf308bdd6df002067080b635014b1..76572ae54696ec68cc63d40b603de4265b78b9ba 100644 (file)
@@ -767,7 +767,15 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs)
 static int nfs_file_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
 {
     NFSClient *client = bs->opaque;
-    return nfs_ftruncate(client->context, client->fh, offset);
+    int ret;
+
+    ret = nfs_ftruncate(client->context, client->fh, offset);
+    if (ret < 0) {
+        error_setg_errno(errp, -ret, "Failed to truncate file");
+        return ret;
+    }
+
+    return 0;
 }
 
 /* Note that this will not re-establish a connection with the NFS server
This page took 0.022896 seconds and 4 git commands to generate.