|
@@ -94,9 +94,9 @@ static int qcow2_probe(const uint8_t *buf, int buf_size, const char *filename)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-static ssize_t qcow2_crypto_hdr_read_func(QCryptoBlock *block, size_t offset,
|
|
|
|
- uint8_t *buf, size_t buflen,
|
|
|
|
- void *opaque, Error **errp)
|
|
|
|
|
|
+static int qcow2_crypto_hdr_read_func(QCryptoBlock *block, size_t offset,
|
|
|
|
+ uint8_t *buf, size_t buflen,
|
|
|
|
+ void *opaque, Error **errp)
|
|
{
|
|
{
|
|
BlockDriverState *bs = opaque;
|
|
BlockDriverState *bs = opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
@@ -113,12 +113,12 @@ static ssize_t qcow2_crypto_hdr_read_func(QCryptoBlock *block, size_t offset,
|
|
error_setg_errno(errp, -ret, "Could not read encryption header");
|
|
error_setg_errno(errp, -ret, "Could not read encryption header");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- return buflen;
|
|
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-static ssize_t qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen,
|
|
|
|
- void *opaque, Error **errp)
|
|
|
|
|
|
+static int qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen,
|
|
|
|
+ void *opaque, Error **errp)
|
|
{
|
|
{
|
|
BlockDriverState *bs = opaque;
|
|
BlockDriverState *bs = opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
@@ -151,13 +151,13 @@ static ssize_t qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen,
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
- return ret;
|
|
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-static ssize_t qcow2_crypto_hdr_write_func(QCryptoBlock *block, size_t offset,
|
|
|
|
- const uint8_t *buf, size_t buflen,
|
|
|
|
- void *opaque, Error **errp)
|
|
|
|
|
|
+static int qcow2_crypto_hdr_write_func(QCryptoBlock *block, size_t offset,
|
|
|
|
+ const uint8_t *buf, size_t buflen,
|
|
|
|
+ void *opaque, Error **errp)
|
|
{
|
|
{
|
|
BlockDriverState *bs = opaque;
|
|
BlockDriverState *bs = opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
BDRVQcow2State *s = bs->opaque;
|
|
@@ -174,7 +174,7 @@ static ssize_t qcow2_crypto_hdr_write_func(QCryptoBlock *block, size_t offset,
|
|
error_setg_errno(errp, -ret, "Could not read encryption header");
|
|
error_setg_errno(errp, -ret, "Could not read encryption header");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- return buflen;
|
|
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static QDict*
|
|
static QDict*
|