1. 19 7月, 2013 1 次提交
    • E
      tests: split long lines · 684c90bf
      Eric Blake 提交于
      Long lines are harder to read and harder to diff; in fact, if lines get
      too long (> 1000 bytes), it starts causing issues where git send-email
      refuses to send patches for the file.  I've cleaned up the tests
      directory in the past (see commits bd6c46fa, 3b750d13), but new long
      lines have been introduced in the meantime.
      
      Why 90 instead of 80? Because there were too many tests on the fringe
      edge, and I didn't want to edit that many files.
      
      Add a syntax check to prevent future long lines.
      
      * cfg.mk (sc_prohibit_long_lines): New rule.
      * tests/qemuxml2argvdata/qemuxml2argv-*.args: Split lines of any
      file with content longer than 90 columns.
      * tests/storagevolxml2argvdata/*.argv: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      684c90bf
  2. 13 5月, 2013 1 次提交
    • H
      qemu: Build qemu command line for scsi host device · 0d70656a
      Han Cheng 提交于
      Except the scsi host device's controller is "lsilogic", mapping
      between the libvirt attributes and scsi-generic properties is:
      
        libvirt     qemu
      -----------------------------------------
        controller  bus ($libvirt_controller.0)
        bus         channel
        target      scsi-id
        unit        lun
      
      For scsi host device with "lsilogic" controller, the mapping is:
      ('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
      must <= 7).
      
        libvirt            qemu
      ----------------------------------------------------------
        controller && bus  bus ($libvirt_controller.$libvirt_bus)
        unit               scsi-id
      
      It's not good to hardcode/hard-check limits of these attributes,
      and even worse, these limits are not documented, one has to find
      out by either testing or reading the qemu code, I'm looking forward
      to qemu expose limits like these one day). For example, exposing
      "max_target", "max_lun" for megasas:
      
      static const struct SCSIBusInfo megasas_scsi_info = {
          .tcq = true,
          .max_target = MFI_MAX_LD,
          .max_lun = 255,
      
          .transfer_data = megasas_xfer_complete,
          .get_sg_list = megasas_get_sg_list,
          .complete = megasas_command_complete,
          .cancel = megasas_command_cancel,
      };
      
      Example of the qemu command line (lsilogic controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,scsi-id=8,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      
      Example of the qemu command line (virtio-scsi controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      0d70656a