[Libvirt-cim] [PATCH] Fix get_graphics_device() - returns error if graphics tag is missing
Heidi Eckhart
heidieck at linux.vnet.ibm.com
Tue Jan 8 12:26:29 UTC 2008
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1199734960 28800
> # Node ID abcb596636c9530009756b1aa1e8900a2f01d10e
> # Parent ea65740aa1ffe73b47a4a14c8a853dbb3f040016
> Fix get_graphics_device() - returns error if graphics tag is missing.
>
> The graphics tag isn't mandatory, so we shouldn't return an error here.
> The same problem exists with get_emu_device().
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r ea65740aa1ff -r abcb596636c9 libxkutil/device_parsing.c
> --- a/libxkutil/device_parsing.c Fri Jan 04 12:53:44 2008 -0800
> +++ b/libxkutil/device_parsing.c Mon Jan 07 11:42:40 2008 -0800
> @@ -395,7 +395,7 @@ static int get_emu_device(virDomainPtr d
>
> free(xml);
>
> - return ret;
> + return 1;
> }
>
> static int get_graphics_device(virDomainPtr dom, struct virt_device **dev)
> @@ -416,7 +416,7 @@ static int get_graphics_device(virDomain
>
> free(xml);
>
> - return ret;
> + return 1;
> }
>
> int get_disk_devices(virDomainPtr dom, struct virt_device **list)
>
>
>
If the return code of these two functions does not matter, couldn't we
also make a void function out of them ? This could avoid the impression
that the result of these functions matters for the return code of the
calling function, like in get_dominfo().
--
Regards
Heidi Eckhart
Software Engineer
IBM Linux Technology Center - Open Hypervisor
More information about the Libvirt-cim
mailing list