qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Should not abort on -global <nonexistant dev prop> (was: [P


From: Markus Armbruster
Subject: [Qemu-devel] Should not abort on -global <nonexistant dev prop> (was: [PATCH v4 1/2] qdev: Display warning about unused -global)
Date: Fri, 06 Jun 2014 09:09:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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

Don Slutz <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]