From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56084 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkHWx-00089C-Et for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:48:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkHWw-0002rL-GO for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:48:31 -0500 Received: from e3.ny.us.ibm.com ([32.97.182.143]:48610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkHWw-0002rE-CQ for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:48:30 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p11ET8sv027027 for ; Tue, 1 Feb 2011 09:29:08 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 8F7954DE8048 for ; Tue, 1 Feb 2011 09:47:55 -0500 (EST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p11EmSEb175436 for ; Tue, 1 Feb 2011 09:48:28 -0500 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p11EmRaC017480 for ; Tue, 1 Feb 2011 07:48:27 -0700 From: Adam Litke In-Reply-To: <1296557928-30019-2-git-send-email-Jes.Sorensen@redhat.com> References: <1296557928-30019-1-git-send-email-Jes.Sorensen@redhat.com> <1296557928-30019-2-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 01 Feb 2011 08:48:25 -0600 Message-ID: <1296571705.2167.35.camel@aglitke> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/2] Add virtagent file system freeze/thaw List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Tue, 2011-02-01 at 11:58 +0100, Jes.Sorensen@redhat.com wrote: > +/* > + * va_fsfreeze(): Walk list of mounted file systems in the guest, and > + * freeze the ones which are real local file systems. > + * rpc return values: Number of file systems frozen, -1 on error. > + */ > +static xmlrpc_value *va_fsfreeze(xmlrpc_env *env, > + xmlrpc_value *params, > + void *user_data) > +{ > + xmlrpc_int32 ret = 0, i = 0; > + xmlrpc_value *result; > + struct direntry *entry; > + int fd; > + SLOG("va_fsfreeze()"); > + > + if (fsfreeze_status == FREEZE_FROZEN) { > + ret = 0; > + goto out; > + } > + > + ret = build_mount_list(); > + if (ret < 0) { > + goto out; > + } > + > + fsfreeze_status = FREEZE_INPROGRESS; > + > + entry = mount_list; > + while(entry) { > + fd = qemu_open(entry->dirname, O_RDONLY); > + if (fd == -1) { > + ret = errno; > + goto error; > + } > + ret = ioctl(fd, FIFREEZE); > + if (ret < 0 && ret != EOPNOTSUPP) { > + goto error; > + } Here we silently ignore filesystems that do not support the FIFREEZE ioctl. Do we need to have a more complex return value so that we can communicate which mount points could not be frozen? Otherwise, an unsuspecting host could retrieve a corrupted snapshot of that filesystem, right? > + > + close(fd); > + entry = entry->next; > + i++; > + } > + > + fsfreeze_status = FREEZE_FROZEN; > + ret = i; > +out: > + result = xmlrpc_build_value(env, "i", ret); > + return result; > +error: > + if (i > 0) { > + fsfreeze_status = FREEZE_ERROR; > + } > + goto out; > +} -- Thanks, Adam