qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Virtio device "exit" function


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Virtio device "exit" function
Date: Fri, 16 Oct 2015 14:18:05 +0200
User-agent: Mutt/1.5.24 (2015-08-30)

On Wed, Sep 23, 2015 at 04:32:00PM +0000, Chris Johnson wrote:
> I am working on adding a virtio device to support a PCIe card (PCIe
> pass-through wasn't an option). I need to do some cleanup when a VM that is
> using this device is shutdown. It doesn't seem like the device_unrealize
> function runs on shutdown unlike the device_realize function that runs when
> the VM is started. I've been tracing through other virtio device code to try
> and figure out what "exit" type functions will run for other devices when a
> VM is shutdown but haven't had any luck with that yet.
> 
> When does a virtio device's unrealize function run?
> 
> What function, if any, runs for a virtio device when a VM is shutdown?

When QEMU terminates in vl.c:main(), devices are not unrealized.

The unrealize code is only invoked on hot unplug (e.g. PCI card removed
via 'device_del' command).

What are you trying to do in the unrealize function?

Stefan



reply via email to

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