From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57650 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkHkm-0005a3-2j for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkHkl-0006bt-8s for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:02:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkHkl-0006bQ-0g for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:02:47 -0500 Message-ID: <4D482092.3060900@redhat.com> Date: Tue, 01 Feb 2011 16:02:42 +0100 From: Jes Sorensen MIME-Version: 1.0 References: <1296557928-30019-1-git-send-email-Jes.Sorensen@redhat.com> <1296557928-30019-2-git-send-email-Jes.Sorensen@redhat.com> <1296571705.2167.35.camel@aglitke> In-Reply-To: <1296571705.2167.35.camel@aglitke> Content-Type: text/plain; charset=UTF-8 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: Adam Litke Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On 02/01/11 15:48, Adam Litke wrote: > 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? That is correct, however most Linux file systems do support it, and for the ones that don't, there really isn't anything we can do. Cheers, Jes