[libvirt] [sandbox PATCH v2 0/4] Remove Test::AutoBuild leftovers
by Andrea Bolognani
Changes from [v1]:
* rename the script instead of dropping it;
* perform some further clean ups.
[v1] https://www.redhat.com/archives/libvir-list/2018-May/msg00220.html
Andrea Bolognani (4):
maint: Rename autobuild.sh to prepare-release.sh
prepare-release: Drop references to MinGW builds
prepare-release: Drop references to Test::AutoBuild
spec: Drop %{extra_release}
autobuild.sh | 71 -----------------------------------------
libvirt-sandbox.spec.in | 2 +-
prepare-release.sh | 39 ++++++++++++++++++++++
3 files changed, 40 insertions(+), 72 deletions(-)
delete mode 100755 autobuild.sh
create mode 100755 prepare-release.sh
--
2.17.0
6 years, 5 months
[libvirt] [tck PATCH] Use a pre-created MANIFEST file
by Daniel P. Berrangé
Using the MANIFEST.SKIP blacklist approach risks creating tarballs with
extra files mistakenly included if the working directory is not clean.
Switch to a pre-created MANIFEST file, since maintaining this short list
of files is not hard work.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitignore | 1 -
MANIFEST | 219 +++++++++++++++++++++++++++++++++++++++++++++
MANIFEST.SKIP | 19 ----
prepare-release.sh | 1 -
4 files changed, 219 insertions(+), 21 deletions(-)
create mode 100644 MANIFEST
delete mode 100644 MANIFEST.SKIP
diff --git a/.gitignore b/.gitignore
index cc1470e..ca3e424 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,6 @@
*.orig
*~
Build
-MANIFEST
META.yml
Makefile
Makefile.PL
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..b632328
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,219 @@
+bin/libvirt-tck
+Build.PL
+conf/default.cfg
+docs/intro.pod
+docs/writing-tests.pod
+lib/Sys/Virt/TCK.pm
+lib/Sys/Virt/TCK/Capabilities.pm
+lib/Sys/Virt/TCK/DomainBuilder.pm
+lib/Sys/Virt/TCK/Hooks.pm
+lib/Sys/Virt/TCK/NetworkBuilder.pm
+lib/Sys/Virt/TCK/NetworkHelpers.pm
+lib/Sys/Virt/TCK/SELinux.pm
+lib/Sys/Virt/TCK/StoragePoolBuilder.pm
+lib/Sys/Virt/TCK/StorageVolBuilder.pm
+lib/Sys/Virt/TCK/TAP/XMLFormatter.pm
+lib/Sys/Virt/TCK/TAP/XMLFormatterSession.pm
+LICENSE
+Makefile.PL
+MANIFEST
+META.json
+META.yml
+perl-Sys-Virt-TCK.spec
+perl-Sys-Virt-TCK.spec.PL
+prepare-release.sh
+README
+scripts/domain/050-transient-lifecycle.t
+scripts/domain/051-transient-autostart.t
+scripts/domain/060-persistent-lifecycle.t
+scripts/domain/061-persistent-autostart.t
+scripts/domain/065-persistent-redefine.t
+scripts/domain/070-transient-to-persistent.t
+scripts/domain/080-unique-id-define.t
+scripts/domain/081-unique-id-create.t
+scripts/domain/082-unique-id-caching.t
+scripts/domain/090-invalid-ops-when-inactive.t
+scripts/domain/100-transient-save-restore.t
+scripts/domain/101-persistent-save-restore.t
+scripts/domain/102-broken-save-restore.t
+scripts/domain/103-blockdev-save-restore.t
+scripts/domain/110-memory-balloon.t
+scripts/domain/120-disks-stats.t
+scripts/domain/121-block-info.t
+scripts/domain/130-cpu-hotplug.t
+scripts/domain/180-interface-parameters.t
+scripts/domain/200-disk-hotplug.t
+scripts/domain/202-numa-set-parameters.t
+scripts/domain/205-disk-hotplug-ordering.t
+scripts/domain/207-disk-media-change.t
+scripts/domain/210-nic-hotplug.t
+scripts/domain/215-nic-hotplug-many.t
+scripts/domain/240-usb-host-hotplug.t
+scripts/domain/250-pci-host-hotplug.t
+scripts/domain/300-migration.t
+scripts/domain/301-migration-max-speed.t
+scripts/hooks/051-daemon-hook.t
+scripts/hooks/052-domain-hook.t
+scripts/networks/050-transient-lifecycle.t
+scripts/networks/051-transient-autostart.t
+scripts/networks/060-persistent-lifecycle.t
+scripts/networks/061-persistent-autostart.t
+scripts/networks/065-persistent-redefine.t
+scripts/networks/070-transient-to-persistent.t
+scripts/networks/080-unique-id-define.t
+scripts/networks/081-unique-id-create.t
+scripts/networks/082-unique-id-caching.t
+scripts/networks/090-invalid-ops-when-inactive.t
+scripts/networks/100-apply-verify-host.t
+scripts/networks/110-interface-change-transaction.t
+scripts/networks/networkApplyTest.sh
+scripts/networks/networkxml2hostout/tck-testnet-1.dat
+scripts/networks/networkxml2hostout/tck-testnet-1.post.dat
+scripts/networks/networkxml2hostout/tck-testnet-2.dat
+scripts/networks/networkxml2hostout/tck-testnet-2.post.dat
+scripts/networks/networkxml2hostout/tck-testnet-3.dat
+scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
+scripts/networks/networkxml2xmlin/tck-testnet-1.xml
+scripts/networks/networkxml2xmlin/tck-testnet-2.xml
+scripts/networks/networkxml2xmlin/tck-testnet-3.xml
+scripts/nwfilter/050-apply-verify-host.t
+scripts/nwfilter/060-concurrency.t
+scripts/nwfilter/100-ping-still-working.t
+scripts/nwfilter/210-no-mac-spoofing.t
+scripts/nwfilter/220-no-ip-spoofing.t
+scripts/nwfilter/230-no-mac-broadcast.t
+scripts/nwfilter/240-no-arp-spoofing.t
+scripts/nwfilter/300-vsitype.t
+scripts/nwfilter/concurrency/chg-vm-filter.sh
+scripts/nwfilter/concurrency/start-destroy-vm.sh
+scripts/nwfilter/concurrency/tck-vm1-filter1.xml
+scripts/nwfilter/concurrency/tck-vm1-filter2.xml
+scripts/nwfilter/concurrency/tck-vm1.xml
+scripts/nwfilter/concurrency/tck-vm2-filter1.xml
+scripts/nwfilter/concurrency/tck-vm2-filter2.xml
+scripts/nwfilter/concurrency/tck-vm2.xml
+scripts/nwfilter/nwfilter2vmtest.sh
+scripts/nwfilter/nwfilter_concurrent.sh
+scripts/nwfilter/nwfilterxml2fwallout/ah-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/ah-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/all-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/all-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/arp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/conntrack-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/esp-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/esp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/example-1.fwall
+scripts/nwfilter/nwfilterxml2fwallout/example-2.fwall
+scripts/nwfilter/nwfilterxml2fwallout/hex-data-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/icmp-direction-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/icmp-direction2-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/icmp-direction3-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/icmp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/icmpv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/igmp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/ip-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/ipset-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/ipt-no-macspoof-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/iter-test1.fwall
+scripts/nwfilter/nwfilterxml2fwallout/iter-test2.fwall
+scripts/nwfilter/nwfilterxml2fwallout/iter-test3.fwall
+scripts/nwfilter/nwfilterxml2fwallout/mac-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/rarp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/sctp-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/sctp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/stp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/target-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/target-test2.fwall
+scripts/nwfilter/nwfilterxml2fwallout/tcp-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/tcp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/testvm.fwall.dat
+scripts/nwfilter/nwfilterxml2fwallout/udp-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/udp-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/udplite-ipv6-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/udplite-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/vlan-test.fwall
+scripts/nwfilter/nwfilterxml2fwallout/zzz-ipset-cleanup.fwall
+scripts/nwfilter/nwfilterxml2xmlin/ah-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ah-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/all-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/all-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/arp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/comment-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/conntrack-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/esp-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/esp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/example-1.xml
+scripts/nwfilter/nwfilterxml2xmlin/example-2.xml
+scripts/nwfilter/nwfilterxml2xmlin/hex-data-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/icmp-direction-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/icmp-direction2-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/icmp-direction3-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/icmp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/icmpv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/igmp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ip-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ipset-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ipt-no-macspoof-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/iter-test1.xml
+scripts/nwfilter/nwfilterxml2xmlin/iter-test2.xml
+scripts/nwfilter/nwfilterxml2xmlin/iter-test3.xml
+scripts/nwfilter/nwfilterxml2xmlin/mac-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/rarp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ref-rule-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/ref-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/sctp-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/sctp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/stp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/target-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/target-test2.xml
+scripts/nwfilter/nwfilterxml2xmlin/tcp-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/tcp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/udp-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/udp-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/udplite-ipv6-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/udplite-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/vlan-test.xml
+scripts/nwfilter/nwfilterxml2xmlin/zzz-ipset-cleanup.xml
+scripts/nwfilter/README
+scripts/qemu/100-disk-encryption.t
+scripts/qemu/200-qcow2-single-backing-file.t
+scripts/qemu/205-qcow2-double-backing-file.t
+scripts/qemu/210-qcow2-auto-probing.t
+scripts/qemu/400-save-image-xml.t
+scripts/selinux/050-dynamic-relabel-yes.t
+scripts/selinux/055-dynamic-base-label.t
+scripts/selinux/100-static-relabel-no.t
+scripts/selinux/105-static-relabel-fail.t
+scripts/selinux/110-static-relabel-yes.t
+scripts/storage/050-transient-lifecycle.t
+scripts/storage/051-transient-autostart.t
+scripts/storage/060-persistent-lifecycle.t
+scripts/storage/061-persistent-autostart.t
+scripts/storage/065-persistent-redefine.t
+scripts/storage/070-transient-to-persistent.t
+scripts/storage/080-unique-id-define.t
+scripts/storage/081-unique-id-create.t
+scripts/storage/082-unique-id-caching.t
+scripts/storage/090-invalid-ops-when-inactive.t
+scripts/storage/100-create-vol-dir.t
+scripts/storage/110-disk-pool.t
+scripts/storage/120-get-ops.t
+scripts/storage/200-clone-vol-dir.t
+scripts/storage/250-vol-qcow2-backing-store.t
+scripts/storage/255-vol-qcow2-backing-store-auto.t
+scripts/storage/400-vol-download.t
+scripts/storage/405-vol-download-all.t
+scripts/storage/410-vol-download-nonblock.t
+scripts/storage/415-vol-upload.t
+scripts/storage/420-vol-upload-all.t
+scripts/storage/425-vol-upload-nonblock.t
+t/005-pod.t
+t/010-pod-coverage.t
+t/050-capabilities.t
+t/070-domain-builder.t
+t/080-network-builder.t
+t/090-storage-pool-builder.t
+t/100-storage-vol-builder.t
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
deleted file mode 100644
index 8aa28aa..0000000
--- a/MANIFEST.SKIP
+++ /dev/null
@@ -1,19 +0,0 @@
-.*\.old
-.*\.bak
-Sys-Virt-TCK-
-blib
-\.hg
-.*~
-\.#.*
-#.*
-^Makefile$
-.*\.orig
-data/
-results/
-^Build$
-^_build/
-^\.git/
-^cover_db/
-^libvirt-tck/
-^MYMETA.yml$
-^MYMETA\.json$
diff --git a/prepare-release.sh b/prepare-release.sh
index 75777a8..ad29f16 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -21,7 +21,6 @@ rm -rf MANIFEST blib _build Build
perl Build.PL install_base=$HOME/builder
./Build
-./Build manifest
if [ -z "$USE_COVER" ]; then
--
2.17.0
6 years, 5 months
[libvirt] [perl PATCH v2] Switch over to using Module::Build
by Daniel P. Berrangé
The Module::Build system is nicer than ExtUtils::MakeMaker as it allows
for better cross-platform portability by only relying on Perl, rather
than both Perl and system 'make' binary.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitignore | 17 +++----
Build.PL | 102 +++++++++++++++++++++++++++++++++++++
MANIFEST | 73 ++++++++++++++++++++++++++
MANIFEST.SKIP | 20 --------
META.yml.PL | 55 --------------------
Makefile.PL | 85 -------------------------------
Virt.xs => lib/Sys/Virt.xs | 0
perl-Sys-Virt.spec.PL | 45 ++++++++--------
prepare-release.sh | 48 +++--------------
t/030-api-coverage.t | 2 +-
10 files changed, 210 insertions(+), 237 deletions(-)
create mode 100755 Build.PL
create mode 100644 MANIFEST
delete mode 100644 MANIFEST.SKIP
delete mode 100644 META.yml.PL
delete mode 100644 Makefile.PL
rename Virt.xs => lib/Sys/Virt.xs (100%)
diff --git a/.gitignore b/.gitignore
index dc0ba62..3f08c79 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,12 @@
-*.swp
*~
-MANIFEST
META.yml
+META.json
MYMETA.*
-Makefile
-Makefile.old
+Makefile.PL
Sys-Virt-*.tar.gz
-Virt.bs
-Virt.c
-Virt.o
blib/
-cover_db
perl-Sys-Virt.spec
-pm_to_blib
-results.log
-tags
+lib/Sys/Virt\.c
+lib/Sys/Virt\.o
+_build/
+Build
diff --git a/Build.PL b/Build.PL
new file mode 100755
index 0000000..13a0e4f
--- /dev/null
+++ b/Build.PL
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2009-2018 Red Hat, Inc.
+# Copyright (C) 2009 Daniel P. Berrange
+#
+# This program is free software; You can redistribute it and/or modify
+# it under the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any
+# later version
+#
+# The file "LICENSE" distributed along with this file provides full
+# details of the terms and conditions
+#
+
+use Module::Build;
+
+use strict;
+use warnings;
+
+my $libvirtver = "4.4.0";
+my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
+die "cannot run pkg-config to check libvirt version" if $stat == -1;
+die "libvirt >= $libvirtver is required\n" unless $stat == 0;
+
+my $LIBVIRT_LIBS = `pkg-config --libs libvirt`;
+my $LIBVIRT_CFLAGS = `pkg-config --cflags libvirt`;
+
+my $GCC_CFLAGS = "";
+if ($ENV{TEST_MAINTAINER}) {
+ $GCC_CFLAGS = qq(
+ -W -Waddress -Wall -Warray-bounds -Wattributes
+ -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align
+ -Wchar-subscripts -Wclobbered -Wcomment -Wcomments
+ -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations
+ -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion
+ -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul
+ -Wformat-extra-args -Wformat-security -Wformat-y2k
+ -Wformat-zero-length -Wformat=2 -Wfree-nonheap-object
+ -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration
+ -Wimplicit-int -Winit-self -Wint-to-pointer-cast
+ -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init
+ -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces
+ -Wmissing-declarations -Wmissing-field-initializers
+ -Wmissing-format-attribute -Wmissing-include-dirs
+ -Wmissing-noreturn -Wmissing-parameter-type
+ -Wmultichar -Wnarrowing -Wnonnull
+ -Wnormalized=nfc -Wold-style-declaration -Wold-style-definition
+ -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses
+ -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas
+ -Wreturn-type -Wsequence-point -Wno-shadow -Wstrict-aliasing
+ -Wstrict-prototypes -Wsuggest-attribute=const
+ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch
+ -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized
+ -Wunknown-pragmas -Wunused -Wunused-but-set-parameter
+ -Wunused-but-set-variable -Wunused-function -Wunused-label
+ -Wunused-local-typedefs -Wno-unused-parameter -Wunused-result
+ -Wunused-value -Wunused-variable -Wvariadic-macros
+ -Wvector-operation-performance -Wvolatile-register-var
+ -Wwrite-strings -Wno-sign-compare -Wjump-misses-init
+ -Wno-format-nonliteral -Wframe-larger-than=8192
+ -Wno-suggest-attribute=pure -Wno-suggest-attribute=const
+ -Wno-cast-function-type
+ );
+}
+
+my $b = Module::Build->new(
+ module_name => "Sys::Virt",
+ license => 'gpl',
+ configure_requires => {
+ 'Module::Build' => 0,
+ },
+ create_makefile_pl => 'small',
+ dist_author => 'Daniel Berrange <dan(a)berrange.com>',
+ dist_abstract => 'libvirt Perl API',
+ requires => {
+ 'perl' => '5.8.0',
+ },
+ extra_compiler_flags => $GCC_CFLAGS . $LIBVIRT_CFLAGS,
+ extra_linker_flags => $LIBVIRT_LIBS,
+ build_requires => {
+ 'ExtUtils::CBuilder' => 0,
+ 'Sys::Hostname' => 0,
+ 'Test::CPAN::Changes' => 0,
+ 'Test::More' => 0,
+ 'Test::Pod' => '0',
+ 'Test::Pod::Coverage' => '0',
+ 'Time::HiRes' => 0,
+ 'XML::XPath' => 0,
+ 'XML::XPath::XMLParser' => 0,
+ },
+ script_files => [],
+ meta_add => {
+ resources => {
+ license => "http://www.gnu.org/licenses/gpl.html",
+ homepage => "http://libvirt.org/",
+ repository => "https://libvirt.org/git/?p=libvirt-perl.git;a=summary",
+ MailingList => "http://www.redhat.com/mailman/listinfo/libvir-list",
+ },
+ },
+ PL_files => { 'perl-Sys-Virt.spec.PL' => 'perl-Sys-Virt.spec' },
+ );
+$b->create_build_script;
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..3840a5c
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,73 @@
+.gitignore
+.gitpublish
+AUTHORS
+Build.PL
+Changes
+HACKING
+INSTALL
+LICENSE
+README
+examples/auth.pl
+examples/devices.pl
+examples/dhcp-leases.pl
+examples/dom-fsinfo.pl
+examples/dom-ifinfo.pl
+examples/dom-migrate.pl
+examples/dom-stats.pl
+examples/dump-info.pl
+examples/dump-xml.pl
+examples/emulator-pin.pl
+examples/events.pl
+examples/fs-freeze.pl
+examples/hv-stat.pl
+examples/iothreadinfo.pl
+examples/node-alloc.pl
+examples/node-cpu.pl
+examples/node-devlist.pl
+examples/node-info.pl
+examples/node-ksm.pl
+examples/open-console.pl
+examples/save-restore.pl
+examples/send-key.pl
+examples/vcpuinfo.pl
+examples/vol-download-all.pl
+examples/vol-download-nonblock.pl
+examples/vol-download.pl
+examples/vol-sparse.pl
+examples/vol-upload-all.pl
+examples/vol-upload-nonblock.pl
+examples/vol-upload.pl
+lib/Sys/Virt.pm
+lib/Sys/Virt.xs
+lib/Sys/Virt/Domain.pm
+lib/Sys/Virt/DomainSnapshot.pm
+lib/Sys/Virt/Error.pm
+lib/Sys/Virt/Event.pm
+lib/Sys/Virt/Interface.pm
+lib/Sys/Virt/NWFilter.pm
+lib/Sys/Virt/Network.pm
+lib/Sys/Virt/NodeDevice.pm
+lib/Sys/Virt/Secret.pm
+lib/Sys/Virt/StoragePool.pm
+lib/Sys/Virt/StorageVol.pm
+lib/Sys/Virt/Stream.pm
+perl-Sys-Virt.spec
+perl-Sys-Virt.spec.PL
+prepare-release.sh
+Makefile.PL
+t/005-pod.t
+t/010-pod-coverage.t
+t/015-changes.t
+t/020-constants.t
+t/030-api-coverage.t
+t/100-connect.t
+t/200-domains.t
+t/300-networks.t
+t/400-storage-pools.t
+t/500-storage-vols.t
+t/600-interfaces.t
+t/800-events.t
+typemap
+Makefile.PL
+META.yml
+META.json
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
deleted file mode 100644
index ebce958..0000000
--- a/MANIFEST.SKIP
+++ /dev/null
@@ -1,20 +0,0 @@
-pm_to_blib
-Virt\.o
-Virt\.c
-Virt\.bs
-Virt\.xsc
-.*.old
-Sys-Virt-
-blib
-.*\.bak
-CVS
-.cvsignore
-.*~
-.#.*
-#.*
-^Makefile$
-^cover_db/
-.hg
-.*\.orig
-.*\.sh
-\.git
diff --git a/META.yml.PL b/META.yml.PL
deleted file mode 100644
index 0467309..0000000
--- a/META.yml.PL
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2008 Daniel Berrange <dan(a)berrange.com>
-
-use strict;
-use warnings;
-
-die unless (scalar @ARGV == 1);
-
-open SRC, "lib/Sys/Virt.pm"
- or die "lib/Sys/Virt.pm: $!";
-
-our $VERSION;
-while (<SRC>) {
- if (/\$VERSION\s*=\s*'(.*)'/) {
- $VERSION=$1;
- }
-}
-close SRC;
-
-local $/ = undef;
-$_ = <DATA>;
-s/\@VERSION\@/$VERSION/g;
-
-open SPEC, ">$ARGV[0]" or die "$!";
-print SPEC $_;
-close SPEC;
-__DATA__
---- #YAML:1.0
-name: Sys-Virt
-abstract: Extension for the libvirt library
-version: @VERSION@
-author:
- - Daniel P. Berrange <dan(a)berrange.com>
-license: perl
-generated_by: ExtUtils::MakeMaker version 6.30
-build_requires:
- Test::More: 0
- Test::Pod: 0
- Test::Pod::Coverage: 0
- Test::CPAN::Changes: 0
- XML::XPath: 0
- XML::XPath::XMLParser: 0
- Sys::Hostname: 0
- Time::HiRes: 0
-
-resources:
- license: http://dev.perl.org/licenses/
- homepage: http://libvirt.org/
- repository: http://libvirt.org/git/?p=libvirt-perl.git;a=summary
- MailingList: http://www.redhat.com/mailman/listinfo/libvir-list
-
-distribution_type: module
-
-meta-spec:
- version: 1.3
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
diff --git a/Makefile.PL b/Makefile.PL
deleted file mode 100644
index f72e210..0000000
--- a/Makefile.PL
+++ /dev/null
@@ -1,85 +0,0 @@
-use 5.006;
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-
-my $libvirtver = "4.4.0";
-my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
-die "cannot run pkg-config to check libvirt version" if $stat == -1;
-die "libvirt >= $libvirtver is required\n" unless $stat == 0;
-
-my $LIBVIRT_LIBS = `pkg-config --libs libvirt`;
-my $LIBVIRT_CFLAGS = `pkg-config --cflags libvirt`;
-
-my $gccflags = "-W -Waddress -Wall -Warray-bounds -Wattributes \\
- -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align \\
- -Wchar-subscripts -Wclobbered -Wcomment -Wcomments \\
- -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations \\
- -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion \\
- -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul \\
- -Wformat-extra-args -Wformat-security -Wformat-y2k \\
- -Wformat-zero-length -Wformat=2 -Wfree-nonheap-object \\
- -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration \\
- -Wimplicit-int -Winit-self -Wint-to-pointer-cast \\
- -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init \\
- -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces \\
- -Wmissing-declarations -Wmissing-field-initializers \\
- -Wmissing-format-attribute -Wmissing-include-dirs \\
- -Wmissing-noreturn -Wmissing-parameter-type \\
- -Wmultichar -Wnarrowing -Wnonnull \\
- -Wnormalized=nfc -Wold-style-declaration -Wold-style-definition \\
- -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses \\
- -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas \\
- -Wreturn-type -Wsequence-point -Wno-shadow -Wstrict-aliasing \\
- -Wstrict-prototypes -Wsuggest-attribute=const \\
- -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch \\
- -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized \\
- -Wunknown-pragmas -Wunused -Wunused-but-set-parameter \\
- -Wunused-but-set-variable -Wunused-function -Wunused-label \\
- -Wunused-local-typedefs -Wno-unused-parameter -Wunused-result \\
- -Wunused-value -Wunused-variable -Wvariadic-macros \\
- -Wvector-operation-performance -Wvolatile-register-var \\
- -Wwrite-strings -Wno-sign-compare -Wjump-misses-init \\
- -Wno-format-nonliteral -Wframe-larger-than=8192 \\
- -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Werror";
-
-my $cflags;
-if ($ENV{TEST_MAINTAINER}) {
- $cflags = $gccflags;
-} else {
- $cflags = "-Wall";
-}
-
-WriteMakefile(
- 'NAME' => 'Sys::Virt',
- 'VERSION_FROM' => 'lib/Sys/Virt.pm',
- 'PREREQ_PM' => {
- 'Test::More' => 0,
- 'Test::Pod' => 0,
- 'Test::Pod::Coverage' => 0,
- 'Test::CPAN::Changes' => 0,
- 'Time::HiRes' => 0,
- 'XML::XPath' => 0,
- },
- 'AUTHOR' => 'Daniel Berrange <dan(a)berrange.com>',
- 'LIBS' => [$LIBVIRT_LIBS],
- 'INC' => "$cflags $LIBVIRT_CFLAGS",
- 'depend' => {
- Sys-Virt.spec => '$(VERSION_FROM)',
- Makefile => '$(VERSION_FROM)',
- },
- 'NO_META' => 1,
- 'realclean' => {
- FILES => 'Sys-Virt.spec',
- },
-);
-
-package MY;
-
-sub libscan
- {
- my ($self, $path) = @_;
- ($path =~ /\~$/ || $path =~ m,/CVS/,) ? undef : $path;
- }
-
-__END__
diff --git a/Virt.xs b/lib/Sys/Virt.xs
similarity index 100%
rename from Virt.xs
rename to lib/Sys/Virt.xs
diff --git a/perl-Sys-Virt.spec.PL b/perl-Sys-Virt.spec.PL
index ffa6c86..e7b4044 100644
--- a/perl-Sys-Virt.spec.PL
+++ b/perl-Sys-Virt.spec.PL
@@ -6,15 +6,19 @@ use strict;
die unless (scalar @ARGV == 1);
-unless (do './lib/Sys/Virt.pm')
- {
- if ($@) { die $@ };
- die "lib/Sys/Virt.pm: $!";
- }
+open PM, './lib/Sys/Virt.pm' or die "lib/Sys/Virt.pm: $!";
+my $ver;
+while (<PM>) {
+ if (/our \$VERSION = '(.*)'/) {
+ $ver = $1;
+ last;
+ }
+}
+die "cannot find version" unless $ver;
local $/ = undef;
$_ = <DATA>;
-s/\@VERSION\@/$Sys::Virt::VERSION/g;
+s/\@VERSION\@/$ver/g;
open SPEC, ">$ARGV[0]" or die "$!";
print SPEC $_;
@@ -29,9 +33,10 @@ Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Sys-Virt/
-Source0: http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-%{version}.tar.gz
+Source0: http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-v%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl(ExtUtils::CBuilder)
+BuildRequires: perl(Module::Build)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::CPAN::Changes)
@@ -46,32 +51,24 @@ machine management APIs. This allows machines running within arbitrary
virtualization containers to be managed with a consistent API.
%prep
-%setup -q -n Sys-Virt-%{version}
+%setup -q -n Sys-Virt-v%{version}
-sed -i -e '/Sys-Virt\.spec/d' Makefile.PL
-sed -i -e '/\.spec\.PL$/d' MANIFEST
-rm -f *.spec.PL
%build
-%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
-make %{?_smp_mflags}
+%{__perl} Build.PL installdirs=vendor
+./Build
%install
-rm -rf $RPM_BUILD_ROOT
+./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
-make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
-
-find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) |
- xargs rm -f
-find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \;
+#find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) |
+# xargs rm -f
+#find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \;
%{_fixperms} $RPM_BUILD_ROOT/*
%check
-make test
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+./Build test
%files
%defattr(-,root,root,-)
diff --git a/prepare-release.sh b/prepare-release.sh
index fea03f4..6850350 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -4,52 +4,18 @@ NAME=Sys-Virt
set -e
-test -n "$1" && RESULTS=$1 || RESULTS=results.log
+rm -rf blib _build Build $NAME-*.tar.gz
-make -k realclean ||:
-rm -rf MANIFEST blib pm_to_blib
+test -z "$AUTOBUILD_INSTALL_ROOT" && AUTOBUILD_INSTALL_ROOT=$HOME/builder
export TEST_MAINTAINER=1
-perl Makefile.PL PREFIX=$HOME/builder
+perl Build.PL install_base=$AUTOBUILD_INSTALL_ROOT
-rm -f MANIFEST
-
-# Build the RPM.
-make
-make manifest
-
-if [ -z "$USE_COVER" ]; then
- perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 || USE_COVER=0
-fi
-
-if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
- if [ "$USE_COVER" = "1" ]; then
- cover -delete
- export HARNESS_PERL_SWITCHES=-MDevel::Cover
- fi
-
- # set -o pipefail is a bashism; this use of exec is the POSIX alternative
- exec 3>&1
- st=$(
- exec 4>&1 >&3
- { make test 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
- )
- exec 3>&-
- test "$st" = 0
-
- if [ "$USE_COVER" = "1" ]; then
- cover
- mkdir blib/coverage
- cp -a cover_db/*.html cover_db/*.css blib/coverage
- mv blib/coverage/coverage.html blib/coverage/index.html
- fi
-fi
-
-make install
-
-rm -f $NAME-*.tar.gz
-make dist
+./Build
+./Build test
+./Build install
+./Build dist
if [ -f /usr/bin/rpmbuild ]; then
rpmbuild --nodeps -ta --clean $NAME-*.tar.gz
diff --git a/t/030-api-coverage.t b/t/030-api-coverage.t
index 95bbd11..39d6146 100644
--- a/t/030-api-coverage.t
+++ b/t/030-api-coverage.t
@@ -48,7 +48,7 @@ foreach my $n ($set->get_nodelist) {
push @macros, $n->getData();
}
-open XS, "<Virt.xs" or die "cannot read Virt.xs: $!";
+open XS, "<lib/Sys/Virt.xs" or die "cannot read lib/Sys/Virt.xs: $!";
my $xs;
{
--
2.17.0
6 years, 5 months
[libvirt] [PATCH python 0/5] Some fixes and one improvement
by Marc Hartmayer
Boris Fiuczynski (1):
libvirt-override.py: fix sparseSendAll
Marc Hartmayer (4):
libvirt_qemu/lxc: import 'sys' package
libvirt_qemu/lxc: fix a namespace issue
libvirt-override.py: remove unused import
Allow virConnect to be used as a context manager
generator.py | 8 ++++++--
libvirt-override-virConnect.py | 6 ++++++
libvirt-override-virStream.py | 2 +-
libvirt-override.py | 1 -
4 files changed, 13 insertions(+), 4 deletions(-)
--
2.13.4
6 years, 5 months
[libvirt] [dbus PATCH v2 0/4] API name fixes
by Pavel Hrdina
changes in v2:
- fixed build error for each patch by moving all lifecycle function
rename into a single patch
Pavel Hrdina (4):
domain: Rename (Get|Set)BlkioParameters
events: Rename AgentLifecycle event
events: Rename IOErrorReason event
events: Rename all lifecycle event functions to follow the signal name
data/org.libvirt.Domain.xml | 8 +++---
src/domain.c | 32 ++++++++++-----------
src/events.c | 56 ++++++++++++++++++-------------------
3 files changed, 48 insertions(+), 48 deletions(-)
--
2.17.0
6 years, 5 months
[libvirt] [PATCH] travis: Install Jansson instead of yajl
by Andrea Bolognani
libvirt has switched to Jansson as its JSON implementation,
so we need it available for builds to succeed. yajl, on the
other hand, is no longer needed.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Should be pushed at the same time as Ján's series.
.travis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 140072b801..c3ea9f73b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,7 +24,7 @@ matrix:
- brew uninstall python mercurial postgis sfcgal cgal gdal
- brew update
- brew upgrade
- - brew install python rpcgen yajl
+ - brew install python rpcgen jansson
script:
# We can't run make distcheck/syntax-check because they
# fail on macOS, but doing 'install' and 'dist' gives us
@@ -61,6 +61,7 @@ addons:
- libdevmapper-dev
- libfuse-dev
- libgnutls-dev
+ - libjansson-dev
- libnetcf-dev
- libnl-3-dev
- libnl-route-3-dev
@@ -82,7 +83,6 @@ addons:
- libxen-dev
- libxml2-dev
- libxml2-utils
- - libyajl-dev
- lvm2
- make
# - nfs-common # broken on trusty since build #807 (2018-01-09)
--
2.17.0
6 years, 5 months
[libvirt] [PATCH v2 0/4] Fix qemu-img qcow[2] encrypted image handling
by John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2018-April/msg01578.html
Changes since v1... Rather than disallow, alter the code in order to
handle the creation, conversion, and resize of qcow[2] encrypted images.
See conversion processing description from review:
https://www.redhat.com/archives/libvir-list/2018-April/msg02037.html
John Ferlan (4):
storage_util: Alter qemu storage encryption arguments
storage_util: Fix qemu qcow[2] encryption convert processing
storage_util: Don't assume "luks" encryption for resize
docs: Update news.xml to describe encrypted image issues
docs/formatstorageencryption.html.in | 10 ++
docs/news.xml | 12 ++
src/storage/storage_util.c | 159 +++++++++++++++------
src/storage/storage_util.h | 10 +-
src/util/virqemu.c | 10 +-
src/util/virqemu.h | 3 +-
tests/storagevolxml2argvdata/qcow2-1.1.argv | 4 +-
tests/storagevolxml2argvdata/qcow2-compat.argv | 4 +-
.../qcow2-from-logical-compat.argv | 12 +-
tests/storagevolxml2argvdata/qcow2-lazy.argv | 6 +-
.../qcow2-nobacking-convert-prealloc-compat.argv | 13 +-
.../qcow2-nobacking-prealloc-compat.argv | 4 +-
.../qcow2-nocapacity-convert-prealloc.argv | 14 +-
tests/storagevolxml2argvdata/qcow2-nocapacity.argv | 4 +-
.../storagevolxml2argvdata/qcow2-nocow-compat.argv | 6 +-
tests/storagevolxml2argvdata/qcow2-nocow.argv | 3 +-
tests/storagevolxml2argvtest.c | 61 ++++++--
17 files changed, 255 insertions(+), 80 deletions(-)
--
2.14.3
6 years, 5 months
[libvirt] [dbus PATCH v2] docs: Introduce man file for libvirt-dbus daemon
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
changes in v2:
- added pod2man build dependency into spec file
.gitignore | 2 ++
Makefile.am | 2 +-
configure.ac | 1 +
docs/Makefile.am | 13 +++++++++
docs/libvirt-dbus.pod | 66 +++++++++++++++++++++++++++++++++++++++++++
libvirt-dbus.spec.in | 2 ++
6 files changed, 85 insertions(+), 1 deletion(-)
create mode 100644 docs/Makefile.am
create mode 100644 docs/libvirt-dbus.pod
diff --git a/.gitignore b/.gitignore
index c6d9754..0bf09cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,8 @@ vgcore.*
/data/system/libvirt-dbus.rules
/data/system/org.libvirt.conf
+/docs/*.1
+
/src/.deps/
/src/libvirt-dbus
/src/org.libvirt.service
diff --git a/Makefile.am b/Makefile.am
index 16f57b2..bb5ff5c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = data src tests
+SUBDIRS = data docs src tests
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index cc8947c..707a03e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,7 @@ AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_OUTPUT(Makefile
data/Makefile
+ docs/Makefile
src/Makefile
tests/Makefile
libvirt-dbus.spec)
diff --git a/docs/Makefile.am b/docs/Makefile.am
new file mode 100644
index 0000000..c41ffae
--- /dev/null
+++ b/docs/Makefile.am
@@ -0,0 +1,13 @@
+POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
+
+PODFILES = libvirt-dbus.pod
+
+%.8: %.pod
+ $(AM_V_GEN)$(POD2MAN) -s 8 $< $@ \
+ && if grep 'POD ERROR' $@; then rm $@; exit 1; fi
+
+man8_MANS = libvirt-dbus.8
+
+EXTRA_DIST = $(PODFILES)
+
+CLEANFILES = $(man8_MANS)
diff --git a/docs/libvirt-dbus.pod b/docs/libvirt-dbus.pod
new file mode 100644
index 0000000..49de044
--- /dev/null
+++ b/docs/libvirt-dbus.pod
@@ -0,0 +1,66 @@
+=head1 NAME
+
+libvirt-dbus - D-Bus daemon exporting libvirt API
+
+=head1 SYNOPSIS
+
+B<libvirt-dbus> [I<OPTION>]...
+
+=head1 DESCRIPTION
+
+libvirt-dbus wraps libvirt API to provide a high-level object-oriented
+API better suited for dbus-based applications.
+
+Normally libvirt-dbus is started by D-Bus daemon on demand.
+
+=head1 OPTIONS
+
+=over
+
+=item B<-h --help>
+
+Display command line help usage then exit.
+
+=item B<--system>
+
+Connect to the system bus.
+
+=item B<--session>
+
+Connect to the session bus.
+
+=item B<-t --threads> I<NUM>
+
+Configure maximal number of worker threads.
+
+=back
+
+=head1 BUGS
+
+Please report all bugs you discover. This should be done via either:
+
+=over
+
+=item a) the mailing list
+
+L<https://libvirt.org/contact.html>
+
+=item b) the bug tracker
+
+L<https://libvirt.org/bugs.html>
+
+=back
+
+Alternatively, you may report bugs to your software distribution / vendor.
+
+=head1 AUTHORS
+
+Please refer to the AUTHORS file distributed with libvirt-dbus.
+
+=head1 LICENSE
+
+libvirt-dbus is Free Software and licenced under LGPLv2+.
+
+=head1 SEE ALSO
+
+L<https://libvirt.org/dbus.html>, L<https://libvirt.org/>
diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in
index 1543197..db58483 100644
--- a/libvirt-dbus.spec.in
+++ b/libvirt-dbus.spec.in
@@ -17,6 +17,7 @@ BuildRequires: gcc
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: libvirt-devel >= %{libvirt_version}
BuildRequires: libvirt-glib-devel >= %{libvirt_glib_version}
+BuildRequires: /usr/bin/pod2man
Requires: dbus
Requires: glib2 >= %{glib2_version}
@@ -55,5 +56,6 @@ exit 0
%{_datadir}/dbus-1/system-services/org.libvirt.service
%{_datadir}/dbus-1/system.d/org.libvirt.conf
%{_datadir}/dbus-1/interfaces/org.libvirt.*.xml
+%{_mandir}/man8/libvirt-dbus.8*
%changelog
--
2.17.0
6 years, 5 months
[libvirt] ANNOUNCE: Plans for the next release
by Pavel Hrdina
Hi,
I would like to make the next libvirt-dbus release with stable APIs,
there is a lot of them already implemented and other projects can start
adapting to use libvirt-dbus.
The release version would be 1.0.0 and currently libvirt-dbus will
cover APIs up to libvirt-3.0.0 as a start point because that libvirt
version is available in all downstream distributions currently
supported by libvirt.
So I would like to ask everyone to look at the APIs to check whether it
make sense and whether something is missing or could be excluded.
The idea of libvirt-dbus is not to export every API if there is a better
API to do the job, so for example:
- all APIs that have both versions with and without flags we will
export only the one with flags.
- some of the Stats APIs can be omitted since the same values are
also exported in the GetStats (virDomainListGetStats)
I would like to make the release this week so any help or suggestion is
welcome. The API definition is in the data/org.libvirt.*.xml files.
Thanks and regards
Pavel
6 years, 5 months
[libvirt] [PATCH v2] log: actually do substring matches with fnmatch
by Daniel P. Berrangé
Historically we matched log filters with strstr(), and when switching to
fnmatch in cbb0fd3cfdc287f6f4653ef1f04a7cfb2ea51b27, it was stated that
we would continue to match substrings, with "foo" being equivalent to
"*foo*". Unfortuntely I forget to provide the code to actually make that
happen. This fixes it to prepend and append "*". We don't bother to
check if the pattern already has a leading/trailing '*', because
"**foo**" will match the same as "*foo*".
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Changed in v2:
- Simplify to always append/prepend '*'
- Other fixes from Erik
src/util/virlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/util/virlog.c b/src/util/virlog.c
index be9fc0cf78..9b63b8e7cd 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1409,6 +1409,7 @@ virLogFilterNew(const char *match,
{
virLogFilterPtr ret = NULL;
char *mdup = NULL;
+ size_t mlen = strlen(match);
virCheckFlags(VIR_LOG_STACK_TRACE, NULL);
@@ -1418,9 +1419,16 @@ virLogFilterNew(const char *match,
return NULL;
}
- if (VIR_STRDUP_QUIET(mdup, match) < 0)
+ /* We must treat 'foo' as equiv to '*foo*' for fnmatch
+ * todo substring matches, so add 2 extra bytes */
+ */
+ if (VIR_ALLOC_N_QUIET(mdup, mlen + 3) < 0)
return NULL;
+ mdup[0] = '*';
+ memcpy(mdup + 1, match, mlen);
+ mdup[mlen + 1] = '*';
+
if (VIR_ALLOC_QUIET(ret) < 0) {
VIR_FREE(mdup);
return NULL;
--
2.17.0
6 years, 5 months