On 2015/3/11 1:40, Michael S. Tsirkin wrote:
On Tue, Mar 10, 2015 at 07:26:13PM +0200, Marcel Apfelbaum wrote:
On 03/10/2015 07:07 PM, Michael S. Tsirkin wrote:
On Sun, Mar 08, 2015 at 01:16:13PM +0200, Marcel Apfelbaum wrote:
>Signed-off-by: Marcel Apfelbaum marcel@redhat.com >--- > hw/i386/acpi-build.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 65 insertions(+) > >diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c >index e5709e8..e7a1a36 100644 >--- a/hw/i386/acpi-build.c >+++ b/hw/i386/acpi-build.c >@@ -664,6 +664,70 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, > aml_append(parent_scope, method); > } > >+static Aml *build_link(Aml *lnk, Aml *lnk_pkg, const char *link_name, int idx)
Pls document arguments, and generally make this function more readable.
I'll think of something
>+{ >+ Aml *if_ctx, *pkg; >+ >+ if_ctx = aml_if(aml_equal(lnk, aml_int(idx))); >+ pkg = aml_package(4);
These assignments can be part of declarations.
OK
>+ aml_append(pkg, aml_int(0)); >+ aml_append(pkg, aml_int(0)); >+ aml_append(pkg, aml_name(link_name, ""));
this sould be aml_name(link_name) I think?
It doesn't work without the "" agument, works only for literals. If you have any idea how to make it work, I'll be glad to change it.
So use "%s" format then.
Yes, use aml_name("%s", link_name) it should work.