On Tue, 22 Apr 2014, Gerd Hoffmann wrote: > > > if (dev) { > > > - object_property_set_link(OBJECT(s), OBJECT(dev), > > > - "device", &local_err); > > > - object_property_set_int(OBJECT(s), head, > > > - "head", &local_err); > > > + object_property_set_link(OBJECT(s), OBJECT(dev), "device", NULL); > > > + object_property_set_int(OBJECT(s), head, "head", NULL); > > > > I guess it would be better to use &error_abort rather than failing > > silently. > > Agree. >
The result of this change was a bit unexpected. QEMU fails to start with the error "Insufficient permission to perform this operation". This happens because "head" is a read-only property. Fortunately it is usually (always?) zero at creation time and we always try to write zero also. So it works somehow. But non-zero head will not work. We need either to initialize it in new_console with right head value or to change it to simple struct field. It depends entirely on our future plans for it. In v2 I also plan to change all occurrences of &local_err to &error_abort in ui/console.c They all are unchecked and can cause memory leaks and/or weird silent failures like setting of "head" property had. -- Kirill