qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Issue with fsfreeze with qemu agent.


From: Christian Theune
Subject: Re: [Qemu-discuss] Issue with fsfreeze with qemu agent.
Date: Mon, 26 Sep 2016 19:46:00 +0200

Hi,

usually I just deflect any work that I have to do in C as my abilities there are abysmal and usually end in segfaults around 3.2 years later.

Anyway. For the direct issue (I saw a couple of other things that could be improved but would like to keep the patch minimal) I think this would be a cleaner way:

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index ea37c09..0aa8005 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1250,11 +1250,18 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
          */
         ret = ioctl(fd, FIFREEZE);
         if (ret == -1) {
-            if (errno != EOPNOTSUPP) {
-                error_setg_errno(errp, errno, "failed to freeze %s",
-                                 mount->dirname);
-                close(fd);
-                goto error;
+            switch (errno): {
+                case EOPNOTSUPP:
+                    /* ignore mounts that do not support freezing */
+                    break;
+                case EBUSY:
+                    /* ignore mounts that are already frozen */
+                    break;
+                default:
+                    error_setg_errno(errp, errno, "failed to freeze %s",
+                                     mount->dirname);
+                    close(fd);
+                    goto error;
             }
         } else {
             i++;

When reviewing the thaw code - that’s already a bit more defensive and should be robust enough to handle the bind-mount issue properly.

If someone from the qemu developers tells me that this would be an appreciated improvement then I’ll be happy to spend time testing my change for my use case (bind mounts) and provide a proper patch with QA. I’ll likely need a little bit of handholding at some point.

Kind regards,
Christian

-- 
Christian Theune · address@hidden · +49 345 219401 0
Flying Circus Internet Operations GmbH · http://flyingcircus.io
Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
HR Stendal HRB 21169 · Geschäftsführer: Christian. Theune, Christian. Zagrodnick

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

[Prev in Thread] Current Thread [Next in Thread]