acpi: Simplify printing to dynamic string
commitc3bdc56c183f6ca6baa502bd7861583ca98b333b
authorMarkus Armbruster <armbru@redhat.com>
Wed, 27 May 2015 17:55:55 +0000 (27 19:55 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 31 May 2015 18:24:07 +0000 (31 20:24 +0200)
tree80f533b97c56061153c887d243c9dad321eb2831
parentea96bc629cbd52be98b2967a4b4f72e91dfc3ee4
acpi: Simplify printing to dynamic string

build_append_namestringv() and aml_string() first calculate the
resulting string's length with vsnprintf(NULL, ...), then allocate,
then print for real.  Simply use g_strdup_vprintf() or g_vasprintf()
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/acpi/aml-build.c