Re: [PATCH] qemu: Use iohelper during restore

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

 



Hi All,

Can someone review the patch please ? 

Thanks,
Shivaprasad

On Wed, Mar 15, 2017 at 11:22 AM, Shivaprasad bhat <shivaprasadbhat@xxxxxxxxx> wrote:
ping..

On Fri, Jan 27, 2017 at 4:29 PM, Shivaprasad G Bhat <sbhat@xxxxxxxxxxxxxxxxxx> wrote:
Commit afe6e58 & c4caab53 made necessary changes to use io-helpers
during save and restore. The commit c4caab53 missed to remove the
redundant check in qemuDomainSaveImageOpen() because of which
virFileWrapperFdNew() is not called if bypass_cache is false.

Signed-off-by: Shivaprasad G Bhat <sbhat@xxxxxxxxxxxxxxxxxx>
---
 src/qemu/qemu_driver.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 516a851..ac89372 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6150,9 +6150,11 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
     virDomainDefPtr def = NULL;
     int oflags = open_write ? O_RDWR : O_RDONLY;
     virCapsPtr caps = NULL;
+    unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING;

     if (bypass_cache) {
         int directFlag = virFileDirectFdFlag();
+        wrapperFlags |= VIR_FILE_WRAPPER_BYPASS_CACHE;
         if (directFlag < 0) {
             virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                            _("bypass cache unsupported by this system"));
@@ -6166,9 +6168,8 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,

     if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL, NULL)) < 0)
         goto error;
-    if (bypass_cache &&
-        !(*wrapperFd = virFileWrapperFdNew(&fd, path,
-                                           VIR_FILE_WRAPPER_BYPASS_CACHE)))
+    if (wrapperFd &&
+        !(*wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags)))
         goto error;

     if (saferead(fd, &header, sizeof(header)) != sizeof(header)) {

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux