Nothing wrong with Don's patch as far as I can see, but...

Don Slutz <dsl...@verizon.com> writes:

> This can help a user understand why -global was ignored.
>
> For example: with "-vga cirrus"; "-global vga.vgamem_mb=16" is just
> ignored when "-global cirrus-vga.vgamem_mb=16" is not.
>
> This is currently clear when the wrong property is provided:
>
> out/x86_64-softmmu/qemu-system-x86_64 -global cirrus-vga.vram_size_mb=16 
> -monitor pty -vga cirrus
> char device redirected to /dev/pts/20 (label compat_monitor0)
> qemu-system-x86_64: Property '.vram_size_mb' not found
> Aborted (core dumped)

... dumping core here is not nice.

Looks like this regressed in Eduardo's commit 99a0b03 qdev: Set globals
in instance_post_init function.

Before, we exited cleanly on this error, in device_initfn():

        qdev_prop_set_globals(dev, &err);
        if (err != NULL) {
            qerror_report_err(err);
            error_free(err);
            exit(1);
        }

The commit asserts qdev_prop_set_globals() can't fail, which is wrong.

    static void device_post_init(Object *obj)
    {
        DeviceState *dev = DEVICE(obj);
        Error *err = NULL;

        qdev_prop_set_globals(dev, &err);
        assert_no_error(err);
    }

Later simplified to:

    static void device_post_init(Object *obj)
    {
        qdev_prop_set_globals(DEVICE(obj), &error_abort);
    }

Any takers?

[...]

Reply via email to