Skip to contentSkip to conversation

vhost: Fix typo in comment

PATCH In review Amos Kong 2 participants 3 messages Aug 31, 2011

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 vhost: Fix typo in comment

vhost_dev_stop() and vhost_dev_disable_notifiers() are called in vhost_net_stop(), correct this comment.

---
 hw/vhost.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/vhost.c +1 -1
index 0870cb7..640aff0 100644
@@ -797,7 +797,7 @@ fail:
     return r;
 }
 
-/* Host notifiers must be enabled at this point. */
+/* Host notifiers must be disabled at this point. */
 void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
 {
     int i, r;
#1 lore raw
Quoted 13 lines · Amos Kong

vhost_dev_stop() and vhost_dev_disable_notifiers() are called in vhost_net_stop(), correct this comment.

---
 hw/vhost.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/vhost.c +0 -0
index 0870cb7..640aff0 100644

hw/vhost.c fail: · line 803

Quoted 8 lines
hw/vhost.c +1 -1
@@ -797,7 +797,7 @@ fail:
     return r;
 }
 
-/* Host notifiers must be enabled at this point. */
+/* Host notifiers must be disabled at this point. */
 void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
 {
     int i, r;

Well it looks like we first call vhost_dev_stop and only afterwards vhost_dev_disable_notifiers. So when vhost_dev_stop is called notifiers are enabled, and they really must be otherwise stuff will fail. Isn't this what the original comment says?
If that's not clear, what would be a better wording?

Signature · 1 line
MST
author
#2 lore raw

----- Original Message -----

Quoted 17 lines · Amos Kong
Quoted 16 lines

vhost_dev_stop() and vhost_dev_disable_notifiers() are called in vhost_net_stop(), correct this comment.

---
 hw/vhost.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/vhost.c +0 -0
index 0870cb7..640aff0 100644
@@ -797,7 +797,7 @@ fail:
     return r;
 }
 
Quoted 12 lines

hw/vhost.c fail: · line 803

Quoted 5 lines
hw/vhost.c +1 -1
-/* Host notifiers must be enabled at this point. */
+/* Host notifiers must be disabled at this point. */
 void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
 {
     int i, r;

Well it looks like we first call vhost_dev_stop and only afterwards vhost_dev_disable_notifiers. So when vhost_dev_stop is called notifiers are enabled, and they really must be otherwise stuff will fail. Isn't this what the original comment says?
If that's not clear, what would be a better wording?

It's my fault to misunderstand the meaning, we can ignore this patch.

Thanks,
Amos