[libvirt] [PATCH v5 10/16] qemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr

Michal Privoznik mprivozn at redhat.com
Sun Jan 28 08:48:17 UTC 2018


On 01/06/2018 12:47 AM, John Ferlan wrote:
> Shorten up a few characters and reference the pciopts pointer
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_command.c | 118 ++++++++++++++++++++++++------------------------
>  1 file changed, 60 insertions(+), 58 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index d62531110..0175daee3 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -2612,6 +2612,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
>  {
>      virBuffer buf = VIR_BUFFER_INITIALIZER;
>      int model = def->model;
> +    const virDomainPCIControllerOpts *pciopts;
>      const char *modelName = NULL;
>  
>      *devstr = NULL;
> @@ -2718,24 +2719,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
>          break;
>  
>      case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
> +        pciopts = &def->opts.pciopts;
> +
>          switch ((virDomainControllerModelPCI) def->model) {
>          case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE:
> -            if (def->opts.pciopts.modelName
> +            if (pciopts->modelName
>                  == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE ||

Since you're touching this line, can you please move the ==
VIR_DOMAIN_.. onto the same line as pciopts->modelName? I know it's
going to be longer than 80 characters (83 in fact), but: a) it's a soft
limit, b) conditions written that way hurt my eyes more than long lines.

EDIT: AH, you're removing the check in the next patch. Okay, no need to
adjust anything then.

ACK

Michal




More information about the libvir-list mailing list