[libvirt] [PATCH 4/5] virStorageBackendFileSystemMount: prefer strdup over virAsprintf

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

 



From: Jim Meyering <meyering@xxxxxxxxxx>

* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount):
Use virAsprintf only when needed.  In this case, strdup works fine.
---
 src/storage/storage_backend_fs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 0b81c6c..c96c4f3 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -376,7 +376,7 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) {

     if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
         if (pool->def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS) {
-            if (virAsprintf(&options, "direct-io-mode=1") == -1) {
+            if ((options = strdup("direct-io-mode=1")) == NULL) {
                 virReportOOMError();
                 return -1;
             }
-- 
1.7.1.rc1.248.gcefbb

--
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]