[Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread

Wang guang posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1491614183-4580-1-git-send-email-wang.guang55@zte.com.cn
Test checkpatch passed
Test docker passed
Test s390x passed
migration/socket.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread
Posted by Wang guang 7 years ago
From: Guang Wang <wang.guang55@zte.com.cn>

Due to

Signed-off-by: Wang guang <wang.guang55@zte.com.cn>
---
 migration/socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/migration/socket.c b/migration/socket.c
index 13966f1..193ed22 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -149,6 +149,7 @@ static gboolean socket_accept_incoming_migration(QIOChannel *ioc,
     trace_migration_socket_incoming_accepted();
 
     qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-incoming");
+    qio_channel_set_feature(QIO_CHANNEL(sioc), QIO_CHANNEL_FEATURE_SHUTDOWN);
     migration_channel_process_incoming(migrate_get_current(),
                                        QIO_CHANNEL(sioc));
     object_unref(OBJECT(sioc));
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread
Posted by Daniel P. Berrange 7 years ago
On Sat, Apr 08, 2017 at 09:16:22AM +0800, Wang guang wrote:
> From: Guang Wang <wang.guang55@zte.com.cn>
> 
> Due to
> 
> Signed-off-by: Wang guang <wang.guang55@zte.com.cn>
> ---
>  migration/socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/socket.c b/migration/socket.c
> index 13966f1..193ed22 100644
> --- a/migration/socket.c
> +++ b/migration/socket.c
> @@ -149,6 +149,7 @@ static gboolean socket_accept_incoming_migration(QIOChannel *ioc,
>      trace_migration_socket_incoming_accepted();
>  
>      qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-incoming");
> +    qio_channel_set_feature(QIO_CHANNEL(sioc), QIO_CHANNEL_FEATURE_SHUTDOWN);

Nothing outside the io/ directory should be calling set_feature. The
shutdown feature is set by the channel-socket.c code when required.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

[Qemu-devel] [PATCH] vhost: skip RAM device memory sections
Posted by Wang guang 7 years ago
From: ZhiPeng Lu <lu.zhipeng@zte.com.cn>

A RAM device represents a mapping to a physical device, such as to a PCI
* MMIO BAR of an vfio-pci assigned device.
Vhost listens to this region,and increases the region's reference count
while passthrough?for?network adapters (Physical Function, PF or Virtual Function, VF).
After detaching   network adapters with  vhost backend dirver or vhost user dirver,
it unregister vhost listen function  by memory_listener_unregister.
After detaching the passthrough pf  or vf,
the RAM device region's reference by  vhost listener increated can not be released,
due to vhost listen function does not exist.So let's just skip RAM device memory.

Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
---
 hw/virtio/vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 613494d..c1ff98f 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -611,7 +611,8 @@ static void vhost_set_memory(MemoryListener *listener,
 static bool vhost_section(MemoryRegionSection *section)
 {
     return memory_region_is_ram(section->mr) &&
-        !memory_region_is_rom(section->mr);
+        !memory_region_is_rom(section->mr) &&
+        !memory_region_is_skip_dump(section->mr);
 }
 
 static void vhost_begin(MemoryListener *listener)
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
Posted by Paolo Bonzini 7 years ago

On 08/04/2017 09:16, Wang guang wrote:
> From: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> 
> A RAM device represents a mapping to a physical device, such as to a PCI
> * MMIO BAR of an vfio-pci assigned device.
> Vhost listens to this region,and increases the region's reference count
> while passthrough?for?network adapters (Physical Function, PF or Virtual Function, VF).
> After detaching   network adapters with  vhost backend dirver or vhost user dirver,
> it unregister vhost listen function  by memory_listener_unregister.
> After detaching the passthrough pf  or vf,
> the RAM device region's reference by  vhost listener increated can not be released,
> due to vhost listen function does not exist.So let's just skip RAM device memory.
> 
> Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> ---
>  hw/virtio/vhost.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 613494d..c1ff98f 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -611,7 +611,8 @@ static void vhost_set_memory(MemoryListener *listener,
>  static bool vhost_section(MemoryRegionSection *section)
>  {
>      return memory_region_is_ram(section->mr) &&
> -        !memory_region_is_rom(section->mr);
> +        !memory_region_is_rom(section->mr) &&
> +        !memory_region_is_skip_dump(section->mr);
>  }

Why not memory_region_is_ram_device?

Paolo