[libvirt] [PATCH 1/2] Fix crash after attempting to hotplug a spicevmc channel

Pavel Hrdina phrdina at redhat.com
Mon Nov 10 17:03:22 UTC 2014


On 11/10/2014 04:56 PM, Ján Tomko wrote:
> In qemuDomainAttachChrDevice, we add the device to the domain XML,
> then we fail to construct the JSON command, saying we don't support
> it.
>
> But we don't clean up the device from the domain XML, because
> virDomainChrEquals returns false when comparing the device against
> itself.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1162097
> ---
>   src/conf/domain_conf.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index e8d8f7d..31378cd 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1596,8 +1596,7 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
>       case VIR_DOMAIN_CHR_TYPE_STDIO:
>       case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
>       case VIR_DOMAIN_CHR_TYPE_LAST:
> -        /* nada */
> -        break;
> +        return true;
>       }
>
>       return false;
>

This isn't true for VIR_DOMAIN_CHR_TYPE_SPICEVMC as we are setting
data.spicevmc to some value and it could have different value.
See enum virDomainChrSpicevmcName.

Pavel




More information about the libvir-list mailing list