* [PATCHv2] virtio-net: stop vhost backend on vmstop
@ 2010-06-02 18:01 Michael S. Tsirkin
2010-06-04 17:03 ` Marcelo Tosatti
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2010-06-02 18:01 UTC (permalink / raw)
To: kvm
vhost net currently keeps running after vmstop,
which causes trouble as qemy does not check
for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped
status in sync.
Tested-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Changes from v1:
Simplify code as suggested by Amit.
hw/virtio-net.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 28f26e1..67eebcf 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -877,12 +877,11 @@ static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status)
static void virtio_net_vmstate_change(void *opaque, int running, int reason)
{
VirtIONet *n = opaque;
- if (!running) {
- return;
- }
- /* This is called when vm is started, it will start vhost backend if
- * appropriate e.g. after migration. */
- virtio_net_set_status(&n->vdev, n->vdev.status);
+ uint8_t status = running ? n->vdev.status : 0;
+ /* This is called when vm is started/stopped,
+ * it will start/stop vhost backend if appropriate
+ * e.g. after migration. */
+ virtio_net_set_status(&n->vdev, status);
}
VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf)
--
1.7.1.12.g42b7f
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] virtio-net: stop vhost backend on vmstop
2010-06-02 18:01 [PATCHv2] virtio-net: stop vhost backend on vmstop Michael S. Tsirkin
@ 2010-06-04 17:03 ` Marcelo Tosatti
2010-06-10 14:19 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Marcelo Tosatti @ 2010-06-04 17:03 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: kvm
On Wed, Jun 02, 2010 at 09:01:52PM +0300, Michael S. Tsirkin wrote:
> vhost net currently keeps running after vmstop,
> which causes trouble as qemy does not check
> for dirty pages anymore.
> The fix is to simply keep vm and vhost running/stopped
> status in sync.
>
> Tested-by: David L Stevens <dlstevens@us.ibm.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
> Changes from v1:
> Simplify code as suggested by Amit.
>
> hw/virtio-net.c | 11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] virtio-net: stop vhost backend on vmstop
2010-06-04 17:03 ` Marcelo Tosatti
@ 2010-06-10 14:19 ` Michael S. Tsirkin
2010-06-10 14:28 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2010-06-10 14:19 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm
On Fri, Jun 04, 2010 at 02:03:16PM -0300, Marcelo Tosatti wrote:
> On Wed, Jun 02, 2010 at 09:01:52PM +0300, Michael S. Tsirkin wrote:
> > vhost net currently keeps running after vmstop,
> > which causes trouble as qemy does not check
> > for dirty pages anymore.
> > The fix is to simply keep vm and vhost running/stopped
> > status in sync.
> >
> > Tested-by: David L Stevens <dlstevens@us.ibm.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >
> > Changes from v1:
> > Simplify code as suggested by Amit.
> >
> > hw/virtio-net.c | 11 +++++------
> > 1 files changed, 5 insertions(+), 6 deletions(-)
>
> Applied, thanks.
Heh, wrong list, this is actually an upstream patch.
I sent Anthony a merge request with it, hope this
won't create problems.
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] virtio-net: stop vhost backend on vmstop
2010-06-10 14:19 ` Michael S. Tsirkin
@ 2010-06-10 14:28 ` Anthony Liguori
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-06-10 14:28 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Marcelo Tosatti, kvm
On 06/10/2010 09:19 AM, Michael S. Tsirkin wrote:
> On Fri, Jun 04, 2010 at 02:03:16PM -0300, Marcelo Tosatti wrote:
>
>> On Wed, Jun 02, 2010 at 09:01:52PM +0300, Michael S. Tsirkin wrote:
>>
>>> vhost net currently keeps running after vmstop,
>>> which causes trouble as qemy does not check
>>> for dirty pages anymore.
>>> The fix is to simply keep vm and vhost running/stopped
>>> status in sync.
>>>
>>> Tested-by: David L Stevens<dlstevens@us.ibm.com>
>>> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
>>> ---
>>>
>>> Changes from v1:
>>> Simplify code as suggested by Amit.
>>>
>>> hw/virtio-net.c | 11 +++++------
>>> 1 files changed, 5 insertions(+), 6 deletions(-)
>>>
>> Applied, thanks.
>>
> Heh, wrong list, this is actually an upstream patch.
> I sent Anthony a merge request with it, hope this
> won't create problems.
>
git will figure it out.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-10 14:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 18:01 [PATCHv2] virtio-net: stop vhost backend on vmstop Michael S. Tsirkin
2010-06-04 17:03 ` Marcelo Tosatti
2010-06-10 14:19 ` Michael S. Tsirkin
2010-06-10 14:28 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).