Skip to contentSkip to conversation

Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread

PATCH In review Wang guang 3 participants 4 messages Apr 7, 2017

lore
Share & tools
lore

Wang guang

author
#0 lore raw

PATCH 1/1 Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread

From: Guang Wang <[email protected]>

Due to

---
 migration/socket.c | 1 +
 1 file changed, 1 insertion(+)
migration/socket.c +1 -0
index 13966f1..193ed22 100644
@@ -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));
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 vhost: skip RAM device memory sections

From: ZhiPeng Lu <[email protected]>

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.

---
 hw/virtio/vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/virtio/vhost.c +2 -1
index 613494d..c1ff98f 100644
@@ -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)
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections

Quoted 22 lines · Wang guang

From: ZhiPeng Lu <[email protected]>

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.

---
 hw/virtio/vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/virtio/vhost.c +0 -0
index 613494d..c1ff98f 100644

hw/virtio/vhost.c static void vhost_set_memory(MemoryListener *listener, · line 616

Quoted 7 lines
hw/virtio/vhost.c +2 -1
@@ -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

#3 lore raw
In reply to Wang guang
Quoted 14 lines · Wang guang

From: Guang Wang <[email protected]>

Due to

---
 migration/socket.c | 1 +
 1 file changed, 1 insertion(+)
migration/socket.c +0 -0
index 13966f1..193ed22 100644

migration/socket.c static gboolean socket_accept_incoming_migration(QIOChannel *ioc, · line 152

Quoted 4 lines
migration/socket.c +1 -0
@@ -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

Signature · 3 lines
|: 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/ :|