]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
Merge remote-tracking branch 'bonzini/scsi-next' into staging
authorAnthony Liguori <aliguori@amazon.com>
Fri, 13 Dec 2013 19:10:02 +0000 (11:10 -0800)
committerAnthony Liguori <aliguori@amazon.com>
Fri, 13 Dec 2013 19:10:02 +0000 (11:10 -0800)
# By Paolo Bonzini (4) and Peter Lieven (1)
# Via Paolo Bonzini
* bonzini/scsi-next:
  help: add id suboption to -iscsi
  scsi-disk: fix WRITE SAME with large non-zero payload
  block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}
  scsi-disk: fix VERIFY emulation
  scsi-bus: fix transfer length and direction for VERIFY command

Message-id: 1386594157-17535-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
1  2 
configure
hw/scsi/scsi-bus.c
qemu-options.hx

diff --combined configure
index 5d82283a14b91bd17a732f618eff5c79da8131db,8144d9fc6755f82568673374052bec99623f191f..edfea9591cdb6257b217fc0c47c03cd971839159
+++ b/configure
@@@ -169,7 -169,6 +169,7 @@@ curl="
  curses=""
  docs=""
  fdt=""
 +netmap="no"
  pixman=""
  sdl=""
  virtfs=""
@@@ -489,7 -488,6 +489,7 @@@ FreeBSD
    audio_possible_drivers="oss sdl esd pa"
    # needed for kinfo_getvmmap(3) in libutil.h
    LIBS="-lutil $LIBS"
 +  netmap=""  # enable netmap autodetect
  ;;
  DragonFly)
    bsd="yes"
@@@ -799,10 -797,6 +799,10 @@@ for opt d
    ;;
    --enable-vde) vde="yes"
    ;;
 +  --disable-netmap) netmap="no"
 +  ;;
 +  --enable-netmap) netmap="yes"
 +  ;;
    --disable-xen) xen="no"
    ;;
    --enable-xen) xen="yes"
@@@ -1188,8 -1182,6 +1188,8 @@@ echo "  --disable-uuid           disabl
  echo "  --enable-uuid            enable uuid support"
  echo "  --disable-vde            disable support for vde network"
  echo "  --enable-vde             enable support for vde network"
 +echo "  --disable-netmap         disable support for netmap network"
 +echo "  --enable-netmap          enable support for netmap network"
  echo "  --disable-linux-aio      disable Linux AIO support"
  echo "  --enable-linux-aio       enable Linux AIO support"
  echo "  --disable-cap-ng         disable libcap-ng support"
    fi
  fi
  
 +##########################################
 +# netmap headers probe
 +if test "$netmap" != "no" ; then
 +  cat > $TMPC << EOF
 +#include <inttypes.h>
 +#include <net/if.h>
 +#include <net/netmap.h>
 +#include <net/netmap_user.h>
 +int main(void) { return 0; }
 +EOF
 +  if compile_prog "" "" ; then
 +    netmap=yes
 +  else
 +    if test "$netmap" = "yes" ; then
 +      feature_not_found "netmap"
 +    fi
 +    netmap=no
 +  fi
 +fi
 +
  ##########################################
  # libcap-ng library probe
  if test "$cap_ng" != "no" ; then
  
  ##########################################
  # Do we have libiscsi
- # We check for iscsi_unmap_sync() to make sure we have a
- # recent enough version of libiscsi.
+ # We check for iscsi_write16_sync() to make sure we have a
+ # at least version 1.4.0 of libiscsi.
  if test "$libiscsi" != "no" ; then
    cat > $TMPC << EOF
  #include <stdio.h>
  #include <iscsi/iscsi.h>
- int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
+ int main(void) { iscsi_write16_sync(NULL,0,0,NULL,0,0,0,0,0,0,0); return 0; }
  EOF
    if $pkg_config --atleast-version=1.7.0 libiscsi; then
      libiscsi="yes"
@@@ -3779,7 -3751,6 +3779,7 @@@ echo "uname -r          $uname_release
  echo "GUEST_BASE        $guest_base"
  echo "PIE               $pie"
  echo "vde support       $vde"
 +echo "netmap support    $netmap"
  echo "Linux AIO support $linux_aio"
  echo "ATTR/XATTR support $attr"
  echo "Install blobs     $blobs"
  if test "$vde" = "yes" ; then
    echo "CONFIG_VDE=y" >> $config_host_mak
  fi
 +if test "$netmap" = "yes" ; then
 +  echo "CONFIG_NETMAP=y" >> $config_host_mak
 +fi
  if test "$cap_ng" = "yes" ; then
    echo "CONFIG_LIBCAP=y" >> $config_host_mak
  fi
diff --combined hw/scsi/scsi-bus.c
index 3e5e31da8fd9c18e31685c34e234b4ef9317f112,2d6ce4d6bbaa6d71a1c1373ba15d97f69463fd4d..3496c0bbd8f93fc78150a42f7f6cb15d42552ff5
@@@ -886,7 -886,6 +886,6 @@@ static int scsi_req_length(SCSICommand 
      case RELEASE:
      case ERASE:
      case ALLOW_MEDIUM_REMOVAL:
-     case VERIFY_10:
      case SEEK_10:
      case SYNCHRONIZE_CACHE:
      case SYNCHRONIZE_CACHE_16:
      case ALLOW_OVERWRITE:
          cmd->xfer = 0;
          break;
+     case VERIFY_10:
+     case VERIFY_12:
+     case VERIFY_16:
+         if ((buf[1] & 2) == 0) {
+             cmd->xfer = 0;
+         } else if ((buf[1] & 4) == 1) {
+             cmd->xfer = 1;
+         }
+         cmd->xfer *= dev->blocksize;
+         break;
      case MODE_SENSE:
          break;
      case WRITE_SAME_10:
@@@ -1100,6 -1109,9 +1109,9 @@@ static void scsi_cmd_xfer_mode(SCSIComm
      case WRITE_VERIFY_12:
      case WRITE_16:
      case WRITE_VERIFY_16:
+     case VERIFY_10:
+     case VERIFY_12:
+     case VERIFY_16:
      case COPY:
      case COPY_VERIFY:
      case COMPARE:
@@@ -1293,11 -1305,6 +1305,11 @@@ const struct SCSISense sense_code_ILLEG
      .key = ILLEGAL_REQUEST, .asc = 0x53, .ascq = 0x02
  };
  
 +/* Illegal request, Invalid Transfer Tag */
 +const struct SCSISense sense_code_INVALID_TAG = {
 +    .key = ILLEGAL_REQUEST, .asc = 0x4b, .ascq = 0x01
 +};
 +
  /* Command aborted, I/O process terminated */
  const struct SCSISense sense_code_IO_ERROR = {
      .key = ABORTED_COMMAND, .asc = 0x00, .ascq = 0x06
@@@ -1313,11 -1320,6 +1325,11 @@@ const struct SCSISense sense_code_LUN_F
      .key = ABORTED_COMMAND, .asc = 0x3e, .ascq = 0x01
  };
  
 +/* Command aborted, Overlapped Commands Attempted */
 +const struct SCSISense sense_code_OVERLAPPED_COMMANDS = {
 +    .key = ABORTED_COMMAND, .asc = 0x4e, .ascq = 0x00
 +};
 +
  /* Unit attention, Capacity data has changed */
  const struct SCSISense sense_code_CAPACITY_CHANGED = {
      .key = UNIT_ATTENTION, .asc = 0x2a, .ascq = 0x09
diff --combined qemu-options.hx
index af3448302118470031dbda0e41cc37bafb0e77bf,7f12f02e04231a1bc6bbaa44fa16476225db2e07..bcfe9eaa3e261c2b9e75f7c0ac4a084eb7e14747
@@@ -228,6 -228,7 +228,6 @@@ STEX
  Allocate guest RAM from a temporarily created file in @var{path}.
  ETEXI
  
 -#ifdef MAP_POPULATE
  DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
      "-mem-prealloc   preallocate guest memory (use with -mem-path)\n",
      QEMU_ARCH_ALL)
@@@ -236,6 -237,7 +236,6 @@@ STEX
  @findex -mem-prealloc
  Preallocate memory when using -mem-path.
  ETEXI
 -#endif
  
  DEF("k", HAS_ARG, QEMU_OPTION_k,
      "-k language     use keyboard layout (for example 'fr' for French)\n",
@@@ -1406,12 -1408,6 +1406,12 @@@ DEF("net", HAS_ARG, QEMU_OPTION_net
      "                on host and listening for incoming connections on 'socketpath'.\n"
      "                Use group 'groupname' and mode 'octalmode' to change default\n"
      "                ownership and permissions for communication port.\n"
 +#endif
 +#ifdef CONFIG_NETMAP
 +    "-net netmap,ifname=name[,devname=nmname]\n"
 +    "                attach to the existing netmap-enabled network interface 'name', or to a\n"
 +    "                VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
 +    "                netmap device, defaults to '/dev/netmap')\n"
  #endif
      "-net dump[,vlan=n][,file=f][,len=n]\n"
      "                dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
@@@ -1426,9 -1422,6 +1426,9 @@@ DEF("netdev", HAS_ARG, QEMU_OPTION_netd
      "bridge|"
  #ifdef CONFIG_VDE
      "vde|"
 +#endif
 +#ifdef CONFIG_NETMAP
 +    "netmap|"
  #endif
      "socket|"
      "hubport],id=str[,option][,option][,...]\n", QEMU_ARCH_ALL)
@@@ -2096,7 -2089,7 +2096,7 @@@ ETEX
  DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
      "-iscsi [user=user][,password=password]\n"
      "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
-     "       [,initiator-name=iqn]\n"
+     "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
      "                iSCSI session parameters\n", QEMU_ARCH_ALL)
  STEXI