qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Should not abort on -global <nonexistant dev prop>
Date: Fri, 06 Jun 2014 10:01:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 06/06/2014 09:09, Markus Armbruster ha scritto:
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);
        }

Hmm, right. I had noticed this abort in the past, but I wasn't sure if it was a regression or not.

However, the above is not hotplug-friendly either. In this sense, I prefer an assertion that clearly says "gotta fix something here".

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);
    }

I think the bug is that the global property should have been filtered out early. Or alternatively we need something better than device_post_init to set the globals... no ideas for now.

Paolo




reply via email to

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