[libvirt] [PATCH 0/9] virsh domfsinfo fixes
by Ján Tomko
Fix a crash and other issues:
https://bugzilla.redhat.com/show_bug.cgi?id=1676354
Ján Tomko (9):
vshtabletest: indent strings with expected output
vsh-table: allow empty columns
virsh: introduce ninfos variable in cmdDomFSInfo
virsh: rename ret to rc in cmdDomFSInfo
virsh: do not access uninitialized memory in cmdDomFSInfo
virsh: introduce 'ret' in cmdDomFSInfo
virsh: do not report error on zero filesystems in cmdDomFSInfo
virsh: use virBufferTrim in cmdDomFSInfo
virsh: allow empty targets in cmdDomFSInfo
tests/vshtabletest.c | 78 +++++++++++++++++++++++---------------------
tools/virsh-domain.c | 35 +++++++++++---------
tools/vsh-table.c | 3 --
3 files changed, 60 insertions(+), 56 deletions(-)
--
2.19.2
5 years, 9 months
[libvirt] [PATCH 0/5] tools: Adapt to newer wireshark
by Michal Privoznik
While implementing some other feature I wanted to use wireshark to debug
a migration issue. Only then I found that our wireshark plugin is no
longer being loaded. Here are the fixes.
Michal Prívozník (5):
tools: Cleanup packet-libvirt.h
tools: Keep wireshark plugin registration code in git
wireshark: Provide registration code for newer wireshark
m4: Put wireshark plugin into epan/ directory
tools: Drop support for pre-2.4.0 wireshark
.gitignore | 1 -
cfg.mk | 2 +-
libvirt.spec.in | 10 +-
m4/virt-wireshark.m4 | 10 +-
tools/Makefile.am | 15 +-
tools/wireshark/src/packet-libvirt.c | 106 +++++++-----
tools/wireshark/src/packet-libvirt.h | 93 +----------
tools/wireshark/src/plugin.c | 86 ++++++++++
tools/wireshark/util/make-dissector-reg | 205 ------------------------
9 files changed, 170 insertions(+), 358 deletions(-)
create mode 100644 tools/wireshark/src/plugin.c
delete mode 100755 tools/wireshark/util/make-dissector-reg
--
2.19.2
5 years, 9 months
[libvirt] [PATCH v2 00/32] Make use of autofree within storage code
by John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2019-February/msg00187.html
Much of this was R-by'd for V1 with caveats for splitting things out, etc.
Still since there isn't an end of release rush ;-) - I figure reposting
everything before doing any sort of push would be more prudent and
conservative course of action!
I've added R-by's for many of the patches, but with all the requested
change - there were a few that we hadn't "closed on" from v1 that didn't
get an R-by... The following is a "map" of the patches:
Patches 1-3 = Old Patch1 - All 3 R-by'd
Patch 4 = Old Patch2 - Has R-by
Patches 5-7 = Old Patch3 - All 3 R-by'd
Patches 8-9 = Old Patch4 - 8 needs an R-by, although 9 has it
Patch 10 = Old Patch5 - Has R-by
Patch 11 = Old Patch6 - Has R-by
Patch 12 = Old Patch7 - Needs R-by since I kept VIR_STEAL_PTR logic in
virStorageBackendLogicalFindPoolSourcesFunc
Patch 13 = Old Patch8 - Has R-by
Patches 14-15 = Old Patch9 - Didn't include R-by since I split out the noted
issue in virStorageBackendSCSINewLun
Patch 16 = Old Patch10 - Has R-by
Patches 17-18 = Old Patch11 - Both have R-by
Patches 19-21 = Old Patch12 - All 3 R-by'd
Patch 22 = Old Patch13 - Has R-by
Patch 23 = Old Patch14 - Has R-by
Patch 24 = NEW - "Fallout" from Old Patch4 review
Patch 25 = Old Patch15 - Took implicity R-by for VIR_STEAL_PTR extraction
Patches 26-32 = Old Patch15 - None have R-by. I split out the @def/@ret logic,
then created the VIR_AUTOPTR patch from there.
If the virstoragefile modifications are too much
no big deal. Perhaps they can be reworked or just
dropped. Everyone has their favorite way of doing
things I guess.
John Ferlan (32):
conf,util,qemu: Use VIR_STEAL_PTR for authdef processing
util: Rework virStorageAuthDefCopy
util: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageAuthDef
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStoragePoolSource
storage: Use VIR_STEAL_PTR for gluster volume processing
conf: Rework virStorageVolDefParseXML
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageVolDef
conf: Rework virStoragePoolDefParseXML
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStoragePoolDef
storage: Use VIR_AUTOPTR(virString)
storage: Use VIR_AUTOPTR(virCommand)
storage: Use VIR_AUTOFREE for storage backends
storage: Use VIR_AUTOFREE for storage driver
util: Fix virStorageBackendSCSINewLun error handling
storage: Use VIR_AUTOFREE for storage util
conf: Use VIR_AUTOFREE for storage_conf
util: Use VIR_STEAL_PTR in virstoragefile
util: Use VIR_AUTOFREE for virstoragefile
test: Cleanup testDomainRenameCallback
test: Remove unused @xml from testDomainSnapshotCreateXML
test: Use VIR_AUTOFREE for test driver
tests: Use VIR_AUTOFREE for various storage tests
storage: Use VIR_AUTOCLOSE
tests: Fix memory leak in testCompareXMLToArgvFiles
storage: Use VIR_STEAL_PTR in storageBackendProbeTarget
util: Rename variable in virStorageFileMetadataNew
util: Rename variable in virStorageSourceCopy
util: Rename variable in virStorageSourceNewFromBackingRelative
util: Rename variable in virStorageSourceNewFromBackingAbsolute
util: Rename variable in virStorageSourceNewFromBacking
tests: Rename variable in testStorageFileGetMetadata
util: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageSource
src/conf/domain_conf.c | 35 +-
src/conf/storage_conf.c | 334 +++++------
src/conf/storage_conf.h | 4 +
src/conf/virstorageobj.c | 27 +-
src/esx/esx_storage_backend_vmfs.c | 6 +-
src/phyp/phyp_driver.c | 6 +-
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_driver.c | 9 +-
src/qemu/qemu_migration.c | 3 +-
src/qemu/qemu_parse_command.c | 6 +-
src/storage/storage_backend.c | 9 +-
src/storage/storage_backend_disk.c | 147 ++---
src/storage/storage_backend_fs.c | 59 +-
src/storage/storage_backend_gluster.c | 45 +-
src/storage/storage_backend_iscsi.c | 76 +--
src/storage/storage_backend_iscsi_direct.c | 61 +-
src/storage/storage_backend_logical.c | 139 ++---
src/storage/storage_backend_mpath.c | 42 +-
src/storage/storage_backend_rbd.c | 44 +-
src/storage/storage_backend_scsi.c | 81 +--
src/storage/storage_backend_sheepdog.c | 107 ++--
src/storage/storage_backend_vstorage.c | 39 +-
src/storage/storage_backend_zfs.c | 77 +--
src/storage/storage_driver.c | 85 +--
src/storage/storage_file_fs.c | 15 +-
src/storage/storage_file_gluster.c | 16 +-
src/storage/storage_util.c | 553 +++++++-----------
src/test/test_driver.c | 208 +++----
src/util/virstoragefile.c | 620 +++++++++------------
src/util/virstoragefile.h | 3 +
src/vbox/vbox_storage.c | 3 +-
tests/qemublocktest.c | 6 +-
tests/storagebackendsheepdogtest.c | 59 +-
tests/storagepoolxml2argvtest.c | 29 +-
tests/storagepoolxml2xmltest.c | 36 +-
tests/storagevolxml2argvtest.c | 56 +-
tests/storagevolxml2xmltest.c | 44 +-
tests/virstoragetest.c | 111 ++--
tests/virstorageutiltest.c | 7 +-
39 files changed, 1181 insertions(+), 2029 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [tck PATCH] Set cache=none for KVM guests
by Daniel P. Berrangé
QEMU will refuse to live migrate with the default caching mode, so we
must explicitly set cache=none for the migration tests to pass.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
lib/Sys/Virt/TCK/DomainBuilder.pm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/Sys/Virt/TCK/DomainBuilder.pm b/lib/Sys/Virt/TCK/DomainBuilder.pm
index 7a25d42..399534c 100644
--- a/lib/Sys/Virt/TCK/DomainBuilder.pm
+++ b/lib/Sys/Virt/TCK/DomainBuilder.pm
@@ -396,11 +396,16 @@ sub as_xml {
type => $disk->{type},
$disk->{device} ? (device => $disk->{device}) : ());
+ my @driver = ();
+ if ($self->{type} eq "qemu" ||
+ $self->{type} eq "kvm") {
+ push @driver, "cache", "none";
+ }
if ($disk->{format}) {
- $w->emptyTag("driver",
- name => $disk->{format}->{name},
- type => $disk->{format}->{type});
+ push @driver, "name", $disk->{format}->{name},
+ "type", $disk->{format}->{type};
}
+ $w->emptyTag("driver", @driver);
if ($disk->{type} eq "block") {
$w->emptyTag("source",
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/4] bhyve: model PCI ISA bridge
by Roman Bogorodskiy
This adds modeling of the pci-isa bridge device for bhyve to make
it possible to assign specific PCI address for instead of the default
PCI slot 0.
I tried to keep the existing behaviour, i.e. the isa-bridge controller
is automatically added to domain if it uses serial or video devices, or
boot ROM. It also tries to assign pci slot 1 for it, that should not
be a problem because previously that address was always reserved for
the isa-bridge, so it definitely wasn't used by other devices.
Now, however, it's not always reserved. For example, if there are no
devices in the domain configuration that require isa-bridge, and
users didn't explicitly add it (or added that on a different slot),
then PCI slot 1 is available for allocation. This probably can be a
problem for users when they figure out that they still need to add the
isa-bridge device on slot 1, but it's already used, but I'm not sure
if it's worth to always reserve slot 1 for that purpose.
Roman Bogorodskiy (4):
conf: add 'isa-bridge' PCI controller model
bhyve: model PCI ISA bridge
docs: bhyve: document isa-bridge addressing
news: document bhyve isa-bridge changes
docs/drvbhyve.html.in | 22 +++++++++
docs/news.xml | 10 ++++
docs/schemas/domaincommon.rng | 1 +
src/bhyve/bhyve_command.c | 32 +++++--------
src/bhyve/bhyve_device.c | 47 ++++++++++++-------
src/bhyve/bhyve_domain.c | 6 +++
src/conf/domain_addr.c | 10 ++++
src/conf/domain_addr.h | 4 +-
src/conf/domain_conf.c | 2 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 1 +
src/qemu/qemu_domain.c | 9 ++++
src/qemu/qemu_domain_address.c | 2 +
.../bhyvexml2argv-acpiapic.args | 2 +-
...xml2argv-addr-more-than-32-sata-disks.args | 6 +--
...hyvexml2argv-addr-multiple-sata-disks.args | 4 +-
...vexml2argv-addr-multiple-virtio-disks.args | 6 +--
...rgv-addr-no32devs-multiple-sata-disks.args | 6 +--
...l2argv-addr-no32devs-single-sata-disk.args | 4 +-
.../bhyvexml2argv-addr-single-sata-disk.args | 4 +-
...bhyvexml2argv-addr-single-virtio-disk.args | 2 +-
...vexml2argv-addr-slot-1-and-31-not-lpc.args | 10 ++++
...xml2argv-addr-slot-1-and-31-not-lpc.ldargs | 3 ++
...yvexml2argv-addr-slot-1-and-31-not-lpc.xml | 27 +++++++++++
.../bhyvexml2argv-addr-slot-1-not-lpc.args | 10 ++++
.../bhyvexml2argv-addr-slot-1-not-lpc.ldargs | 3 ++
.../bhyvexml2argv-addr-slot-1-not-lpc.xml | 27 +++++++++++
.../bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder1.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder3.args | 2 +-
.../bhyvexml2argv-bhyveload-explicitargs.args | 2 +-
.../bhyvexml2argv-commandline.args | 2 +-
.../bhyvexml2argv-console.args | 2 +-
.../bhyvexml2argv-cputopology.args | 2 +-
.../bhyvexml2argv-custom-loader.args | 2 +-
.../bhyvexml2argv-disk-cdrom-grub.args | 2 +-
.../bhyvexml2argv-disk-cdrom.args | 2 +-
.../bhyvexml2argv-explicit-lpc.args | 10 ++++
.../bhyvexml2argv-explicit-lpc.ldargs | 3 ++
.../bhyvexml2argv-explicit-lpc.xml | 26 ++++++++++
.../bhyvexml2argv-grub-bootorder.args | 2 +-
.../bhyvexml2argv-grub-bootorder2.args | 2 +-
.../bhyvexml2argv-grub-defaults.args | 2 +-
.../bhyvexml2argv-input-xhci-tablet.args | 4 +-
.../bhyvexml2argv-localtime.args | 2 +-
.../bhyvexml2argv-macaddr.args | 2 +-
.../bhyvexml2argv-net-e1000.args | 2 +-
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
.../bhyvexml2argv-serial.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-
.../bhyvexml2argv-vnc-autoport.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-
.../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-
.../bhyvexml2argv-wired.args | 2 +-
tests/bhyvexml2argvtest.c | 3 ++
.../bhyvexml2xmlout-acpiapic.xml | 2 +-
...ml2xmlout-addr-more-than-32-sata-disks.xml | 6 +--
...yvexml2xmlout-addr-multiple-sata-disks.xml | 4 +-
...exml2xmlout-addr-multiple-virtio-disks.xml | 6 +--
...lout-addr-no32devs-multiple-sata-disks.xml | 8 ++--
...2xmlout-addr-no32devs-single-sata-disk.xml | 4 +-
.../bhyvexml2xmlout-addr-single-sata-disk.xml | 4 +-
...hyvexml2xmlout-addr-single-virtio-disk.xml | 2 +-
...exml2xmlout-addr-slot-1-and-31-not-lpc.xml | 36 ++++++++++++++
.../bhyvexml2xmlout-addr-slot-1-not-lpc.xml | 36 ++++++++++++++
.../bhyvexml2xmlout-base.xml | 2 +-
.../bhyvexml2xmlout-bhyveload-bootorder.xml | 2 +-
.../bhyvexml2xmlout-bhyveload-bootorder1.xml | 2 +-
.../bhyvexml2xmlout-bhyveload-bootorder2.xml | 2 +-
.../bhyvexml2xmlout-bhyveload-bootorder3.xml | 2 +-
.../bhyvexml2xmlout-bhyveload-bootorder4.xml | 2 +-
...bhyvexml2xmlout-bhyveload-explicitargs.xml | 2 +-
.../bhyvexml2xmlout-commandline.xml | 2 +-
.../bhyvexml2xmlout-console.xml | 3 ++
.../bhyvexml2xmlout-custom-loader.xml | 2 +-
.../bhyvexml2xmlout-disk-cdrom-grub.xml | 2 +-
.../bhyvexml2xmlout-disk-cdrom.xml | 2 +-
.../bhyvexml2xmlout-explicit-lpc.xml | 36 ++++++++++++++
.../bhyvexml2xmlout-grub-bootorder.xml | 2 +-
.../bhyvexml2xmlout-grub-bootorder2.xml | 2 +-
.../bhyvexml2xmlout-grub-defaults.xml | 2 +-
.../bhyvexml2xmlout-input-xhci-tablet.xml | 4 +-
.../bhyvexml2xmlout-localtime.xml | 2 +-
.../bhyvexml2xmlout-macaddr.xml | 2 +-
.../bhyvexml2xmlout-metadata.xml | 4 +-
.../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++
.../bhyvexml2xmlout-serial-grub.xml | 3 ++
.../bhyvexml2xmlout-serial.xml | 3 ++
.../bhyvexml2xmlout-vnc-autoport.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++
.../bhyvexml2xmlout-vnc.xml | 3 ++
.../bhyvexml2xmlout-wired.xml | 2 +-
tests/bhyvexml2xmltest.c | 3 ++
99 files changed, 461 insertions(+), 128 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-and-31-not-lpc.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-and-31-not-lpc.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-and-31-not-lpc.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-not-lpc.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-not-lpc.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-slot-1-not-lpc.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-explicit-lpc.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-explicit-lpc.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-explicit-lpc.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-slot-1-and-31-not-lpc.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-slot-1-not-lpc.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-explicit-lpc.xml
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] virsh: fix return value in storage vol name completor
by Daniel P. Berrangé
The function must return a pointer, not a boolean. Fortunately 'false'
is equivalent to 'NULL' so this bug no had ill effect previously.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
tools/virsh-completer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c
index e62226fc13..7c68e2e832 100644
--- a/tools/virsh-completer.c
+++ b/tools/virsh-completer.c
@@ -287,7 +287,7 @@ virshStorageVolNameCompleter(vshControl *ctl,
return NULL;
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
- return false;
+ return NULL;
if ((nvols = virStoragePoolListAllVolumes(pool, &vols, flags)) < 0)
goto error;
--
2.20.1
5 years, 9 months
[libvirt] [python PATCH v4 0/2] Python bindings for virDomainCheckpoint
by Eric Blake
Python counterpart to:
https://www.redhat.com/archives/libvir-list/2019-February/msg00252.html
I'll push patch 1 now as a trivial fix; patch 2 can't go in until
the corresponding libvirt patches are accepted (which may in turn
necessitate minor tweaks if I make any API changes there based on
the review). But with this patch, it should be possible to test
python bindings to all the proposed C changes.
Eric Blake (2):
generator.py: typo fix
Add virDomainCheckpoint APIs
HACKING | 2 +
MANIFEST.in | 1 +
generator.py | 36 ++++++++--
libvirt-override-api.xml | 12 ++++
libvirt-override-virDomain.py | 13 ++++
libvirt-override-virDomainCheckpoint.py | 19 +++++
libvirt-override.c | 96 +++++++++++++++++++++++++
sanitytest.py | 9 ++-
typewrappers.c | 13 ++++
typewrappers.h | 10 +++
10 files changed, 203 insertions(+), 8 deletions(-)
create mode 100644 libvirt-override-virDomainCheckpoint.py
--
2.20.1
5 years, 9 months
[libvirt] [PATCH v1 1/1] virhostcpu.c: consider empty NUMA nodes in topology validation
by Daniel Henrique Barboza
Some devices creates empty (= cpu-less) NUMA nodes to host
its memory. This results in topologies where the following
sanity rule does not apply as is:
nodes * sockets * cores * threads = total_cpus
As a result, a call to 'virsh nodeinfo' will return the default
value (1) to nodes, sockets and threads, while cores defaults
to the total_cpus value. For example, in a Power9 host that has
160 total cpus, 4 cpu-less NUMA nodes, 2 populated NUMA nodes,
1 socket per populated node, 20 cores per socket and 4 threads
per socket:
$ virsh nodeinfo
CPU model: ppc64le
CPU(s): 160
CPU frequency: 3783 MHz
CPU socket(s): 1
Core(s) per socket: 160
Thread(s) per core: 1
NUMA cell(s): 1
Memory size: 535981376 KiB
This patch adjusts virHostCPUGetInfoPopulateLinux to count the
cpu-less NUMA nodes and discard them in the sanity rule, changing
it to:
(nodes - empty_nodes) * sockets * cores * threads = total_cpus
And with this new rule, virsh nodeinfo will return the
appropriate info for those topologies, without changing the
behavior for any other scenario it was previously working.
This is the resulting output of nodeinfo after this patch in the
same Power9 host mentioned above:
$ virsh nodeinfo
CPU model: ppc64le
CPU(s): 160
CPU frequency: 3783 MHz
CPU socket(s): 1
Core(s) per socket: 20
Thread(s) per core: 4
NUMA cell(s): 6
Memory size: 535981376 KiB
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/util/virhostcpu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 6514c3d765..4100cf0e8c 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -598,6 +598,7 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
virBitmapPtr online_cpus_map = NULL;
DIR *nodedir = NULL;
struct dirent *nodedirent = NULL;
+ int emptynodes = 0;
int nodecpus, nodecores, nodesockets, nodethreads, offline = 0;
int threads_per_subcore = 0;
unsigned int node;
@@ -686,6 +687,8 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
VIR_FREE(sysfs_cpudir);
*cpus += nodecpus;
+ if (nodecpus == 0)
+ emptynodes++;
if (nodesockets > *sockets)
*sockets = nodesockets;
@@ -747,7 +750,7 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
* the nodeinfo structure isn't designed to carry the full topology so
* we're going to lie about the detected topology to notify the user
* to check the host capabilities for the actual topology. */
- if ((*nodes *
+ if (((*nodes - emptynodes) *
*sockets *
*cores *
*threads) != (*cpus + offline)) {
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 00/15] Make use of autofree within storage code
by John Ferlan
A tedious series of patches that will make use of the autofree
functionality within (many/most) storage modules. As part of the
changes I've added a few new AUTOPTR's and made use of existing
ones. The diffstat I think shows quite a bit of code removed -
mostly in the goto cleanup/error handling that isn't necessary.
I've run the series through the Coverity checker with no issues
and I've run the Avocado pool and volume tests. The Avocado test
did find a couple of issues that were fixed before posting this
(assuming a virString on a char ** that was really a counted list
managed by VIR_APPEND_ELEMENT - there's a golden egg comment in
one module in the middle of the series).
John Ferlan (15):
util: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageAuthDef
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStoragePoolSource
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageVolDef
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStoragePoolDef
storage: Use VIR_AUTOPTR(virString)
storage: Use VIR_AUTOPTR(virCommand)
storage: Use VIR_AUTOFREE for storage backends
storage: Use VIR_AUTOFREE for storage driver
storage: Use VIR_AUTOFREE for storage util
conf: Use VIR_AUTOFREE for storage_conf
util: Use VIR_AUTOFREE for virstoragefile
test: Use VIR_AUTOFREE for test driver
tests: Use VIR_AUTOFREE for various storage tests
storage: Use VIR_AUTOCLOSE
util: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageSource
src/conf/domain_conf.c | 35 +-
src/conf/storage_conf.c | 335 +++++------
src/conf/storage_conf.h | 4 +
src/conf/virstorageobj.c | 27 +-
src/esx/esx_storage_backend_vmfs.c | 6 +-
src/phyp/phyp_driver.c | 6 +-
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_driver.c | 9 +-
src/qemu/qemu_migration.c | 3 +-
src/qemu/qemu_parse_command.c | 6 +-
src/storage/storage_backend.c | 9 +-
src/storage/storage_backend_disk.c | 147 ++---
src/storage/storage_backend_fs.c | 59 +-
src/storage/storage_backend_gluster.c | 45 +-
src/storage/storage_backend_iscsi.c | 76 +--
src/storage/storage_backend_iscsi_direct.c | 62 +--
src/storage/storage_backend_logical.c | 139 ++---
src/storage/storage_backend_mpath.c | 42 +-
src/storage/storage_backend_rbd.c | 44 +-
src/storage/storage_backend_scsi.c | 65 +--
src/storage/storage_backend_sheepdog.c | 98 ++--
src/storage/storage_backend_vstorage.c | 39 +-
src/storage/storage_backend_zfs.c | 77 +--
src/storage/storage_driver.c | 93 ++--
src/storage/storage_file_fs.c | 15 +-
src/storage/storage_file_gluster.c | 16 +-
src/storage/storage_util.c | 553 +++++++-----------
src/test/test_driver.c | 209 +++----
src/util/virstoragefile.c | 615 +++++++++------------
src/util/virstoragefile.h | 2 +
src/vbox/vbox_storage.c | 3 +-
tests/qemublocktest.c | 6 +-
tests/storagebackendsheepdogtest.c | 59 +-
tests/storagepoolxml2argvtest.c | 42 +-
tests/storagepoolxml2xmltest.c | 36 +-
tests/storagevolxml2argvtest.c | 69 +--
tests/storagevolxml2xmltest.c | 44 +-
tests/virstoragetest.c | 111 ++--
tests/virstorageutiltest.c | 7 +-
39 files changed, 1189 insertions(+), 2027 deletions(-)
--
2.20.1
5 years, 9 months