On 11/8/19 10:08 AM, Alex Bennée wrote: > Rajath Shashidhara <raja...@cs.utexas.edu> writes: >> [b] As per the datasheet, DS3231 has a built-in temperature sensor. >> Temperature can be read from a dedicated register. There can be two >> approaches to emulating this: (1) Return a constant temperature value >> on every read (2) Throw a not-supported exception/warning. What is the >> qemu convention for handling such features ? > > Don't throw an exception. You can at the minimum do a > qemu_log_mask(LOG_UNIMP) to indicate the system is using currently > unimplemented functionality. Alternatively wire-up a device property via > QOM so the user can vary the reported temperature.
FWIW, Phillipe recently added a dummy temp sensor for raspi4: git show 99c641370b52348b2893b2cd19624bf9a416ccfa wherein he hard-codes 25C. Unless you're wanting to test the guest kernel handling of overheating, this seems sufficient. r~