[libvirt] [PATCH 15/21] Adapt virDomainMigrateVersion3 for extensible migration APIs

John Ferlan jferlan at redhat.com
Tue Jun 25 10:56:35 UTC 2013


On 06/18/2013 10:05 AM, Jiri Denemark wrote:
> ---
>  src/libvirt.c | 177 +++++++++++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 133 insertions(+), 44 deletions(-)
> 

<...snip...>


> +    if (useParams) {
> +        if (virTypedParamsGetString(params, nparams,
> +                                    VIR_MIGRATE_PARAM_DEST_NAME, NULL) <= 0 &&
> +            virTypedParamsReplaceString(&params, &nparams,
> +                                        VIR_MIGRATE_PARAM_DEST_NAME,
> +                                        domain->name) < 0) {
> +            domain = NULL;


^^^ The setting of NULL right here causes Coverity problems later... 


4979 	            virTypedParamsReplaceString(&params, &nparams,
4980 	                                        VIR_MIGRATE_PARAM_DEST_NAME,
4981 	                                        domain->name) < 0) {

(45) Event assign_zero: 	Assigning: "domain" = "NULL".
Also see events: 	[var_deref_op]

4982 	            domain = NULL;


> +        } else {
> +            ddomain = dconn->driver->domainMigrateFinish3Params
> +                (dconn, params, nparams, cookiein, cookieinlen,
> +                 &cookieout, &cookieoutlen, destflags, cancelled);
> +        }
> +    } else {
> +        dname = dname ? dname : domain->name;
> +        ddomain = dconn->driver->domainMigrateFinish3
> +            (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen,
> +             NULL, uri, destflags, cancelled);
> +    }
>  
>      /* If ddomain is NULL, then we were unable to start
>       * the guest on the target, and must restart on the


Later domain->conn is referenced:


(52) Event cond_true: 	Condition "notify_source", taking true branch

5017 	    if (notify_source) {

(53) Event var_deref_op: 	Dereferencing null pointer "domain".
Also see events: 	[assign_zero]

5018 	        VIR_DEBUG("Confirm3 %p ret=%d domain=%p", domain->conn, ret, domain);
5019 	        VIR_FREE(cookiein);
5020 	        cookiein = cookieout;


John




More information about the libvir-list mailing list