From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6Nj-0005uo-Ee for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:18:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW6Ne-0001dk-Pw for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:17:59 -0400 Received: from mail-qc0-x235.google.com ([2607:f8b0:400d:c01::235]:61788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6Ne-0001dd-L7 for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:17:54 -0400 Received: by mail-qc0-f181.google.com with SMTP id q4so5990772qcx.40 for ; Tue, 15 Oct 2013 08:17:54 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20131010091554.GA11408@stefanha-thinkpad.redhat.com> References: <20131010091554.GA11408@stefanha-thinkpad.redhat.com> Date: Tue, 15 Oct 2013 17:17:54 +0200 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [Nbd] Hibernate and qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Trumpold Cc: nbd-general@lists.sourceforge.net, Wouter Verhelst , Paul Clements , "qemu-devel@nongnu.org" , Paolo Bonzini On Thu, Oct 10, 2013 at 11:15 AM, Stefan Hajnoczi wrote: > On Fri, Oct 04, 2013 at 07:30:45AM -0700, Mark Trumpold wrote: >> >> >> On 9/26/13 10:18 PM, "Stefan Hajnoczi" wrote: >> >> > >> >Try the qemu-nbd --persistent option. That should prevent it from >> >shutting down when nbd-client is disconnected. >> > >> >Stefan >> > >> >> >> Hi Stefan, >> >> Sorry for the delay.. >> I tried the following per your suggestion: >> >> 920 qemu-nbd --persistent -p 2000 /root/qemu/q1.img & >> 921 nbd-client -persist localhost 2000 /dev/nbd0 >> 922 fsck /dev/nbd0 >> 923 mount /dev/nbd0 /mnt >> 924 ls /mnt >> 925 umount /dev/nbd0 >> :: >> >> 927 echo reboot >/sys/power/disk >> 928 echo disk >/sys/power/state >> 929 mount /dev/nbd0 /mnt >> >> This seems to work; that is both sides (client and server) persist >> after the hibernate cycle. >> >> However, if I don't 'umount' '/dev/nbd0' before the hibernate >> cycle, and try to 'ls /mnt' after, the 'ls' hangs indefinitely. >> >> For my real use case we have the root filesystem mounted, >> so unmounting is not an option (at least I don't think so). >> >> I also tried remounting readonly, and also 'blockdev --flushbufs ..' >> before the hibernate cycle -- either or both did not help. >> >> I had thought about trying a 'chroot' and then a 'umount', but >> have not yet tried this. >> >> This one was so close.. Could you try drop the umount/mount and capture the following straces: strace -p $(pgrep nbd-client) -o /var/tmp/nbd-client.strace strace -p $(pgrep qemu-nbd) -o /var/tmp/qemu-nbd.strace In particular, let's find out what happens when you run ls /mnt after resuming the machine. The nbd-client should reconnect to qemu-nbd and I/O requests would flow to qemu-nbd again. But something is stuck; the problem might be clear from the strace output. Stefan