From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T48kY-0006lW-IQ for qemu-devel@nongnu.org; Wed, 22 Aug 2012 07:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T48kS-0003jy-Bl for qemu-devel@nongnu.org; Wed, 22 Aug 2012 07:05:26 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:52806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T48kR-0003Wt-N2 for qemu-devel@nongnu.org; Wed, 22 Aug 2012 07:05:20 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Aug 2012 16:35:08 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7MB4qEq34013194 for ; Wed, 22 Aug 2012 16:34:53 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7MB4p8S005201 for ; Wed, 22 Aug 2012 21:04:52 +1000 Message-ID: <5034BCD1.9020603@linux.vnet.ibm.com> Date: Wed, 22 Aug 2012 19:04:49 +0800 From: Cong Meng MIME-Version: 1.0 References: <1345537427-21601-1-git-send-email-mc@linux.vnet.ibm.com> <50334B51.6050900@redhat.com> <503357B2.5040901@linux.vnet.ibm.com> <50335F78.1030005@redhat.com> In-Reply-To: <50335F78.1030005@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: stefanha@linux.vnet.ibm.com, Stefan Hajnoczi , zwanp@cn.ibm.com, linuxram@us.ibm.com, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org On 08/21/2012 06:14 PM, Paolo Bonzini wrote: > Il 21/08/2012 11:52, Stefan Hajnoczi ha scritto: >>>>>> Using /sys/dev/block or /sys/dev/char seems easier, and lets you >>>>>> retrieve the parameters for block devices too. >>>>>> >>>> what do you mean with "block devices"? Using "/dev/sda" instead of >>>> "/dev/sg0"? > > Yes. > >>>>>> However, I'm worried of the consequences this has for migration. You >>>>>> could have the same physical disk accessed with two different HBAs, with >>>>>> different limits. So I don't know if this can really be solved at all. >>>>>> >>>> I know little about qemu migration now. The pending scsi commands will be >>>> saved and >>>> transfered to remote machine when starting migration? >> >> Passthrough is already a migration blocker if both hosts do not have >> access to the same LUNs. > > Yes, but requiring the exact same hardware may be too much. I'm trying > to understand the problem better before committing to a threefold > spec/qemu/kernel change. > > Cong, what is the limit that the host HBA enforces (and what is the > HBA)? What commands see a problem? Is it fixed by using scsi-block > instead of scsi-generic (if you can use scsi-block at all, i.e. it's not > a tape or similar device)? > I don't see real problem caused by the the queue limits actually. It's a bug which Stefan told me. > With scsi-generic, QEMU uses a bounce buffer for non-I/O commands to a > SCSI passthrough device, so the only problem in that case should be the > maximum segment size. This could change in the future, but max_segments > and max_sectors should not yet be a problem. about bounce buffer, do you meat the buffer allocated in scsi_send_command() of hw/scsi-generic.c? Cong. > > With scsi-block, QEMU will use read/write on the block device and the > host kernel will then obey the host HBA's block limits. QEMU will still > use a bounce buffer for non-I/O commands to a scsi-block device, but the > payload is usually small for non-I/O commands. > > Paolo > >> When both hosts do have access to the same LUNs it's possible to >> extract the block queue limits (using sysfs) and compare them. >> >> Today you can start QEMU with different image files on both hosts. >> Migration will appear to work but the disk image on the destination >> host could be junk. This is a similar case, I don't see a problem >> except that there should be a safety check (maybe at the libvirt >> level) to make this safe. >