[libvirt] [Xen-devel] [PATCH 1/3] libxl: fix ref counting of libxlMigrationDstArgs

Jim Fehlig jfehlig at suse.com
Wed Jul 29 22:13:05 UTC 2015


On 07/29/2015 04:07 PM, Jim Fehlig wrote:
> On 07/20/2015 09:28 AM, Olaf Hering wrote:
>> On Thu, Jul 16, Jim Fehlig wrote:
>>
>>> @@ -448,6 +438,8 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
>>>           virObjectUnref(socks[i]);
>>>       }
>>>       VIR_FREE(socks);
>>> +    virObjectUnref(args);
>> This is now below the 'error' label, so args has to be initialized.
>>
>> [  149s] libxl/libxl_migration.c: In function 'libxlDomainMigrationPrepare':
>> [  149s] libxl/libxl_migration.c:463:19: warning: 'args' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
>> [  149s]      virObjectUnref(args);
>> [  149s]                    ^
>
> Opps. I've squashed in the below obvious fix. Note it is safe to call 
> virObjectUnref with a NULL object.

Actually add the diff this time...

>
>
> Any other comments on this series? It fixes bugs in migration, including a 
> possible libvirtd crash, and would be a candidate to push during freeze IMO.

diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 4349f02..f9673c8 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -318,7 +318,7 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
      virNetSocketPtr *socks = NULL;
      size_t nsocks = 0;
      int nsocks_listen = 0;
-    libxlMigrationDstArgs *args;
+    libxlMigrationDstArgs *args = NULL;
      size_t i;
      int ret = -1;





More information about the libvir-list mailing list