pb-protocol: Don't allocate in deserialise functions
authorJeremy Kerr <jk@ozlabs.org>
Fri, 8 Mar 2013 09:04:21 +0000 (17:04 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 16 Apr 2013 03:41:43 +0000 (11:41 +0800)
commitb838cf777ed3d21b166f8daddd4b11fc75e07307
tree198e3450af8561c3806bd82c30f2daa10566ef70
parent80c072a44cb665495afe08ce37cbf4f2086d5529
pb-protocol: Don't allocate in deserialise functions

Curently, the protocol deserialise functions are allocating device and
boot_command structures. This (implicitly) makes them responsible for
initialisation of these structures too.

Rather that making the protocol responsible for initialising the devices
and boot commands, this change gives the deserialise functions an
argument to an already-instanciated structure. This means that the
creation is no longer implied by the deserialise.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/discover-server.c
lib/pb-protocol/pb-protocol.c
lib/pb-protocol/pb-protocol.h
ui/common/discover-client.c