hw/hyperv/hyperv.c: Use device_cold_reset() instead of device_legacy_reset()
PATCH 1/1 hw/hyperv/hyperv.c: Use device_cold_reset() instead of device_legacy_reset()
The semantic difference between the deprecated device_legacy_reset() function and the newer device_cold_reset() function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. In hyperv_synic_reset() we reset a SynICState, which has no qbuses, so for this purpose the two functions behave identically and we can stop using the deprecated one.
---
NB: tested only with 'make check' and 'make check-avocado', which may well not exercise this.
hw/hyperv/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/hyperv/hyperv.c +1 -1
@@ -157,7 +157,7 @@ void hyperv_synic_reset(CPUState *cs)SynICState *synic =get_synic (cs);if (synic) { -device_legacy_reset (DEVICE (synic)); +device_cold_reset (DEVICE (synic)); } }
Signature · 1 line
2.25.1
Quoted 8 lines · Peter Maydell
The semantic difference between the deprecated
device_legacy_reset()function and the newerdevice_cold_reset()function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. Inhyperv_synic_reset()we reset a SynICState, which has no qbuses, so for this purpose the two functions behave identically and we can stop using the deprecated one.
Quoted 5 lines
Signed-off-by Peter Maydell <[email protected]>---
NB: tested only with 'make check' and 'make check-avocado', which may well not exercise this.
In general the patch LGTM, but I will runtime-test it on Monday just to be sure.
Thanks,
Maciej
Maciej S. Szmigiero
Reviewed-byQuoted 9 lines · Maciej S. Szmigiero
Quoted 8 lines · Peter Maydell
The semantic difference between the deprecated
device_legacy_reset()function and the newerdevice_cold_reset()function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. Inhyperv_synic_reset()we reset a SynICState, which has no qbuses, so for this purpose the two functions behave identically and we can stop using the deprecated one.
Quoted 9 lines
Quoted 5 lines
Signed-off-by Peter Maydell <[email protected]>---
NB: tested only with 'make check' and 'make check-avocado', which may well not exercise this.In general the patch LGTM, but I will runtime-test it on Monday just to be sure.
Tested and works fine on QEMU with SynIC reset fix [1] applied, so:
Thanks,
Maciej
Quoted 17 lines · Maciej S. Szmigiero
Quoted 15 lines · Maciej S. Szmigiero
Quoted 13 lines · Peter Maydell
The semantic difference between the deprecated
device_legacy_reset()function and the newerdevice_cold_reset()function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. Inhyperv_synic_reset()we reset a SynICState, which has no qbuses, so for this purpose the two functions behave identically and we can stop using the deprecated one.Signed-off-by Peter Maydell <[email protected]>---
NB: tested only with 'make check' and 'make check-avocado', which may well not exercise this.
Quoted 6 lines
Quoted 3 lines
In general the patch LGTM, but I will runtime-test it on Monday just to be sure.
Tested and works fine on QEMU with SynIC reset fix [1] applied, so:
Reviewed-by Maciej S. Szmigiero <[email protected]>
Thanks for testing; I'll take this through target-arm.next since I'm doing a pullreq anyway, unless somebody would prefer otherwise.
-- PMM