libqos: split I2CAdapter initialization and allocation

Provide *_init functions that populate an I2CAdapter struct without
allocating one, and make the existing *_create functions wrap them.

Because in the new setup *_create might return a pointer inside the
IMXI2C or OMAPI2C struct, create companion *_free functions to go
back to the outer pointer.

All this is temporary until allocation will be handled entirely by
qgraph.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2019-03-18 17:12:25 +01:00
parent c4f00daa5b
commit 732c919cf0
5 changed files with 67 additions and 34 deletions

View file

@ -96,7 +96,7 @@ int main(int argc, char **argv)
if (s) {
qtest_quit(s);
}
g_free(i2c);
omap_i2c_free(i2c);
return ret;
}