mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
multi-process: perform device reset in the remote process
Perform device reset in the remote process when QEMU performs device reset. This is required to reset the internal state (like registers, etc...) of emulated devices Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com> Signed-off-by: John G Johnson <john.g.johnson@oracle.com> Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 7cb220a51f565dc0817bd76e2f540e89c2d2b850.1611938319.git.jag.raman@oracle.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
1bec145cd9
commit
b6cc02d98f
3 changed files with 42 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "util/event_notifier-posix.c"
|
||||
|
||||
static void probe_pci_info(PCIDevice *dev, Error **errp);
|
||||
static void proxy_device_reset(DeviceState *dev);
|
||||
|
||||
static void proxy_intx_update(PCIDevice *pci_dev)
|
||||
{
|
||||
|
@ -202,6 +203,8 @@ static void pci_proxy_dev_class_init(ObjectClass *klass, void *data)
|
|||
k->config_read = pci_proxy_read_config;
|
||||
k->config_write = pci_proxy_write_config;
|
||||
|
||||
dc->reset = proxy_device_reset;
|
||||
|
||||
device_class_set_props(dc, proxy_properties);
|
||||
}
|
||||
|
||||
|
@ -358,3 +361,19 @@ static void probe_pci_info(PCIDevice *dev, Error **errp)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void proxy_device_reset(DeviceState *dev)
|
||||
{
|
||||
PCIProxyDev *pdev = PCI_PROXY_DEV(dev);
|
||||
MPQemuMsg msg = { 0 };
|
||||
Error *local_err = NULL;
|
||||
|
||||
msg.cmd = MPQEMU_CMD_DEVICE_RESET;
|
||||
msg.size = 0;
|
||||
|
||||
mpqemu_msg_send_and_await_reply(&msg, pdev, &local_err);
|
||||
if (local_err) {
|
||||
error_report_err(local_err);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue