All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: [PATCH v5-light 5/6] KVM: Clean up kvm_vm_ioctl_assigned_device
Date: Tue, 16 Nov 2010 22:30:06 +0100	[thread overview]
Message-ID: <3b6e3fd121d3a9d82d7dd18defd65495a9a50055.1289943005.git.jan.kiszka@web.de> (raw)
In-Reply-To: <cover.1289943005.git.jan.kiszka@web.de>
In-Reply-To: <cover.1289943005.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

Any arch not supporting device assigment will also not build
assigned-dev.c. So testing for KVM_CAP_DEVICE_DEASSIGNMENT is pointless.
KVM_CAP_ASSIGN_DEV_IRQ is unconditinally set. Moreover, add a default
case for dispatching the ioctl.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 virt/kvm/assigned-dev.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index d389207..ae72ae6 100644
--- a/virt/kvm/assigned-dev.c
+++ b/virt/kvm/assigned-dev.c
@@ -674,7 +674,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 				  unsigned long arg)
 {
 	void __user *argp = (void __user *)arg;
-	int r = -ENOTTY;
+	int r;
 
 	switch (ioctl) {
 	case KVM_ASSIGN_PCI_DEVICE: {
@@ -692,7 +692,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 		r = -EOPNOTSUPP;
 		break;
 	}
-#ifdef KVM_CAP_ASSIGN_DEV_IRQ
 	case KVM_ASSIGN_DEV_IRQ: {
 		struct kvm_assigned_irq assigned_irq;
 
@@ -715,8 +714,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 			goto out;
 		break;
 	}
-#endif
-#ifdef KVM_CAP_DEVICE_DEASSIGNMENT
 	case KVM_DEASSIGN_PCI_DEVICE: {
 		struct kvm_assigned_pci_dev assigned_dev;
 
@@ -728,7 +725,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 			goto out;
 		break;
 	}
-#endif
 #ifdef KVM_CAP_IRQ_ROUTING
 	case KVM_SET_GSI_ROUTING: {
 		struct kvm_irq_routing routing;
@@ -781,6 +777,9 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 		break;
 	}
 #endif
+	default:
+		r = -ENOTTY;
+		break;
 	}
 out:
 	return r;
-- 
1.7.1


  parent reply	other threads:[~2010-11-16 21:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 21:30 [PATCH v5-light 0/6] KVM: Improve IRQ assignment for device passthrough Jan Kiszka
2010-11-16 21:30 ` [PATCH v5-light 1/6] KVM: Clear assigned guest IRQ on release Jan Kiszka
2010-11-16 21:30 ` [PATCH v5-light 2/6] KVM: Switch assigned device IRQ forwarding to threaded handler Jan Kiszka
2010-11-16 21:30 ` [PATCH v5-light 3/6] KVM: Refactor IRQ names of assigned devices Jan Kiszka
2010-11-16 21:30 ` [PATCH v5-light 4/6] KVM: Save/restore state of assigned PCI device Jan Kiszka
2010-11-16 21:30 ` Jan Kiszka [this message]
2010-11-16 21:30 ` [PATCH v5-light 6/6] KVM: Document device assigment API Jan Kiszka
2010-11-17  3:01 ` [PATCH v5-light 0/6] KVM: Improve IRQ assignment for device passthrough Alex Williamson
2010-11-17  9:02 ` Avi Kivity
2010-11-17 11:10 ` Michael S. Tsirkin
2010-11-17 14:56 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b6e3fd121d3a9d82d7dd18defd65495a9a50055.1289943005.git.jan.kiszka@web.de \
    --to=jan.kiszka@web.de \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.