Re: [PATCH v3 1/4] Add 'output' codec in docs, qemu_command and qemu_capabilities

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

 



On Mon, May 21, 2018 at 04:44:25PM +0200, Filip Alac wrote:
> Add documentation for 'output' codec.
> Extend qemu_command with 'hda-output' codec support.
> Extend qemu_capabilities with 'hda-output' codec support.
>
> Signed-off-by: Filip Alac <filipalac@xxxxxxxxx>
> ---
>  src/qemu/qemu_command.c       | 5 ++++-
>  docs/formatdomain.html.in     | 15 ++++++++++++---
>  docs/schemas/domaincommon.rng |  1 +
>  src/conf/domain_conf.c        |  3 ++-
>  src/conf/domain_conf.h        |  1 +
>  src/qemu/qemu_capabilities.c  |  2 ++
>  src/qemu/qemu_capabilities.h  |  1 +
> 7 files changed, 24 insertions(+), 5 deletions(-)
>

Did you also run 'make check && make syntax-check' on this patch? Because it
fails for me.

> @@ -4142,6 +4143,8 @@ qemuSoundCodecTypeToCaps(int type)
>          return QEMU_CAPS_HDA_DUPLEX;
>      case VIR_DOMAIN_SOUND_CODEC_TYPE_MICRO:
>          return QEMU_CAPS_HDA_MICRO;
> +    case VIR_DOMAIN_SOUND_CODEC_TYPE_OUTPUT:
> +        return QEMU_CAPS_HDA_OUTPUT;

...and it fails because for ^this you also need to define the capability in
qemu_capabilities.c in the hunks below. However, the capabilities XML files are
updated in patch 2, so this first patch naturally fails qemucapabilities test.
So, the two hunks below (qemu_capabilities.X) need to go back to the second
patch as you had it in the earlier versions.
With ^this change above though, you have two options:
1) move it to patch 2 as well, since we use type 'int' here in the switch
instead of type 'enum' which would normally fail because of -Wswitch-enum GCC
option.
2) be consistent, pretend it's an enum and would fail the compilation if it was
missing and return a temporary value, e.g. 0 instead of QEMU_CAPS_HDA_OUTPUT
and then in patch 2, you change this to QEMU_CAPS_HDA_OUTPUT, since in patch 2
you already have that one defined.

I'd personally go with option n.1), since it's easier and it's not worth to
spend any more time on it than necessary.

...

> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index bface72..fda1630 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -487,6 +487,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
>                /* 300 */
>                "sdl-gl",
>                "screendump_device",
> +              "hda-output",
>      );
>
>
> @@ -1117,6 +1118,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
>      { "pr-manager-helper", QEMU_CAPS_PR_MANAGER_HELPER },
>      { "virtual-css-bridge", QEMU_CAPS_CCW },
>      { "vfio-ccw", QEMU_CAPS_DEVICE_VFIO_CCW },
> +    { "hda-output", QEMU_CAPS_HDA_OUTPUT },
>  };
>
>  static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index 6f99534..c0b497a 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -471,6 +471,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
>      /* 300 */
>      QEMU_CAPS_SDL_GL, /* -sdl gl */
>      QEMU_CAPS_SCREENDUMP_DEVICE, /* screendump command accepts device & head */
> +    QEMU_CAPS_HDA_OUTPUT, /* -device hda-output */
>
>      QEMU_CAPS_LAST /* this must always be the last item */
>  } virQEMUCapsFlags;

Like I mentioned above, ^these 2 hunks need to go back in patch 2 where you add
the tests/qemucapabilities files.

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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