From: Michal Privoznik <mprivozn@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 1/2] qemu-ga: make names more generic for mount list functions
Date: Wed, 13 Jun 2012 10:10:29 +0200 [thread overview]
Message-ID: <4FD84AF5.7000907@redhat.com> (raw)
In-Reply-To: <1339566088-22542-2-git-send-email-pbonzini@redhat.com>
On 13.06.2012 07:41, Paolo Bonzini wrote:
> We will use these functions and types for more than FSFREEZE, so rename them.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> qga/commands-posix.c | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 00d035d..b1a7ce6 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -314,17 +314,17 @@ static void guest_file_init(void)
>
> #if defined(CONFIG_FSFREEZE)
>
> -typedef struct GuestFsfreezeMount {
> +typedef struct FsMount {
> char *dirname;
> char *devtype;
> - QTAILQ_ENTRY(GuestFsfreezeMount) next;
> -} GuestFsfreezeMount;
> + QTAILQ_ENTRY(FsMount) next;
> +} FsMount;
>
> -typedef QTAILQ_HEAD(, GuestFsfreezeMount) GuestFsfreezeMountList;
> +typedef QTAILQ_HEAD(, FsMount) FsMountList;
>
> -static void guest_fsfreeze_free_mount_list(GuestFsfreezeMountList *mounts)
> +static void free_fs_mount_list(FsMountList *mounts)
> {
> - GuestFsfreezeMount *mount, *temp;
> + FsMount *mount, *temp;
>
> if (!mounts) {
> return;
> @@ -341,10 +341,10 @@ static void guest_fsfreeze_free_mount_list(GuestFsfreezeMountList *mounts)
> /*
> * Walk the mount table and build a list of local file systems
> */
> -static int guest_fsfreeze_build_mount_list(GuestFsfreezeMountList *mounts)
> +static int build_fs_mount_list(FsMountList *mounts)
> {
> struct mntent *ment;
> - GuestFsfreezeMount *mount;
> + FsMount *mount;
> char const *mtab = "/proc/self/mounts";
> FILE *fp;
>
> @@ -367,7 +367,7 @@ static int guest_fsfreeze_build_mount_list(GuestFsfreezeMountList *mounts)
> continue;
> }
>
> - mount = g_malloc0(sizeof(GuestFsfreezeMount));
> + mount = g_malloc0(sizeof(FsMount));
> mount->dirname = g_strdup(ment->mnt_dir);
> mount->devtype = g_strdup(ment->mnt_type);
>
> @@ -398,15 +398,15 @@ GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
> int64_t qmp_guest_fsfreeze_freeze(Error **err)
> {
> int ret = 0, i = 0;
> - GuestFsfreezeMountList mounts;
> - struct GuestFsfreezeMount *mount;
> + FsMountList mounts;
> + struct FsMount *mount;
> int fd;
> char err_msg[512];
>
> slog("guest-fsfreeze called");
>
> QTAILQ_INIT(&mounts);
> - ret = guest_fsfreeze_build_mount_list(&mounts);
> + ret = build_fs_mount_list(&mounts);
> if (ret < 0) {
> return ret;
> }
> @@ -447,11 +447,11 @@ int64_t qmp_guest_fsfreeze_freeze(Error **err)
> close(fd);
> }
>
> - guest_fsfreeze_free_mount_list(&mounts);
> + free_fs_mount_list(&mounts);
> return i;
>
> error:
> - guest_fsfreeze_free_mount_list(&mounts);
> + free_fs_mount_list(&mounts);
> qmp_guest_fsfreeze_thaw(NULL);
> return 0;
> }
> @@ -462,12 +462,12 @@ error:
> int64_t qmp_guest_fsfreeze_thaw(Error **err)
> {
> int ret;
> - GuestFsfreezeMountList mounts;
> - GuestFsfreezeMount *mount;
> + FsMountList mounts;
> + FsMount *mount;
> int fd, i = 0, logged;
>
> QTAILQ_INIT(&mounts);
> - ret = guest_fsfreeze_build_mount_list(&mounts);
> + ret = build_fs_mount_list(&mounts);
> if (ret) {
> error_set(err, QERR_QGA_COMMAND_FAILED,
> "failed to enumerate filesystems");
> @@ -507,7 +507,7 @@ int64_t qmp_guest_fsfreeze_thaw(Error **err)
> }
>
> ga_unset_frozen(ga_state);
> - guest_fsfreeze_free_mount_list(&mounts);
> + free_fs_mount_list(&mounts);
> return i;
> }
>
>
next prev parent reply other threads:[~2012-06-13 8:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 5:41 [Qemu-devel] [PATCH v2 0/2] qemu-ga: Add guest-fstrim command Paolo Bonzini
2012-06-13 5:41 ` [Qemu-devel] [PATCH v2 1/2] qemu-ga: make names more generic for mount list functions Paolo Bonzini
2012-06-13 8:10 ` Michal Privoznik [this message]
2012-06-13 5:41 ` [Qemu-devel] [PATCH v2 2/2] qemu-ga: add guest-fstrim command Paolo Bonzini
2012-06-13 8:11 ` Michal Privoznik
2012-06-13 18:26 ` [Qemu-devel] [PATCH v2 0/2] qemu-ga: Add " Luiz Capitulino
2012-06-13 20:44 ` Michael Roth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD84AF5.7000907@redhat.com \
--to=mprivozn@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).