From mboxrd@z Thu Jan 1 00:00:00 1970 From: Goncalo Gomes Subject: Re: libxenserver : xen_vm_get_record() fails with SIGSEGV Date: Tue, 29 Dec 2009 10:58:08 +0000 Message-ID: <4B39E0C0.6000907@eu.citrix.com> References: Reply-To: goncalo.gomes@eu.citrix.com Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Sane, Abhijeet" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi, Sane, Abhijeet wrote: > Hi , > > I am getting a SIGSEGV when calling xen_vm_get_record() function. > Please guide me if I am doing anything wrong. > > > struct xen_vm_set * vm_list = NULL; > //xen_vm_get_all(session,&vm_list); > xen_host_get_resident_vms(session,&vm_list,host); > if ( NULL == vm_list ) > { > print_error(session); > xen_host_free(host); > cleanup(); > return 1; > } > > printf("Total number of virtual machines found on Xen Server %d\n",vm_list->size); > for(int i = 0 ; i < vm_list->size ; i++) > { > xen_vm_record * vm_rec = NULL; > printf("Trying to get VM record\n"); > //--- This is where it fails > xen_vm_get_record(session,&vm_rec ,*( vm_list->contents[i])); > You don't want to dereference that pointer, so just remove the *. Goncalo.