* [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
@ 2011-08-11 12:43 Sasha Levin
2011-08-11 12:43 ` [PATCH 2/3] kvm tools: Add kvm__trigger_irq() Sasha Levin
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Sasha Levin @ 2011-08-11 12:43 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin
Instead of exiting directly when a user enters 'ctrl x + a', go through
the regular termination path by stopping all VCPUs and letting the
main thread handle it.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/builtin-run.c | 9 +++++----
tools/kvm/kvm-cpu.c | 8 ++++++--
tools/kvm/term.c | 6 +-----
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index fa5de27..c7ed3fa 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -719,10 +719,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
exit_code = 1;
for (i = 1; i < nrcpus; i++) {
- pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
- if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
- die("pthread_join");
-
+ if (kvm_cpus[i]->is_running) {
+ pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
+ if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
+ die("pthread_join");
+ }
if (ret != NULL)
exit_code = 1;
}
diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
index 2f5d23c..fc0d6d4 100644
--- a/tools/kvm/kvm-cpu.c
+++ b/tools/kvm/kvm-cpu.c
@@ -421,7 +421,11 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
void kvm_cpu__reboot(void)
{
- pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT);
+ int i;
+
+ for (i = 0; i < KVM_NR_CPUS; i++)
+ if (kvm_cpus[i])
+ pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
}
int kvm_cpu__start(struct kvm_cpu *cpu)
@@ -442,7 +446,7 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
if (cpu->kvm->single_step)
kvm_cpu__enable_singlestep(cpu);
- for (;;) {
+ while (cpu->is_running) {
if (cpu->paused) {
kvm__notify_paused();
cpu->paused = 0;
diff --git a/tools/kvm/term.c b/tools/kvm/term.c
index 2a3e1f0..fa4382d 100644
--- a/tools/kvm/term.c
+++ b/tools/kvm/term.c
@@ -34,12 +34,8 @@ int term_getc(int who)
if (term_got_escape) {
term_got_escape = false;
- if (c == 'x') {
+ if (c == 'x')
kvm_cpu__reboot();
- kvm__delete(kvm);
- printf("\n # KVM session terminated.\n");
- exit(1);
- }
if (c == term_escape_char)
return c;
}
--
1.7.6
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] kvm tools: Add kvm__trigger_irq()
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
@ 2011-08-11 12:43 ` Sasha Levin
2011-08-11 12:43 ` [PATCH 3/3] kvm tools: Add MSI-X support to virtio-net Sasha Levin
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-08-11 12:43 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin
Add a helper function to trigger an IRQ.
This function is usefull when an IRQ line has to be raised and lowered
such as when using MSI-X.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/include/kvm/kvm.h | 1 +
tools/kvm/kvm.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
index 1cbe3c7..ccb20bf 100644
--- a/tools/kvm/include/kvm/kvm.h
+++ b/tools/kvm/include/kvm/kvm.h
@@ -63,6 +63,7 @@ void kvm__setup_bios(struct kvm *kvm);
void kvm__start_timer(struct kvm *kvm);
void kvm__stop_timer(struct kvm *kvm);
void kvm__irq_line(struct kvm *kvm, int irq, int level);
+void kvm__irq_trigger(struct kvm *kvm, int irq);
bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int size, u32 count);
bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_write);
void kvm__register_mem(struct kvm *kvm, u64 guest_phys, u64 size, void *userspace_addr);
diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 740851d..be4a02a 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -676,6 +676,12 @@ void kvm__irq_line(struct kvm *kvm, int irq, int level)
die_perror("KVM_IRQ_LINE failed");
}
+void kvm__irq_trigger(struct kvm *kvm, int irq)
+{
+ kvm__irq_line(kvm, irq, 1);
+ kvm__irq_line(kvm, irq, 0);
+}
+
void kvm__dump_mem(struct kvm *kvm, unsigned long addr, unsigned long size)
{
unsigned char *p;
--
1.7.6
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] kvm tools: Add MSI-X support to virtio-net
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
2011-08-11 12:43 ` [PATCH 2/3] kvm tools: Add kvm__trigger_irq() Sasha Levin
@ 2011-08-11 12:43 ` Sasha Levin
2011-08-11 13:33 ` [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path walimis
2011-08-11 13:39 ` Pekka Enberg
3 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-08-11 12:43 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin
The device uses the virtio preferred method of working with MSI-X by
creating one vector for configuration and one vector for each vq in the
device.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/virtio/net.c | 54 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index e865b7f..35d4997 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -60,6 +60,9 @@ struct net_dev {
u8 isr;
u16 queue_selector;
u16 base_addr;
+ u32 vq_vector[VIRTIO_NET_NUM_QUEUES];
+ u32 gsis[VIRTIO_NET_NUM_QUEUES];
+ u32 msix_io_block;
pthread_t io_rx_thread;
pthread_mutex_t io_rx_lock;
@@ -125,7 +128,7 @@ static void *virtio_net_rx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
/* We should interrupt guest right now, otherwise latency is huge. */
- virt_queue__trigger_irq(vq, pci_header.irq_line, &ndev.isr, kvm);
+ kvm__irq_trigger(kvm, ndev.gsis[VIRTIO_NET_RX_QUEUE]);
}
}
@@ -162,8 +165,7 @@ static void *virtio_net_tx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
}
- virt_queue__trigger_irq(vq, pci_header.irq_line, &ndev.isr, kvm);
-
+ kvm__irq_trigger(kvm, ndev.gsis[VIRTIO_NET_TX_QUEUE]);
}
pthread_exit(NULL);
@@ -219,6 +221,12 @@ static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
kvm__irq_line(kvm, pci_header.irq_line, VIRTIO_IRQ_LOW);
ndev.isr = VIRTIO_IRQ_LOW;
break;
+ case VIRTIO_MSI_CONFIG_VECTOR:
+ ioport__write16(data, ndev.config_vector);
+ break;
+ case VIRTIO_MSI_QUEUE_VECTOR:
+ ioport__write16(data, ndev.vq_vector[ndev.queue_selector]);
+ break;
default:
ret = virtio_net_pci_io_device_specific_in(data, offset, size, count);
};
@@ -285,10 +293,22 @@ static bool virtio_net_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 po
ndev.status = ioport__read8(data);
break;
case VIRTIO_MSI_CONFIG_VECTOR:
- ndev.config_vector = VIRTIO_MSI_NO_VECTOR;
+ ndev.config_vector = ioport__read16(data);
break;
- case VIRTIO_MSI_QUEUE_VECTOR:
+ case VIRTIO_MSI_QUEUE_VECTOR: {
+ u32 gsi;
+ u32 vec;
+
+ vec = ndev.vq_vector[ndev.queue_selector] = ioport__read16(data);
+
+ gsi = irq__add_msix_route(kvm,
+ pci_header.msix.table[vec].low,
+ pci_header.msix.table[vec].high,
+ pci_header.msix.table[vec].data);
+
+ ndev.gsis[ndev.queue_selector] = gsi;
break;
+ }
default:
ret = false;
};
@@ -308,6 +328,15 @@ static struct ioport_operations virtio_net_io_ops = {
.io_out = virtio_net_pci_io_out,
};
+static void callback_mmio(u64 addr, u8 *data, u32 len, u8 is_write, void *ptr)
+{
+ void *table = pci_header.msix.table;
+ if (is_write)
+ memcpy(table + addr - ndev.msix_io_block, data, len);
+ else
+ memcpy(data, table + addr - ndev.msix_io_block, len);
+}
+
static bool virtio_net__tap_init(const struct virtio_net_parameters *params)
{
int sock = socket(AF_INET, SOCK_STREAM, 0);
@@ -467,6 +496,21 @@ void virtio_net__init(const struct virtio_net_parameters *params)
ndev.ops = &uip_ops;
}
+ ndev.msix_io_block = pci_get_io_space_block();
+ kvm__register_mmio(params->kvm, ndev.msix_io_block, 0x100, callback_mmio, NULL);
+ pci_header.bar[1] = ndev.msix_io_block |
+ PCI_BASE_ADDRESS_SPACE_MEMORY |
+ PCI_BASE_ADDRESS_MEM_TYPE_64;
+ /* bar[2] is the continuation of bar[1] for 64bit addressing */
+ pci_header.bar[2] = 0;
+ pci_header.status = PCI_STATUS_CAP_LIST;
+ pci_header.capabilities = (void *)&pci_header.msix - (void *)&pci_header;
+
+ pci_header.msix.cap = PCI_CAP_ID_MSIX;
+ pci_header.msix.next = 0;
+ pci_header.msix.table_size = (VIRTIO_NET_NUM_QUEUES + 1) | PCI_MSIX_FLAGS_ENABLE;
+ pci_header.msix.table_offset = 1; /* Use BAR 1 */
+
virtio_net__io_thread_init(params->kvm);
for (i = 0; i < VIRTIO_NET_NUM_QUEUES; i++) {
--
1.7.6
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
2011-08-11 12:43 ` [PATCH 2/3] kvm tools: Add kvm__trigger_irq() Sasha Levin
2011-08-11 12:43 ` [PATCH 3/3] kvm tools: Add MSI-X support to virtio-net Sasha Levin
@ 2011-08-11 13:33 ` walimis
2011-08-11 13:39 ` Pekka Enberg
3 siblings, 0 replies; 9+ messages in thread
From: walimis @ 2011-08-11 13:33 UTC (permalink / raw)
To: Sasha Levin; +Cc: penberg, kvm, mingo, asias.hejun, gorcunov
On Thu, Aug 11, 2011 at 03:43:54PM +0300, Sasha Levin wrote:
>Instead of exiting directly when a user enters 'ctrl x + a', go through
>the regular termination path by stopping all VCPUs and letting the
>main thread handle it.
>
>Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>---
> tools/kvm/builtin-run.c | 9 +++++----
> tools/kvm/kvm-cpu.c | 8 ++++++--
> tools/kvm/term.c | 6 +-----
> 3 files changed, 12 insertions(+), 11 deletions(-)
>
>diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
>index fa5de27..c7ed3fa 100644
>--- a/tools/kvm/builtin-run.c
>+++ b/tools/kvm/builtin-run.c
>@@ -719,10 +719,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
> exit_code = 1;
>
> for (i = 1; i < nrcpus; i++) {
>- pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
>- if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
>- die("pthread_join");
>-
>+ if (kvm_cpus[i]->is_running) {
>+ pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
>+ if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
>+ die("pthread_join");
>+ }
> if (ret != NULL)
> exit_code = 1;
> }
>diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
>index 2f5d23c..fc0d6d4 100644
>--- a/tools/kvm/kvm-cpu.c
>+++ b/tools/kvm/kvm-cpu.c
>@@ -421,7 +421,11 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
>
> void kvm_cpu__reboot(void)
> {
>- pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT);
>+ int i;
>+
>+ for (i = 0; i < KVM_NR_CPUS; i++)
>+ if (kvm_cpus[i])
>+ pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
if so, can we remove "pthread_kill(pthread_self(), SIGKVMEXIT)" from
kvm_cpu_signal_handler?
walimis
> }
>
> int kvm_cpu__start(struct kvm_cpu *cpu)
>@@ -442,7 +446,7 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
> if (cpu->kvm->single_step)
> kvm_cpu__enable_singlestep(cpu);
>
>- for (;;) {
>+ while (cpu->is_running) {
> if (cpu->paused) {
> kvm__notify_paused();
> cpu->paused = 0;
>diff --git a/tools/kvm/term.c b/tools/kvm/term.c
>index 2a3e1f0..fa4382d 100644
>--- a/tools/kvm/term.c
>+++ b/tools/kvm/term.c
>@@ -34,12 +34,8 @@ int term_getc(int who)
>
> if (term_got_escape) {
> term_got_escape = false;
>- if (c == 'x') {
>+ if (c == 'x')
> kvm_cpu__reboot();
>- kvm__delete(kvm);
>- printf("\n # KVM session terminated.\n");
>- exit(1);
>- }
> if (c == term_escape_char)
> return c;
> }
>--
>1.7.6
>
>--
>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] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
` (2 preceding siblings ...)
2011-08-11 13:33 ` [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path walimis
@ 2011-08-11 13:39 ` Pekka Enberg
2011-08-11 13:41 ` Sasha Levin
3 siblings, 1 reply; 9+ messages in thread
From: Pekka Enberg @ 2011-08-11 13:39 UTC (permalink / raw)
To: Sasha Levin; +Cc: kvm, mingo, asias.hejun, gorcunov
On Thu, 11 Aug 2011, Sasha Levin wrote:
> Instead of exiting directly when a user enters 'ctrl x + a', go through
> the regular termination path by stopping all VCPUs and letting the
> main thread handle it.
>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
> tools/kvm/builtin-run.c | 9 +++++----
> tools/kvm/kvm-cpu.c | 8 ++++++--
> tools/kvm/term.c | 6 +-----
> 3 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
> index fa5de27..c7ed3fa 100644
> --- a/tools/kvm/builtin-run.c
> +++ b/tools/kvm/builtin-run.c
> @@ -719,10 +719,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
> exit_code = 1;
>
> for (i = 1; i < nrcpus; i++) {
> - pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> - if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
> - die("pthread_join");
> -
> + if (kvm_cpus[i]->is_running) {
> + pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> + if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
> + die("pthread_join");
> + }
> if (ret != NULL)
> exit_code = 1;
> }
> diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
> index 2f5d23c..fc0d6d4 100644
> --- a/tools/kvm/kvm-cpu.c
> +++ b/tools/kvm/kvm-cpu.c
> @@ -421,7 +421,11 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
>
> void kvm_cpu__reboot(void)
> {
> - pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT);
> + int i;
> +
> + for (i = 0; i < KVM_NR_CPUS; i++)
> + if (kvm_cpus[i])
> + pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> }
>
> int kvm_cpu__start(struct kvm_cpu *cpu)
> @@ -442,7 +446,7 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
> if (cpu->kvm->single_step)
> kvm_cpu__enable_singlestep(cpu);
>
> - for (;;) {
> + while (cpu->is_running) {
> if (cpu->paused) {
> kvm__notify_paused();
> cpu->paused = 0;
> diff --git a/tools/kvm/term.c b/tools/kvm/term.c
> index 2a3e1f0..fa4382d 100644
> --- a/tools/kvm/term.c
> +++ b/tools/kvm/term.c
> @@ -34,12 +34,8 @@ int term_getc(int who)
>
> if (term_got_escape) {
> term_got_escape = false;
> - if (c == 'x') {
> + if (c == 'x')
> kvm_cpu__reboot();
> - kvm__delete(kvm);
> - printf("\n # KVM session terminated.\n");
This is a nice cleanup but I'm not happy about the fact that you also nuke
the above printf(). Is there a simple way to keep it there?
> - exit(1);
> - }
> if (c == term_escape_char)
> return c;
> }
> --
> 1.7.6
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 13:39 ` Pekka Enberg
@ 2011-08-11 13:41 ` Sasha Levin
2011-08-11 13:47 ` Pekka Enberg
0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2011-08-11 13:41 UTC (permalink / raw)
To: Pekka Enberg; +Cc: kvm, mingo, asias.hejun, gorcunov
On Thu, 2011-08-11 at 16:39 +0300, Pekka Enberg wrote:
> On Thu, 11 Aug 2011, Sasha Levin wrote:
> > Instead of exiting directly when a user enters 'ctrl x + a', go through
> > the regular termination path by stopping all VCPUs and letting the
> > main thread handle it.
> >
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > ---
> > tools/kvm/builtin-run.c | 9 +++++----
> > tools/kvm/kvm-cpu.c | 8 ++++++--
> > tools/kvm/term.c | 6 +-----
> > 3 files changed, 12 insertions(+), 11 deletions(-)
> >
> > diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
> > index fa5de27..c7ed3fa 100644
> > --- a/tools/kvm/builtin-run.c
> > +++ b/tools/kvm/builtin-run.c
> > @@ -719,10 +719,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
> > exit_code = 1;
> >
> > for (i = 1; i < nrcpus; i++) {
> > - pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> > - if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
> > - die("pthread_join");
> > -
> > + if (kvm_cpus[i]->is_running) {
> > + pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> > + if (pthread_join(kvm_cpus[i]->thread, &ret) != 0)
> > + die("pthread_join");
> > + }
> > if (ret != NULL)
> > exit_code = 1;
> > }
> > diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
> > index 2f5d23c..fc0d6d4 100644
> > --- a/tools/kvm/kvm-cpu.c
> > +++ b/tools/kvm/kvm-cpu.c
> > @@ -421,7 +421,11 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
> >
> > void kvm_cpu__reboot(void)
> > {
> > - pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT);
> > + int i;
> > +
> > + for (i = 0; i < KVM_NR_CPUS; i++)
> > + if (kvm_cpus[i])
> > + pthread_kill(kvm_cpus[i]->thread, SIGKVMEXIT);
> > }
> >
> > int kvm_cpu__start(struct kvm_cpu *cpu)
> > @@ -442,7 +446,7 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
> > if (cpu->kvm->single_step)
> > kvm_cpu__enable_singlestep(cpu);
> >
> > - for (;;) {
> > + while (cpu->is_running) {
> > if (cpu->paused) {
> > kvm__notify_paused();
> > cpu->paused = 0;
> > diff --git a/tools/kvm/term.c b/tools/kvm/term.c
> > index 2a3e1f0..fa4382d 100644
> > --- a/tools/kvm/term.c
> > +++ b/tools/kvm/term.c
> > @@ -34,12 +34,8 @@ int term_getc(int who)
> >
> > if (term_got_escape) {
> > term_got_escape = false;
> > - if (c == 'x') {
> > + if (c == 'x')
> > kvm_cpu__reboot();
> > - kvm__delete(kvm);
> > - printf("\n # KVM session terminated.\n");
>
> This is a nice cleanup but I'm not happy about the fact that you also nuke
> the above printf(). Is there a simple way to keep it there?
>
You get that printf from the normal exit path.
> > - exit(1);
> > - }
> > if (c == term_escape_char)
> > return c;
> > }
> > --
> > 1.7.6
> >
> >
--
Sasha.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 13:41 ` Sasha Levin
@ 2011-08-11 13:47 ` Pekka Enberg
2011-08-11 13:48 ` Sasha Levin
0 siblings, 1 reply; 9+ messages in thread
From: Pekka Enberg @ 2011-08-11 13:47 UTC (permalink / raw)
To: Sasha Levin; +Cc: kvm, mingo, asias.hejun, gorcunov
On Thu, 11 Aug 2011, Sasha Levin wrote:
>> This is a nice cleanup but I'm not happy about the fact that you also nuke
>> the above printf(). Is there a simple way to keep it there?
>>
>
> You get that printf from the normal exit path.
You get a different printf:
$ grep -r "KVM session" *.c
builtin-run.c: printf("\n # KVM session ended normally.\n");
term.c: printf("\n # KVM session terminated.\n");
It's nice to see that the user terminated the session without going
through reboot cycle. Dunno how much it matters but it'd be nice to keep
it since it's already there.
Pekka
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 13:47 ` Pekka Enberg
@ 2011-08-11 13:48 ` Sasha Levin
2011-08-11 14:04 ` Pekka Enberg
0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2011-08-11 13:48 UTC (permalink / raw)
To: Pekka Enberg; +Cc: kvm, mingo, asias.hejun, gorcunov
On Thu, 2011-08-11 at 16:47 +0300, Pekka Enberg wrote:
> On Thu, 11 Aug 2011, Sasha Levin wrote:
> >> This is a nice cleanup but I'm not happy about the fact that you also nuke
> >> the above printf(). Is there a simple way to keep it there?
> >>
> >
> > You get that printf from the normal exit path.
>
> You get a different printf:
>
> $ grep -r "KVM session" *.c
> builtin-run.c: printf("\n # KVM session ended normally.\n");
> term.c: printf("\n # KVM session terminated.\n");
>
> It's nice to see that the user terminated the session without going
> through reboot cycle. Dunno how much it matters but it'd be nice to keep
> it since it's already there.
Hm... In that case, how about changing it to "# KVM session
terminating..." which will be followed by "# KVM session terminated"
when the guest is actually dead?
--
Sasha.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path
2011-08-11 13:48 ` Sasha Levin
@ 2011-08-11 14:04 ` Pekka Enberg
0 siblings, 0 replies; 9+ messages in thread
From: Pekka Enberg @ 2011-08-11 14:04 UTC (permalink / raw)
To: Sasha Levin; +Cc: kvm, mingo, asias.hejun, gorcunov
On Thu, 11 Aug 2011, Sasha Levin wrote:
>> You get a different printf:
>>
>> $ grep -r "KVM session" *.c
>> builtin-run.c: printf("\n # KVM session ended normally.\n");
>> term.c: printf("\n # KVM session terminated.\n");
>>
>> It's nice to see that the user terminated the session without going
>> through reboot cycle. Dunno how much it matters but it'd be nice to keep
>> it since it's already there.
>
> Hm... In that case, how about changing it to "# KVM session
> terminating..." which will be followed by "# KVM session terminated"
> when the guest is actually dead?
It would just add more noise. Oh well, I applied your patch.
Pekka
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-08-11 14:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
2011-08-11 12:43 ` [PATCH 2/3] kvm tools: Add kvm__trigger_irq() Sasha Levin
2011-08-11 12:43 ` [PATCH 3/3] kvm tools: Add MSI-X support to virtio-net Sasha Levin
2011-08-11 13:33 ` [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path walimis
2011-08-11 13:39 ` Pekka Enberg
2011-08-11 13:41 ` Sasha Levin
2011-08-11 13:47 ` Pekka Enberg
2011-08-11 13:48 ` Sasha Levin
2011-08-11 14:04 ` Pekka Enberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox