Re: [PATCH 2/2] qemu_block: add locking option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 14, 2024 at 14:17:58 +0900, Hiroki Narukawa wrote:
> There is a case that locking hits a bug and users wants to disable
> locking like bug in Linux kernel.
> 
> This commit adds actual qemu option to the domain conf added in previous
> commit.
> 
> Signed-off-by: Hiroki Narukawa <hnarukaw@xxxxxxxxxxxxx>
> ---
>  src/qemu/qemu_block.c                         |  7 ++++++
>  tests/qemublocktest.c                         |  1 +
>  ...le-raw-aio_native-locking-off-srconly.json | 10 ++++++++
>  .../file-raw-aio_native-locking-off.json      | 23 +++++++++++++++++++
>  .../file-raw-aio_native-locking-off.xml       | 12 ++++++++++

Rahter than qemublocktest we generally require testing via
qemuxmlconftest for anything that has XML or uis formatted on the
commandline.

>  5 files changed, 53 insertions(+)
>  create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off-srconly.json
>  create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.json
>  create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.xml
> 
> diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
> index 738b72d7ea..5905898b38 100644
> --- a/src/qemu/qemu_block.c
> +++ b/src/qemu/qemu_block.c
> @@ -852,6 +852,13 @@ qemuBlockStorageSourceGetFileProps(virStorageSource *src,
>                                         "S:aio", iomode,
>                                         "S:pr-manager", prManagerAlias,
>                                         NULL) < 0);
> +
> +    if (src->locking) {
> +        const char *lockingStr = virTristateSwitchTypeToString(src->locking);
> +        if (virJSONValueObjectAdd(&ret, "S:locking", lockingStr, NULL) < 0)
> +            return NULL;

The 'S:' conversion is skipped if the argument is NULL, thus no need for
an extra call to virJSONValueObjectAdd.
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux