* [PATCH 2/4] kvm: change a loglevel in kvm_vm_ioctl_deassign_device
@ 2009-02-10 12:40 Han, Weidong
2009-02-11 18:59 ` Mark McLoughlin
0 siblings, 1 reply; 3+ messages in thread
From: Han, Weidong @ 2009-02-10 12:40 UTC (permalink / raw)
To: 'Avi Kivity'; +Cc: 'kvm@vger.kernel.org'
[-- Attachment #1: Type: text/plain, Size: 800 bytes --]
change from KERN_INFO to KERN_WARNING to prompt users when
deassign an unassigned device
Signed-off-by: Weidong Han <weidong.han@intel.com>
---
virt/kvm/kvm_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ef52622..03f9807 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -568,7 +568,7 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,
match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
assigned_dev->assigned_dev_id);
if (!match) {
- printk(KERN_INFO "%s: device hasn't been assigned before, "
+ printk(KERN_WARNING "%s: device hasn't been assigned before, "
"so cannot be deassigned\n", __func__);
r = -EINVAL;
goto out;
--
1.6.0.4
[-- Attachment #2: 0002-kvm-change-a-loglevel-in-kvm_vm_ioctl_deassign_devi.patch --]
[-- Type: application/octet-stream, Size: 1002 bytes --]
From 66d48b2c0f3448332cb3624819accbf19bdae392 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Tue, 10 Feb 2009 20:12:36 +0800
Subject: [PATCH] kvm: change a loglevel in kvm_vm_ioctl_deassign_device
change from KERN_INFO to KERN_WARNING to prompt users when
deassign an unassigned device
Signed-off-by: Weidong Han <weidong.han@intel.com>
---
virt/kvm/kvm_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ef52622..03f9807 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -568,7 +568,7 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,
match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
assigned_dev->assigned_dev_id);
if (!match) {
- printk(KERN_INFO "%s: device hasn't been assigned before, "
+ printk(KERN_WARNING "%s: device hasn't been assigned before, "
"so cannot be deassigned\n", __func__);
r = -EINVAL;
goto out;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] kvm: change a loglevel in kvm_vm_ioctl_deassign_device
2009-02-10 12:40 [PATCH 2/4] kvm: change a loglevel in kvm_vm_ioctl_deassign_device Han, Weidong
@ 2009-02-11 18:59 ` Mark McLoughlin
2009-02-13 2:24 ` Han, Weidong
0 siblings, 1 reply; 3+ messages in thread
From: Mark McLoughlin @ 2009-02-11 18:59 UTC (permalink / raw)
To: Han, Weidong; +Cc: 'Avi Kivity', 'kvm@vger.kernel.org'
On Tue, 2009-02-10 at 20:40 +0800, Han, Weidong wrote:
> change from KERN_INFO to KERN_WARNING to prompt users when
> deassign an unassigned device
>
> Signed-off-by: Weidong Han <weidong.han@intel.com>
> ---
> virt/kvm/kvm_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index ef52622..03f9807 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -568,7 +568,7 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,
> match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
> assigned_dev->assigned_dev_id);
> if (!match) {
> - printk(KERN_INFO "%s: device hasn't been assigned before, "
> + printk(KERN_WARNING "%s: device hasn't been assigned before, "
> "so cannot be deassigned\n", __func__);
Personally, I'd drop the printk() - the calling program has passed an
invalid device ID and we've returned -EINVAL, I think we should be
silent in such cases and let the app do the error handling.
Cheers,
Mark.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH 2/4] kvm: change a loglevel in kvm_vm_ioctl_deassign_device
2009-02-11 18:59 ` Mark McLoughlin
@ 2009-02-13 2:24 ` Han, Weidong
0 siblings, 0 replies; 3+ messages in thread
From: Han, Weidong @ 2009-02-13 2:24 UTC (permalink / raw)
To: 'Mark McLoughlin'
Cc: 'Avi Kivity', 'kvm@vger.kernel.org'
Mark McLoughlin wrote:
> On Tue, 2009-02-10 at 20:40 +0800, Han, Weidong wrote:
>> change from KERN_INFO to KERN_WARNING to prompt users when
>> deassign an unassigned device
>>
>> Signed-off-by: Weidong Han <weidong.han@intel.com>
>> ---
>> virt/kvm/kvm_main.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index ef52622..03f9807 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -568,7 +568,7 @@ static int kvm_vm_ioctl_deassign_device(struct
>> kvm *kvm, match =
>> kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
>> assigned_dev->assigned_dev_id); if (!match) {
>> - printk(KERN_INFO "%s: device hasn't been assigned before, "
>> + printk(KERN_WARNING "%s: device hasn't been assigned before, "
>> "so cannot be deassigned\n", __func__);
>
> Personally, I'd drop the printk() - the calling program has passed an
> invalid device ID and we've returned -EINVAL, I think we should be
> silent in such cases and let the app do the error handling.
>
Reasonable.
Regards,
Weidong
> Cheers,
> Mark.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-13 2:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-10 12:40 [PATCH 2/4] kvm: change a loglevel in kvm_vm_ioctl_deassign_device Han, Weidong
2009-02-11 18:59 ` Mark McLoughlin
2009-02-13 2:24 ` Han, Weidong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox