[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] replace bogus -ENOSYS uses



commit a66765eb06f057f134f5adc9bdf5c0f2ca00e524
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Sep 7 12:32:31 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Sep 7 12:32:31 2016 +0200

    replace bogus -ENOSYS uses
    
    This doesn't cover all of them, just the ones that I think would most
    obviously better be -EINVAL or -EOPNOTSUPP.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mcheck/vmce.c |  2 +-
 xen/arch/x86/cpu/mtrr/main.c   |  2 +-
 xen/arch/x86/hvm/hvm.c         |  4 ++--
 xen/arch/x86/mm.c              |  2 +-
 xen/common/compat/memory.c     |  2 +-
 xen/common/event_fifo.c        |  2 +-
 xen/common/grant_table.c       |  2 +-
 xen/common/memory.c            | 14 +++++++-------
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index b136320..5f002e3 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -440,7 +440,7 @@ int unmmap_broken_page(struct domain *d, mfn_t mfn, 
unsigned long gfn)
         return -EINVAL;
 
     if ( !has_hvm_container_domain(d) || !paging_mode_hap(d) )
-        return -ENOSYS;
+        return -EOPNOTSUPP;
 
     rc = -1;
     r_mfn = get_gfn_query(d, gfn, &pt);
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index bf489e3..e002975 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -332,7 +332,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
        if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) {
                printk(KERN_WARNING
                       "mtrr: your processor doesn't support 
write-combining\n");
-               return -ENOSYS;
+               return -EOPNOTSUPP;
        }
 
        if (!size) {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ddb12cc..98f0740 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5628,7 +5628,7 @@ long do_hvm_op(unsigned long op, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case HVMOP_flush_tlbs:
-        rc = guest_handle_is_null(arg) ? hvmop_flush_tlb_all() : -ENOSYS;
+        rc = guest_handle_is_null(arg) ? hvmop_flush_tlb_all() : -EINVAL;
         break;
 
     case HVMOP_track_dirty_vram:
@@ -5868,7 +5868,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
     {
         case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON:
         case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF:
-            rc = -ENOSYS;
+            rc = -EOPNOTSUPP;
             if ( !cpu_has_monitor_trap_flag )
                 break;
             rc = 0;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ff8e904..670998f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3567,7 +3567,7 @@ long do_mmuext_op(
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EOPNOTSUPP;
             }
             else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 579040e..ad8c0d5 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -358,7 +358,7 @@ int compat_memory_op(unsigned int cmd, 
XEN_GUEST_HANDLE_PARAM(void) compat)
             struct get_reserved_device_memory grdm;
 
             if ( unlikely(start_extent) )
-                return -ENOSYS;
+                return -EINVAL;
 
             if ( copy_from_guest(&grdm.map, compat, 1) ||
                  !compat_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 79c36ff..45583e5 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -621,7 +621,7 @@ int evtchn_fifo_expand_array(const struct 
evtchn_expand_array *expand_array)
     int rc;
 
     if ( !d->evtchn_fifo )
-        return -ENOSYS;
+        return -EOPNOTSUPP;
 
     spin_lock(&d->event_lock);
     rc = add_page_to_event_array(d, expand_array->array_gfn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index ecace07..310e07c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3025,7 +3025,7 @@ do_grant_table_op(
         return -EINVAL;
 
     if ( (cmd &= GNTTABOP_CMD_MASK) != GNTTABOP_cache_flush && opaque_in )
-        return -ENOSYS;
+        return -EINVAL;
     
     rc = -EFAULT;
     switch ( cmd )
diff --git a/xen/common/memory.c b/xen/common/memory.c
index f34dd56..cc0f69e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -941,14 +941,14 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case XENMEM_exchange:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         rc = memory_exchange(guest_handle_cast(arg, xen_memory_exchange_t));
         break;
 
     case XENMEM_maximum_ram_page:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         rc = max_page;
         break;
@@ -957,7 +957,7 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_maximum_reservation:
     case XENMEM_maximum_gpfn:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
@@ -1081,7 +1081,7 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         struct page_info *page;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
@@ -1118,7 +1118,7 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case XENMEM_claim_pages:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&reservation, arg, 1) )
             return -EFAULT;
@@ -1152,7 +1152,7 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         struct vnuma_info tmp;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         /*
          * Guest passes nr_vnodes, number of regions and nr_vcpus thus
@@ -1284,7 +1284,7 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         struct get_reserved_device_memory grdm;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&grdm.map, arg, 1) ||
              !guest_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.