Skip to contentSkip to conversation

kvm tools: Modify thread pool API

PATCH New Sasha Levin 1 participant 1 message Apr 29, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tools: Modify thread pool API

Modify API function names and type names.

---
 tools/kvm/include/kvm/threadpool.h |    4 +-
 tools/kvm/threadpool.c             |   42 ++++++++++++++++++------------------
 tools/kvm/virtio-blk.c             |    4 +-
 tools/kvm/virtio-console.c         |    8 +++---
 tools/kvm/virtio-net.c             |    6 ++--
 5 files changed, 32 insertions(+), 32 deletions(-)
tools/kvm/include/kvm/threadpool.h +2 -2
index 25b5eb8..4716411 100644
@@ -9,8 +9,8 @@ typedef void (*kvm_thread_callback_fn_t)(struct kvm *kvm, void *data);
 
 int thread_pool__init(unsigned long thread_count);
 
-void *thread_pool__add_jobtype(struct kvm *kvm, kvm_thread_callback_fn_t callback, void *data);
+void *thread_pool__add_job(struct kvm *kvm, kvm_thread_callback_fn_t callback, void *data);
 
-void thread_pool__signal_work(void *job);
+void thread_pool__do_job(void *job);
 
 #endif
tools/kvm/threadpool.c +21 -21

120 lines not on this page · raw message

tools/kvm/virtio-blk.c +2 -2
index 3feabd0..9034abd 100644
@@ -188,7 +188,7 @@ static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, i
 		vring_init(&queue->vring, VIRTIO_BLK_QUEUE_SIZE, p, 4096);
 
 		blk_device.jobs[blk_device.queue_selector] =
-			thread_pool__add_jobtype(self, virtio_blk_do_io, queue);
+			thread_pool__add_job(self, virtio_blk_do_io, queue);
 
 		break;
 	}
@@ -198,7 +198,7 @@ static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, i
 	case VIRTIO_PCI_QUEUE_NOTIFY: {
 		uint16_t queue_index;
 		queue_index		= ioport__read16(data);
-		thread_pool__signal_work(blk_device.jobs[queue_index]);
+		thread_pool__do_job(blk_device.jobs[queue_index]);
 		break;
 	}
 	case VIRTIO_PCI_STATUS:
tools/kvm/virtio-console.c +4 -4
index e66d198..f440ded 100644
@@ -85,7 +85,7 @@ static void virtio_console__inject_interrupt_callback(struct kvm *self, void *pa
 
 void virtio_console__inject_interrupt(struct kvm *self)
 {
-	thread_pool__signal_work(console_device.jobs[VIRTIO_CONSOLE_RX_QUEUE]);
+	thread_pool__do_job(console_device.jobs[VIRTIO_CONSOLE_RX_QUEUE]);
 }
 
 static bool virtio_console_pci_io_device_specific_in(void *data, unsigned long offset, int size, uint32_t count)
@@ -190,10 +190,10 @@ static bool virtio_console_pci_io_out(struct kvm *self, uint16_t port, void *dat
 
 		if (console_device.queue_selector == VIRTIO_CONSOLE_TX_QUEUE)
 			console_device.jobs[console_device.queue_selector] =
-				thread_pool__add_jobtype(self, virtio_console_handle_callback, queue);
+				thread_pool__add_job(self, virtio_console_handle_callback, queue);
 		else if (console_device.queue_selector == VIRTIO_CONSOLE_RX_QUEUE)
 			console_device.jobs[console_device.queue_selector] =
-				thread_pool__add_jobtype(self, virtio_console__inject_interrupt_callback, queue);
+				thread_pool__add_job(self, virtio_console__inject_interrupt_callback, queue);
 
 		break;
 	}
@@ -203,7 +203,7 @@ static bool virtio_console_pci_io_out(struct kvm *self, uint16_t port, void *dat
 	case VIRTIO_PCI_QUEUE_NOTIFY: {
 		uint16_t queue_index;
 		queue_index	= ioport__read16(data);
-		thread_pool__signal_work(console_device.jobs[queue_index]);
+		thread_pool__do_job(console_device.jobs[queue_index]);
 		break;
 	}
 	case VIRTIO_PCI_STATUS:
tools/kvm/virtio-net.c +3 -3
index 58b3de4..bbd687c 100644
@@ -161,7 +161,7 @@ static bool virtio_net_pci_io_in(struct kvm *self, uint16_t port, void *data, in
 
 static void virtio_net_handle_callback(struct kvm *self, uint16_t queue_index)
 {
-	thread_pool__signal_work(net_device.jobs[queue_index]);
+	thread_pool__do_job(net_device.jobs[queue_index]);
 }
 
 static bool virtio_net_pci_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
@@ -189,10 +189,10 @@ static bool virtio_net_pci_io_out(struct kvm *self, uint16_t port, void *data, i
 
 		if (net_device.queue_selector == VIRTIO_NET_TX_QUEUE)
 			net_device.jobs[net_device.queue_selector] =
-				thread_pool__add_jobtype(self, virtio_net_tx_callback, queue);
+				thread_pool__add_job(self, virtio_net_tx_callback, queue);
 		else if (net_device.queue_selector == VIRTIO_NET_RX_QUEUE)
 			net_device.jobs[net_device.queue_selector] =
-				thread_pool__add_jobtype(self, virtio_net_rx_callback, queue);
+				thread_pool__add_job(self, virtio_net_rx_callback, queue);
 
 		break;
 	}
Signature · 1 line
1.7.5.rc3