| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] tools: libxl: testidl: initialise the KeyedUnion keyvar before the union
 On Wed, 2013-12-04 at 17:54 +0000, Andrew Cooper wrote:
> On 04/12/13 17:48, Ian Campbell wrote:
> > This is Coverity CID 1135378 and 1135379.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> This sound plausible, although given my unfamiliarity with gentest.py, I
> dont feel as if a Reviewed-by tag is appropriate.
FWIW, if I insert a random.random() at the same place (to account for
the new call to random to be introduced, which knocks all the subsequent
values "down one") and then compare the result of that with the output
of this patch (with LIBXL_TESTIDL_SEED=42 in both cases) the diff is:
--- tools/libxl/testidl_BACKUP.c        2013-12-05 09:22:07.000000000 +0000
+++ tools/libxl/testidl.c       2013-12-05 09:22:49.000000000 +0000
@@ -439,6 +439,7 @@ static void libxl_domain_build_info_rand
     }
     libxl_defbool_rand_init(&p->claim_mode);
     p->event_channels = rand() % (sizeof(p->event_channels)*8);
+    p->type = LIBXL_DOMAIN_TYPE_INVALID;
     switch (p->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         p->u.hvm.firmware = rand_str();
@@ -739,6 +740,7 @@ static void libxl_event_rand_init(libxl_
     libxl_domid_rand_init(&p->domid);
     libxl_uuid_rand_init(&p->domuuid);
     p->for_user = rand() % (sizeof(p->for_user)*8);
+    p->type = LIBXL_EVENT_TYPE_DOMAIN_CREATE_CONSOLE_AVAILABLE;
     switch (p->type) {
     case LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN:
         p->u.domain_shutdown.shutdown_reason = rand() % 
(sizeof(p->u.domain_shutdown.shutdown_reason)*8);
Since this is a) not critical code by any stretch and b) not something I
expect anyone is going to review, I've just applied it.
Ian
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |