[libvirt] [PATCH 04/20] conf: Add support for shmem model

Martin Kletzander mkletzan at redhat.com
Fri Sep 16 07:34:31 UTC 2016


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160916/d16939f7/attachment-0001.sig>


More information about the libvir-list mailing list