From 12bd451fe0be83474910bb63b5874458141d4230 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 18 Jan 2012 14:40:46 +0000 Subject: qmp: add block_stream command Add the block_stream command, which starts copy backing file contents into the image file. Also add the BLOCK_JOB_COMPLETED QMP event which is emitted when image streaming completes. Later patches add control over the background copy speed, cancelation, and querying running streaming operations. Signed-off-by: Stefan Hajnoczi Acked-by: Luiz Capitulino Signed-off-by: Kevin Wolf --- qerror.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qerror.c') diff --git a/qerror.c b/qerror.c index 3d95383940..2c60e10631 100644 --- a/qerror.c +++ b/qerror.c @@ -196,6 +196,10 @@ static const QErrorStringTable qerror_table[] = { .error_fmt = QERR_NO_BUS_FOR_DEVICE, .desc = "No '%(bus)' bus found for device '%(device)'", }, + { + .error_fmt = QERR_NOT_SUPPORTED, + .desc = "Not supported", + }, { .error_fmt = QERR_OPEN_FILE_FAILED, .desc = "Could not open '%(filename)'", -- cgit v1.2.3-55-g7522 From 019b8cbf76fc3126d300c401acca3102c69e7876 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Wed, 18 Jan 2012 14:40:52 +0000 Subject: add QERR_BASE_NOT_FOUND This qerror will be raised when a given streaming base (backing file) cannot be found. Signed-off-by: Marcelo Tosatti Signed-off-by: Stefan Hajnoczi Acked-by: Luiz Capitulino Signed-off-by: Kevin Wolf --- qapi-schema.json | 1 + qerror.c | 4 ++++ qerror.h | 3 +++ 3 files changed, 8 insertions(+) (limited to 'qerror.c') diff --git a/qapi-schema.json b/qapi-schema.json index 3f72c2cfd4..80debe679a 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1493,6 +1493,7 @@ # If streaming is already active on this device, DeviceInUse # If @device does not exist, DeviceNotFound # If image streaming is not supported by this device, NotSupported +# If @base does not exist, BaseNotFound # # Since: 1.1 ## diff --git a/qerror.c b/qerror.c index 2c60e10631..637eca793c 100644 --- a/qerror.c +++ b/qerror.c @@ -51,6 +51,10 @@ static const QErrorStringTable qerror_table[] = { .error_fmt = QERR_BAD_BUS_FOR_DEVICE, .desc = "Device '%(device)' can't go on a %(bad_bus_type) bus", }, + { + .error_fmt = QERR_BASE_NOT_FOUND, + .desc = "Base '%(base)' not found", + }, { .error_fmt = QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, .desc = "Block format '%(format)' used by device '%(name)' does not support feature '%(feature)'", diff --git a/qerror.h b/qerror.h index b530bc8806..8c36ddb7e1 100644 --- a/qerror.h +++ b/qerror.h @@ -57,6 +57,9 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_BAD_BUS_FOR_DEVICE \ "{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }" +#define QERR_BASE_NOT_FOUND \ + "{ 'class': 'BaseNotFound', 'data': { 'base': %s } }" + #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \ "{ 'class': 'BlockFormatFeatureNotSupported', 'data': { 'format': %s, 'name': %s, 'feature': %s } }" -- cgit v1.2.3-55-g7522