From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuEBP-0006Ut-TS for qemu-devel@nongnu.org; Wed, 25 Jul 2012 22:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuEBO-0005C8-R4 for qemu-devel@nongnu.org; Wed, 25 Jul 2012 22:52:11 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:39868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuEBO-0005C3-7b for qemu-devel@nongnu.org; Wed, 25 Jul 2012 22:52:10 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Jul 2012 12:51:50 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6Q2hga850266308 for ; Thu, 26 Jul 2012 12:43:43 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6Q2q0mR021937 for ; Thu, 26 Jul 2012 12:52:01 +1000 Message-ID: <5010B0CE.2050900@linux.vnet.ibm.com> Date: Thu, 26 Jul 2012 10:51:58 +0800 From: Bing Bu Cao MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] How to share disk image between two kvm guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers , aliguori@us.ibm.com Cc: Bing Bu Cao Hi,all I want to use qemu-nbd to share disk between two kvm guests. I. # qemu-nbd -p 1024 -e 2 -n my-disk.qcow2 # nbd-client localhost 1024 /dev/nbd0 # nbd-client localhost 1024 /dev/nbd1 II. guest1: # /usr/local/bin/qemu -enable-kvm -m 1024 -drive file=ubuntu.img -drive file=/dev/nbd0,cache=none -net user -net nic,model=virtio -chardev stdio,id=mon0 -mon chardev=mon0 -usb -device usb-tablet guest2: # /usr/local/bin/qemu -enable-kvm -m 1024 -drive file=ubuntu.img -drive file=/dev/nbd0,cache=none -net user -net nic,model=virtio -chardev stdio,id=mon0 -mon chardev=mon0 -usb -device usb-tablet Found one problem: No disk r/w sync between 2 virtual hosts. One write/change on the shared disk, another virtual host must remount the disk and can see the update from the other virtual host. For example,a simply test: In the guest1,mount the disk and create on text file add some line to it. In the guest2,mount the same disk and print the text file and found the content is not updated. But after after I remount the disk, the content will be updated. Is it a issue of guest OS or qemu-nbd? Can you help me? -- Best Regards, Bing Bu Cao