Re: [PATCH v2 07/11] qemuDomainDeviceDefPostParse: Fetch caps from domain object

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

 



On Fri, Sep 23, 2016 at 15:25:00 +0200, Michal Privoznik wrote:
> Just like we did two commits ago, don't try to fetch capabilities
> for non-existing binary. Re-use the ones we have for running
> domain.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 1f5ef92..99baf5c 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -2562,15 +2562,19 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
>                               virCapsPtr caps,
>                               unsigned int parseFlags,
>                               void *opaque,
> -                             void *parseOpaque ATTRIBUTE_UNUSED)
> +                             void *parseOpaque)
>  {
>      virQEMUDriverPtr driver = opaque;
> -    virQEMUCapsPtr qemuCaps = NULL;
> +    virQEMUCapsPtr qemuCaps = parseOpaque;
>      virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
>      int ret = -1;
>  
> -    qemuCaps = virQEMUCapsCacheLookup(caps, driver->qemuCapsCache,
> -                                      def->emulator);
> +    if (qemuCaps) {
> +        virObjectRef(qemuCaps);
> +    } else {
> +        qemuCaps = virQEMUCapsCacheLookup(caps, driver->qemuCapsCache,
> +                                          def->emulator);
> +    }
>  
>      if (dev->type == VIR_DOMAIN_DEVICE_NET &&
>          dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&

Similar to 5/11, can't you just squash them? (After squashing 4/11 and
6/11, of course).

ACK

Jirka

--
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]