Commit db08adf5 authored by Kevin Wolf's avatar Kevin Wolf Committed by Blue Swirl
Browse files

qemu-img: Print available options with -o ?



This patch adds a small help text to each of the options in the block drivers
which can be displayed by using qemu-img create -f fmt -o ?

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent f425c278
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -262,8 +262,16 @@ static void cow_flush(BlockDriverState *bs)
}

static QEMUOptionParameter cow_create_options[] = {
    { BLOCK_OPT_SIZE,           OPT_SIZE },
    { BLOCK_OPT_BACKING_FILE,   OPT_STRING },
    {
        .name = BLOCK_OPT_SIZE,
        .type = OPT_SIZE,
        .help = "Virtual disk size"
    },
    {
        .name = BLOCK_OPT_BACKING_FILE,
        .type = OPT_STRING,
        .help = "File name of a base image"
    },
    { NULL }
};

+15 −3
Original line number Diff line number Diff line
@@ -909,9 +909,21 @@ static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)


static QEMUOptionParameter qcow_create_options[] = {
    { BLOCK_OPT_SIZE,           OPT_SIZE },
    { BLOCK_OPT_BACKING_FILE,   OPT_STRING },
    { BLOCK_OPT_ENCRYPT,        OPT_FLAG },
    {
        .name = BLOCK_OPT_SIZE,
        .type = OPT_SIZE,
        .help = "Virtual disk size"
    },
    {
        .name = BLOCK_OPT_BACKING_FILE,
        .type = OPT_STRING,
        .help = "File name of a base image"
    },
    {
        .name = BLOCK_OPT_ENCRYPT,
        .type = OPT_FLAG,
        .help = "Encrypt the image"
    },
    { NULL }
};

+25 −5
Original line number Diff line number Diff line
@@ -2981,11 +2981,31 @@ static int qcow_get_buffer(BlockDriverState *bs, uint8_t *buf,
}

static QEMUOptionParameter qcow_create_options[] = {
    { BLOCK_OPT_SIZE,           OPT_SIZE },
    { BLOCK_OPT_BACKING_FILE,   OPT_STRING },
    { BLOCK_OPT_BACKING_FMT,    OPT_STRING },
    { BLOCK_OPT_ENCRYPT,        OPT_FLAG },
    { BLOCK_OPT_CLUSTER_SIZE,   OPT_SIZE },
    {
        .name = BLOCK_OPT_SIZE,
        .type = OPT_SIZE,
        .help = "Virtual disk size"
    },
    {
        .name = BLOCK_OPT_BACKING_FILE,
        .type = OPT_STRING,
        .help = "File name of a base image"
    },
    {
        .name = BLOCK_OPT_BACKING_FMT,
        .type = OPT_STRING,
        .help = "Image format of the base image"
    },
    {
        .name = BLOCK_OPT_ENCRYPT,
        .type = OPT_FLAG,
        .help = "Encrypt the image"
    },
    {
        .name = BLOCK_OPT_CLUSTER_SIZE,
        .type = OPT_SIZE,
        .help = "qcow2 cluster size"
    },
    { NULL }
};

+5 −1
Original line number Diff line number Diff line
@@ -858,7 +858,11 @@ static void raw_flush(BlockDriverState *bs)


static QEMUOptionParameter raw_create_options[] = {
    { BLOCK_OPT_SIZE,           OPT_SIZE },
    {
        .name = BLOCK_OPT_SIZE,
        .type = OPT_SIZE,
        .help = "Virtual disk size"
    },
    { NULL }
};

+5 −1
Original line number Diff line number Diff line
@@ -234,7 +234,11 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
}

static QEMUOptionParameter raw_create_options[] = {
    { BLOCK_OPT_SIZE,           OPT_SIZE },
    {
        .name = BLOCK_OPT_SIZE,
        .type = OPT_SIZE,
        .help = "Virtual disk size"
    },
    { NULL }
};

Loading