[PATCH] virconf.c: Refactor cleanup and remove VIR_FREE

2021-03-12 Thread Yi Li
Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li --- src/util/virconf.c | 47 +++--- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/src/util/virconf.c b/src/util/virconf.c index 16107bce96..17fbea2397 100644 --- a/src/util

[PATCH] virConfLoadConfig: Refactor cleanup

2021-03-11 Thread Yi Li
Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li --- src/util/virconf.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/util/virconf.c b/src/util/virconf.c index 16107bce96..11046a1d45 100644 --- a/src/util/virconf.c +++ b/src/util

[PATCH] virQEMUCapsInitQMPArch: Refactor cleanup

2021-03-09 Thread Yi Li
Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li --- src/qemu/qemu_capabilities.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 790375ac38..447cf77875 100644 --- a/src/qemu

[PATCH] qemuBlockDiskDetectNodes: just return when alias is null

2021-02-17 Thread Yi Li
Just return when alias is null and Remove the 'ret' variable. Signed-off-by: Yi Li --- src/qemu/qemu_block.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 3d88e701b2..0af3e56c9a 100644 --- a/src

[PATCH] Rework qemuMigrationDstPrecreateDisk()

2021-02-05 Thread Yi Li
'conn' vairable which are used only inside the func. Let's declare inside the func body to make that obvious. Use g_autofree to allow removal of 'cleanup:' and the 'ret' variable. Signed-off-by: Yi Li --- src/qemu/qemu_migration.c | 68 +++ 1 file changed, 26

[PATCH] qemuBlockDiskDetectNodes: just return when alias is null

2021-02-04 Thread Yi Li
Just Return when alias is null and Remove the 'ret' variable. Signed-off-by: Yi Li --- src/qemu/qemu_block.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0b8ca2a3f5..32b6500a3d 100644 --- a/src

[PATCH] qemuDomainAttachRedirdevDevice: Remove need_release variable

2021-02-02 Thread Yi Li
Get rid of the 'need_release' variable. Signed-off-by: Yi Li --- src/qemu/qemu_hotplug.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 882e5d2384..e07dba3c5e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src

[PATCH] storage: volStorageBackendRBDRefreshVolInfo: refactor

2021-01-07 Thread Yi Li
use the ret variable for return value Signed-off-by: Yi Li --- src/storage/storage_backend_rbd.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 1630d6eede..22f5c78591 100644

[PATCH] storageBackendCreatePloop: Refactor cleanup

2021-01-07 Thread Yi Li
get rid of the 'cleanup:' label and created variable. Signed-off-by: Yi Li --- src/storage/storage_util.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 2478cb0a4a..2e2c7dc68a 100644 --- a/src/storage

[PATCH v2 2/3] virStorageBackendCopyToFD: remove unused return variable

2021-01-05 Thread Yi Li
remove unused return variable, The errno will throw by virReportSystemError Signed-off-by: Yi Li --- src/storage/storage_util.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index c13abf03af

[PATCH v2 3/3] storageBackendCreateRaw: remove unused created

2021-01-05 Thread Yi Li
refactor and remove unused created variable. Signed-off-by: Yi Li --- src/storage/storage_util.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index c6d0f7a97c..cc8189c3e0 100644 --- a/src

[PATCH v2 0/3] Storage: remove unused variable

2021-01-05 Thread Yi Li
refactor storageBackendCreateRaw and remove some unused variable. Yi Li (3): createRawFile: remove unused return variable virStorageBackendCopyToFD: remove unused return variable storageBackendCreateRaw: remove unused created src/storage/storage_util.c | 66

[PATCH v2 1/3] createRawFile: remove unused return variable

2021-01-05 Thread Yi Li
remove unused return variable, The errno will throw by virReportSystemError Signed-off-by: Yi Li --- src/storage/storage_util.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index cf1f33f177

[PATCH 3/3] storageBackendCreateRaw: remove unused created variable

2020-12-29 Thread Yi Li
refactor and remove unused created variable Signed-off-by: Yi Li --- src/storage/storage_util.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index c6d0f7a97c..c02ece8253 100644 --- a/src

[PATCH 2/3] createRawFile: remove unused return variable

2020-12-29 Thread Yi Li
remove unused return variable, The errno will throw by virReportSystemError Signed-off-by: Yi Li --- src/storage/storage_util.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 6fc8597733

[PATCH 1/3] virStorageBackendCopyToFD: remove unused return variable

2020-12-29 Thread Yi Li
remove unused return variable, The errno will throw by virReportSystemError Signed-off-by: Yi Li --- src/storage/storage_util.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index cf1f33f177

Re: [PATCH] util: xml: remove unused function virXMLChildElementCount

2020-11-06 Thread Yi Li
On 11/6/20, Ján Tomko wrote: > On a Friday in 2020, Yi Li wrote: >>--- >> src/libvirt_private.syms | 1 - >> src/util/virxml.c| 21 - >> src/util/virxml.h| 1 - >> 3 files changed, 23 deletions(-) >> > > Looks g

[PATCH] util: xml: remove unused function virXMLChildElementCount

2020-11-05 Thread Yi Li
--- src/libvirt_private.syms | 1 - src/util/virxml.c| 21 - src/util/virxml.h| 1 - 3 files changed, 23 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9029ea4fa2..36ab84162c 100644 --- a/src/libvirt_private.syms +++

[PATCH] virsh-domain: Remove unused virshNodeIsSuperset

2020-11-05 Thread Yi Li
The function is marked as unused. Remove it from the tree until a new use case can be found. Signed-off-by: Yi Li --- tools/virsh-domain.c | 115 --- 1 file changed, 115 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index

[PATCH v3] qemuMonitorJSONCheckReply: Use g_autofree

2020-10-21 Thread Yi Li
Eliminate cleanup code by using g_autofree. Signed-off-by: Yi Li --- src/qemu/qemu_monitor_json.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 6c763ecc12..4994ace071 100644 --- a/src/qemu

[PATCH v2] qemu_monitor_json.c: use g_autofree

2020-10-18 Thread Yi Li
Eliminate cleanup code by using g_autofree in qemuMonitorJSONCheckErrorFull() and qemuMonitorJSONCheckReply Signed-off-by: Yi Li --- src/qemu/qemu_monitor_json.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu

[PATCH] qemuMonitorJSONCheckReply: Use g_autofree

2020-10-15 Thread Yi Li
Eliminate cleanup code by using g_autofree. Signed-off-by: Yi Li --- src/qemu/qemu_monitor_json.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 26ac499fc5..f76b369191 100644 --- a/src/qemu

[PATCH] Remove redundant check when storage pool is mounted

2020-09-22 Thread Yi Li
virFileComparePaths just return 0 or 1 after commit 7b48bb8 so break while after virFileComparePaths return 1 Signed-off-by: Yi Li --- src/storage/storage_backend_fs.c | 8 ++-- src/util/virfile.c | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src

[PATCH] tools: Remove unnecessary condition check

2020-09-10 Thread Yi Li
virshDomainFree correctly handle null pointer parameters. There is no need to check if the parameter is null before calling this function. Signed-off-by: Yi Li --- tools/virsh-domain-monitor.c | 6 ++ tools/virsh-domain.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions

[PATCH] conf: remove unused variable

2020-06-10 Thread Yi Li
Signed-off-by: Yi Li --- src/conf/snapshot_conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 857d04c476..f73eeb06c7 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -231,7 +231,7

[PATCH v2] Unlock the storage pool objects after looking it up

2020-05-07 Thread Yi Li
Use g_new0 to allocate and remove NULL checks from callers and the lock will release properly Signed-off-by: Yi Li --- src/conf/virstorageobj.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 13b75b648d

[PATCH] Unlock the storage pool objects after looking it up

2020-05-07 Thread Yi Li
The lock should be released. Signed-off-by: Yi Li --- src/conf/virstorageobj.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 13b75b648d..9f24ae67ca 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf

[PATCH] storage: use local dom_disk parameter

2020-04-07 Thread Yi Li
replace vm->def->disks[i] with dom_disk parameter Signed-off-by: Yi Li --- src/qemu/qemu_driver.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index daa3cb397d..27f43124ac 100644 --- a/src/qemu/qemu_driver.c

[libvirt] [PATCH v3 3/3] Storage: Use errno parameter in virReportSystemError

2019-12-22 Thread Yi Li
Use errno parameter in virReportSystemError. Remove hold function return values if don't need. Signed-off-by: Yi Li --- src/storage/storage_backend_rbd.c | 159 ++ 1 file changed, 76 insertions(+), 83 deletions(-) diff --git a/src/storage

[libvirt] [PATCH v3 1/3] Storage: Use rc hold intermediate function return values.

2019-12-22 Thread Yi Li
most libvirt code uses 'int rc' to hold intermediate function return values. consistent with the rest of libvirt. Signed-off-by: Yi Li --- src/storage/storage_backend_rbd.c | 202 ++ 1 file changed, 96 insertions(+), 106 deletions(-) diff --git a/src/storage

[libvirt] [PATCH v3 2/3] storage: Fix volStorageBackendRBDRefreshVolInfo function return errors

2019-12-22 Thread Yi Li
Fix the return value status comparison checking for call to volStorageBackendRBDRefreshVolInfo introduced by commit id f46d137e. we only should fail when the return is < 0. -ENOENT, -ETIMEDOUT will ignore according commit id f46d137e. Signed-off-by: Yi Li --- src/storage/storage_backend_rb

[libvirt] [PATCH v2] storage: Fix daemon crash on lookup storagepool by targetpath

2019-12-20 Thread Yi Li
, searcher=searcher@entry=0x92103e68 , opaque=) at conf/virstorageobj.c:505 5 0x92101f54 in storagePoolLookupByTargetPath (conn=0x5c0009f0, path=0x7009a850 "/vms/images") at storage/storage_driver.c:1672 Signed-off-by: Yi Li --- src/storage/storage_driver.c | 2

[libvirt] [PATCH] storage: Fix daemon crash on lookup storagepool by targetpath

2019-12-20 Thread Yi Li
:505 5 0x92101f54 in storagePoolLookupByTargetPath (conn=0x5c0009f0, path=0x7009a850 "/vms/images") at storage/storage_driver.c:1672 Signed-off-by: Yi Li --- src/storage/storage_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/storage/storage_driv

[libvirt] [PATCH v2] storage: Fix volStorageBackendRBDRefreshVolInfo

2019-11-02 Thread Yi Li
Fix the return value status comparison checking for call to volStorageBackendRBDRefreshVolInfo introduced by commit id f46d137e. we only should fail when the return is < 0. -ENOENT, -ETIMEDOUT will ignore according commit id f46d137e. Signed-off-by: Yi Li --- src/storage/storage_backend_rb

[libvirt] [PATCH] storage: Fix volStorageBackendRBDRefreshVolInfo

2019-11-02 Thread Yi Li
Fix the return value status comparison checking for call to volStorageBackendRBDRefreshVolInfo introduced by commit id f46d137e. we only should fail when the return is < 0. -ENOENT, -ETIMEDOUT will ignore according commit id f46d137e. Signed-off-by: Yi Li --- src/storage/storage_backend_rb

[libvirt] [PATCH v2] storage: improve the while loop virStorageBackendFileSystemIsMounted

2019-11-02 Thread Yi Li
Move virStorageBackendFileSystemGetPoolSource outside of the while loop Signed-off-by: Yi Li --- src/storage/storage_backend_fs.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 02b8248

[libvirt] [PATCH] storage: improve the while loop virStorageBackendFileSystemIsMounted

2019-11-02 Thread Yi Li
Move virStorageBackendFileSystemGetPoolSource outside of the while loop Signed-off-by: Yi Li --- src/storage/storage_backend_fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 02b8248..10d9457

Re: [libvirt] [PATCH] util: storage: drop VIR_STORAGE_FILE_AUTO_SAFE

2019-08-26 Thread Yi Li
Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false 2: After boot, the backingStore format is not expected .. /usr/libexec/qemu-kvm .

[libvirt] [PATCH] util: storage: drop VIR_STORAGE_FILE_AUTO_SAFE

2019-08-25 Thread Yi Li
merge VIR_STORAGE_FILE_AUTO_SAFE/VIR_STORAGE_FILE_AUTO to VIR_STORAGE_FILE_AUTO virStorageFileProbeFormatFromBuf will probe the backingStore format. Fix the booting issue when setting backingStore format (QCOW image) to RAW image. Signed-off-by: Yi Li --- src/qemu/qemu_block.c | 2 -- src

[libvirt] [PATCH] storage: omit comma for ceph mon hosts to librados

2019-06-25 Thread Yi Li
Silly mistakes omit the comma for multiple ipaddr Fixes: cdd362e0e7a34d4f8f102c75f2ca513d23dd1db0 Signed-off-by: Yi Li --- src/storage/storage_backend_rbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage

Re: [libvirt] [PATCH] storage: escape ipv6 for ceph mon hosts to librados

2019-04-30 Thread Yi Li
>From 4af765cb6ee87eb7a131901057a8b6d0e859ac63 Mon Sep 17 00:00:00 2001 From: Yi Li Date: Sun, 28 Apr 2019 10:29:53 +0800 Subject: [PATCH v2] storage: escape ipv6 for ceph mon hosts to librados Hosts for rbd are ceph monitor daemons. These have fixed IP addresses, so they are often referen

Re: [libvirt] [PATCH] storage: escape ipv6 for ceph mon hosts to librados

2019-04-30 Thread Yi Li
square brackets > >so it is distinguished from the port, which is currently mandatory. > > > >Signed-off-by: Yi Li > >--- > > docs/schemas/storagepool.rng | 5 - > > src/storage/storage_backend_rbd.c | 13 ++--- > > tests

[libvirt] [PATCH] storage: escape ipv6 for ceph mon hosts to librados

2019-04-25 Thread Yi Li
is used as an option separator in the string passed to librados. Escape these colons, and enclose the IPv6 address in square brackets so it is distinguished from the port, which is currently mandatory. Signed-off-by: Yi Li --- docs/schemas/storagepool.rng | 5 - src/storage