On Fri, Sep 16, 2016 at 09:12:23AM +0200, Peter Krempa wrote:
On Thu, Sep 15, 2016 at 18:14:29 +0200, Martin Kletzander wrote:
> Just the default one now, new ones will be added in following commits.
>
> Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
> ---
> docs/schemas/domaincommon.rng | 9 +++++
> src/conf/domain_conf.c | 41 +++++++++++++++++------
> src/conf/domain_conf.h | 8 +++++
> src/libvirt_private.syms | 2 ++
> src/qemu/qemu_command.c | 14 ++++++--
> tests/qemuxml2argvdata/qemuxml2argv-shmem.xml | 2 ++
> tests/qemuxml2xmloutdata/qemuxml2xmlout-shmem.xml | 8 +++++
> 7 files changed, 70 insertions(+), 14 deletions(-)
[...]
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 3a61863b9abb..5eae0631a14f 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -8648,10 +8648,18 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
> {
> char *devstr = NULL;
>
> - if (!(devstr = qemuBuildShmemDevStr(def, shmem, qemuCaps)))
> + switch ((virDomainShmemModel)shmem->model) {
> + case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM:
> + if (!(devstr = qemuBuildShmemDevStr(def, shmem, qemuCaps)))
> + return -1;
> + virCommandAddArgList(cmd, "-device", devstr, NULL);
> + VIR_FREE(devstr);
> + break;
> +
> + /* coverity[dead_error_begin] */
I'd don't really like stuff like this.
Yeah, I know, me too, kinda, but look at it from this way. Would you
rather like it here as a precaution or wasting another separate commit
just for that one line with three paragraphs in the commit message? ;)
> + case VIR_DOMAIN_SHMEM_MODEL_LAST:
> return -1;
> - virCommandAddArgList(cmd, "-device", devstr, NULL);
> - VIR_FREE(devstr);
> + }
>
> if (shmem->server.enabled) {
> if (!(devstr = qemuBuildShmemBackendStr(logManager, cmd, cfg, def,
ACK nevertheless.
Peter