[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Possible bug in function libxl.c interface in the function libxl_wait_for_memory_target()

  • To: xen-devel@xxxxxxxxxxxxx
  • From: ayush ruia <ayushruia@xxxxxxxxx>
  • Date: Sun, 5 Oct 2014 01:01:19 -0500
  • Delivery-date: Sun, 05 Oct 2014 06:18:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi all,
The following code function might possibly return an incorrect value in the case of the target memory not meeting the required value after waiting for a given time period. Quoting the following lines from the xen git repositoryÂhttp://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl.c;h=77672d06bac0636c3c9f8d5ab0475ab796246f7c;hb=HEAD

4697 Â Â if ((info.current_memkb + info.outstanding_memkb) <= target_memkb)
4698 Â Â Â Â rc = 0;
4699 Â Â else
4700 Â Â Â Â rc = ERROR_FAIL;
4702 out:
4703 Â Â return 0;
4704 }

Here we calculate the return value and in the case of failure it should be ERROR_FAIL . However we still return the value 0. Thus possibly this function will still return 0 in the event of an error.

Ayush Ruia.
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.