Re: [libvirt] Libvirt management daemon issue
by Eric Blake
[re-adding the list with permission - conversations like this should be
held in public, because others may benefit from the archives]
[please don't top-post on technical lists]
On 11/04/2015 09:42 PM, Bilal Arif wrote:
> One thing I found about binaries when i apply my patch on Qemu the results
> was:
>
> robo@robo:~/Downloads/qemu-2.4.0.1$ patch -p1 <
> /home/robo/Downloads/kvm-qemu-2.4.0.1-libvmi.patch
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file hmp.c
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file hmp-commands.hx
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file hmp.h
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file Makefile.target
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file memory-access.c
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file memory-access.h
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file qapi-schema.json
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file qmp-commands.hx
Patching qemu is unrelated to building libvirt, and the fact that patch
merely warned you about stripping CRs shouldn't affect the qemu you
build, nor cause problem you were seeing with libvirt.
You know, it would be nice if the libvmi folks could upstream their
patch instead of making users have to apply a downstream patch and
self-build. There have been some conversations on the qemu list lately
about what it would take. But it is unrelated to the topic at hand.
>
>
> On Thu, Nov 5, 2015 at 9:38 AM, Bilal Arif <billal.ariif(a)gmail.com> wrote:
>
>> Thanks Eric Blacke, Well Your answer is may be deficult to understand for
>> newbies like me. so I listing my actions performed of fresh ubuntu box
>> please consider and make me understand how self-built binaries get
>> installed and where they exist and how I could check their configure for
>> Ubuntu 14.04.
>> Actions:
>> Dependencies are installed with apt-get for Introspection
>> Qemu-KVM from source and put a patch on that after i just download libvirt
>> from and compile.
You still didn't show what arguments to pass to ./configure. The problem
you are hitting is because your configure arguments differ from those of
the pre-built distro libvirt, and when both are installed, attempts to
locate subsidiary files (whether .so or other subsidiary files) are
finding the files from the other installation.
But I don't use Ubuntu enough to know what to recommend. Which is why
posting this on the list, where other users might be able to chime in,
is always a better idea than posting to just me.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
9 years
[libvirt] [PATCH v2 0/9] Introduce virt-admin client
by Erik Skultety
v1:
1/9 - ACKed if adjusted
6/9 - ACKed
8/9 - ACKed if squashed into 4/9 --> resolves 7/9
v2:
- double empty line in private.syms is preserved (1/9)
- adjusted authors of virt-admin modules (2/9)
- removed unnecessary includes from virt-admin module (2/9)
- replaced "int" disconnected type for type "bool" (2/9)
- dropped unused command groups (2/9)
- removed unnecessary flags and adminControl struct element (2/9)
- introduction of virAdmConnectIsAlive split separately (3/9)
- remote version of admin API moved into a separate module (4/9)
- updated admin_protocol-structs (8/9)
- removed debugging leftovers from gendispatch.pl (8/9)
- properly indented if-else conditions in gendispatch.pl (8/9)
- removed unrelated paragraph, domain references, unsupported
options from virt-admin.pod and command 'connect' is now
(hopefully correctly) documented (9/9)
- introduction of vshAdmCatchDisconnect and introduction of close
callbacks had to be squashed together due to dependencies both
ways <-- review 4/9 pointed out dummy NULL close callback which
should be replaced by something relevant
- creation of the admin socket is prohibited (until 1.3.0) => testing
requires the socket to be permitted and created!
Erik Skultety (9):
libvirt: Export libvirt config getters by moving them to util
virt-admin: Introduce first working skeleton
admin: Introduce virAdmConnectIsAlive
admin: Move remote admin API version to a separate module
admin: Do not generate remoteAdminConnect{Open,Close}
admin: Add URI support and introduce virAdmGetDefaultURI
admin: Add support for connection close callbacks
admin: Introduce virAdmConnectGetLibVersion
virt-admin: Provide a man page for virt-admin
.gitignore | 1 +
daemon/admin_server.c | 9 +
daemon/libvirtd.c | 1 -
include/libvirt/libvirt-admin.h | 25 ++
po/POTFILES.in | 2 +
src/admin/admin_protocol.x | 15 +-
src/admin/admin_remote.c | 217 ++++++++++++
src/admin_protocol-structs | 4 +
src/datatypes.c | 22 ++
src/datatypes.h | 15 +-
src/libvirt-admin.c | 421 +++++++++++++++--------
src/libvirt.c | 55 +--
src/libvirt_admin_private.syms | 1 +
src/libvirt_admin_public.syms | 5 +
src/libvirt_private.syms | 1 +
src/rpc/gendispatch.pl | 11 +-
src/util/virconf.c | 52 +++
src/util/virconf.h | 2 +-
tools/Makefile.am | 36 +-
tools/virt-admin.c | 737 ++++++++++++++++++++++++++++++++++++++++
tools/virt-admin.h | 47 +++
tools/virt-admin.pod | 278 +++++++++++++++
22 files changed, 1747 insertions(+), 210 deletions(-)
create mode 100644 src/admin/admin_remote.c
create mode 100644 tools/virt-admin.c
create mode 100644 tools/virt-admin.h
create mode 100644 tools/virt-admin.pod
--
2.4.3
9 years
[libvirt] [PATCH] network: Remove extraneous ATTRIBUTE_NONNULL for virNetDevWaitDadFinish
by John Ferlan
Commit id '0f7436ca' added virNetDevWaitDadFinish using ATTRIBUTE_NONNULL
for both arguments, although one is a non-null argument. A Coverity build
balks at that.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushing under the build-breaker rule
src/util/virnetdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 9108be6..772ae75 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -106,7 +106,7 @@ int virNetDevClearIPAddress(const char *ifname,
int virNetDevGetIPAddress(const char *ifname, virSocketAddrPtr addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevWaitDadFinish(virSocketAddrPtr *addrs, size_t count)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_NONNULL(1);
int virNetDevSetMAC(const char *ifname,
--
2.1.0
9 years
[libvirt] Libvirt management daemon issue
by Bilal Arif
robo@robo:~$ sudo /etc/init.d/libvirt-bin start
[sudo] password for robo:
* Starting libvirt management daemon libvirtd/usr/sbin/libvirtd:
/usr/local/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_1.2.2' not found
(required by /usr/sbin/libvirtd)
Giving up waiting for /var/run/libvirt/libvirt-sock.
After installing libvirt from source a lot of Ubuntu user face this issue,
as i searched on internet about this, no solution works. this is mostly in
case of ubuntu users as mentioned in many posted threads. so please help
us as soon as possible. (this is only in case of installation libvirt from
source)
9 years
[libvirt] [PATCH] qemu: add /usr/lib to AC_PATH_PROG for qemu-bridge-helper
by Michel Normand
For openSUSE the qemu-bridge-helper is installed in /usr/lib
So libvirt has to search it in this directory.
Signed-off-by: Michel Normand <normand(a)linux.vnet.ibm.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 75e95b7..77106ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2520,7 +2520,7 @@ AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account])
AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-bridge-helper],
- [/usr/libexec:/usr/lib/qemu])
+ [/usr/libexec:/usr/lib/qemu:/usr/lib])
AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper])
AC_ARG_WITH([macvtap],
--
1.7.9.5
9 years
[libvirt] Release of libvirt-1.2.21
by Daniel Veillard
So as planned I tagged libvirt-1.2.21 in git, we are out of freeze !
The signed tarballs and rpms for 1.2.21 are in the usual places for libvirt
ftp://libvirt.org/libvirt/
and for python bindings
ftp://libvirt.org/libvirt/python/
This is a moderately sized release with around 150 commits, a lot of
refactoring and cleanups on the migration code, the python bindings and
updates to the vz driver:
Documentation:
- event impl. registration before hypervisor connection (Dominik Perpeet)
- libvirt-secret: Fix typo (Wei Jiangang)
- NEWS: Fix XSLT stylesheet (Andrea Bolognani)
- NEWS: Split releases by year (Andrea Bolognani)
- NEWS: Unify date format (Andrea Bolognani)
- NEWS: Unify section titles (Andrea Bolognani)
- NEWS: Add empty lines (Andrea Bolognani)
- NEWS: Fix indentation (Andrea Bolognani)
- NEWS: Fix newlines (Andrea Bolognani)
- NEWS: Fix whitespace (Andrea Bolognani)
- NEWS: Organize old entries (Andrea Bolognani)
- NEWS: Split old entries (2009) (Andrea Bolognani)
- NEWS: Split old entries (2008) (Andrea Bolognani)
- NEWS: Split old entries (2006-2007) (Andrea Bolognani)
- NEWS: Properly escape > in HTML (Andrea Bolognani)
- NEWS: Split off merged sections (Andrea Bolognani)
- NEWS: Remove empty sections (Andrea Bolognani)
- NEWS: Include description for release 0.7.3 (Andrea Bolognani)
- domain: Show canonical pvspinlock XML (Cole Robinson)
- Add Cuckoo Sandbox into apps.html (Martin Kletzander)
Portability:
- Fix virNetDevWaitDadFinish stub (Roman Bogorodskiy)
- util: implement virProcessGetStartTime on GNU/kFreeBSD (Pino Toscano)
- build: include xdr cflags for libvirt-admin (Eric Blake)
- virt-host-validate: disable mntent code on Win32 (Daniel P. Berrange)
- src: Remove $(builddir) usage (Andrea Bolognani)
Bug Fixes:
- wireshark: Install to generic plugin directory (Michal Privoznik)
- network: wait for DAD to finish for bridge IPv6 addresses (Maxim Perevedentsev)
- qemu: Use live autoNodeset when numatune placement is auto (Luyao Huang)
- virsh-domain: use correct base for virStrToLong_ui (Pavel Hrdina)
- libvirt-domain: fix the error reporting when use the localhost as target uri (Luyao Huang)
- qemu: fix migration flags undefinesource cannot work (Luyao Huang)
- virsh: Display an error when passing count <= 0 to setvcpus (Luyao Huang)
- virtlockd: Don't SIGSEGV on SIGUSR1 (Michal Privoznik)
- Close the source fd if the destination qemu exits during tunnelled migration (Shivaprasad G Bhat)
- qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD (John Ferlan)
- virsh: Use 'format' argument only when specified (Peter Krempa)
- storage: Track successful creation of LV for removal (John Ferlan)
- storage: Fix a resource leak in storageVolCreateXML (John Ferlan)
- storage: Fix incorrect format for <disk> <auth> XML (John Ferlan)
- migration: check dconnuri in p2p mode (Nikolay Shirokovskiy)
- qemu: Resolve Coverity FORWARD_NULL (John Ferlan)
- libxl: Resolve Coverity FORWARD_NULL (John Ferlan)
- tests: eventtest: Fix coverity warning (Cole Robinson)
- qemu: migration: Skip few checks while doing offline migration (Peter Krempa)
- qemu: Wait until destination QEMU consumes all migration data (Jiri Denemark)
- conf: Remove <metadata> elements with no namespace (Peter Krempa)
- storage: Adjust calculation of alloc/capacity for disk (John Ferlan)
- storage: Prior to creating a volume, refresh the pool (John Ferlan)
- virfile: Fix error path for forked virFileRemove (John Ferlan)
- rpc: libssh2: Fix regression in ssh host key verification (Peter Krempa)
- interface: fail on OOM from virGetInterface() (Laine Stump)
- libvirt.spec: fix accidental conditional inclusion of polkit docs (Daniel P. Berrange)
- qemu: Use memory-backing-file only when needed (Martin Kletzander)
Improvements:
- util: set max wait for IPv6 DAD to 20 seconds (Laine Stump)
- util: set error if DAD is not finished (Luyao Huang)
- netlink: add support for multi-part netlink messages. (Maxim Perevedentsev)
- rbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided (Wido den Hollander)
- bhyve: implement domainGetOSType (Roman Bogorodskiy)
- libvirt-domain: fix no error report when p2p migrate fail (Luyao Huang)
- conf: Add serial target type to ABI stability check (Luyao Huang)
- lock_daemon: Switch to wrapper locking functions (Michal Privoznik)
- qemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices() (Andrea Bolognani)
- qemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices() (Andrea Bolognani)
- qemu: hostdev: Unify naming for qemuHostdevReAttach*Devices() (Andrea Bolognani)
- qemu: hostdev: Unify naming for qemuHostdevPrepare*Devices() (Andrea Bolognani)
- hostdev: Rename virHostdevUpdateDomainActiveDevices() (Andrea Bolognani)
- conf: Fix error message to use correct parameter (John Ferlan)
- util: Produce friendlier error message to user (Luyao Huang)
- util: Adjust error paths for virNumaSetPagePoolSize (Luyao Huang)
- util: split the virNumaGetHugePageInfoPath into separate function (Luyao Huang)
- Avoid using !STREQ and !STRNEQ (Ishmanpreet Kaur Khera)
- vz: implement some domain API calls (Maxim Nestratov)
- vz: implement API calls of nodeGetxxx family (Maxim Nestratov)
- vz: implement connectGetMaxVcpus API calls (Maxim Nestratov)
- security_dac: Introduce remember/recall APIs (Michal Privoznik)
- security_dac: Limit usage of virSecurityDACSetOwnershipInternal (Michal Privoznik)
- virSecurityDACRestoreSecurityFileLabel: Pass virSecurityDACDataPtr (Michal Privoznik)
- virSecurityDACSetOwnership: Pass virSecurityDACDataPtr (Michal Privoznik)
- virSecurityDACSetOwnershipInternal: Don't chown so often (Michal Privoznik)
- security_dac: Fix TODO marks (Michal Privoznik)
- conf: Optimize the iothreadid initialization (John Ferlan)
- qemu: Check for niothreads == 0 in qemuSetupCgroupForIOThreads (John Ferlan)
- qemu: Use 'niothreadids' instead of 'iothreads' (John Ferlan)
- Fix conficts with HACKING doc (Wei Jiangang)
- conf: Refactor the iothreadid initialization (John Ferlan)
- tests: make redirects happen in correct order (Wei Jiangang)
- storage: Rework error paths for virStorageBackendCreateExecCommand (John Ferlan)
- storage: On error rmdir created directory in virDirCreate[NoFork] (John Ferlan)
- storage: On error unlink created file in virFileOpen{As|Forked} (John Ferlan)
- storage: Remove duplicitous refreshVol in Sheepdog buildVol (John Ferlan)
- storage: Remove duplicitous refreshVol in RBD buildVol (John Ferlan)
- virt-host-validate: check for IOMMU support (Daniel P. Berrange)
- libvirt-domain: Drop virDomainMigrateCheckNotLocal attribute (Michal Privoznik)
- virt-host-validate: check for required cgroups (Daniel P. Berrange)
- virt-host-validate: distinguish exists vs accessible for devices (Daniel P. Berrange)
- virt-host-validate.c: check for kernel namespaces (Daniel P. Berrange)
- migration: refactor: introduce parameter checking function (Nikolay Shirokovskiy)
- migration: merge all proto branches into single function (Nikolay Shirokovskiy)
- migration: refactor: refactor parameter compatibility checks (Nikolay Shirokovskiy)
- migration: refactor: extract parameter adaption functions (Nikolay Shirokovskiy)
- migration: refactor: introduce params version of unmanaged (Nikolay Shirokovskiy)
- migration: refactor: merge direct and p2p into unmanaged (Nikolay Shirokovskiy)
- migration: refactor: rename uri parameter to miguri (Nikolay Shirokovskiy)
- migration: remove direct migration dependency on version1 of driver (Michal Privoznik)
- migration: move implementation check to branches in p2p (Nikolay Shirokovskiy)
- migration: refactor: reuse p2p url check (Nikolay Shirokovskiy)
- migration: refactor: get rid of use_params p2p_full (Nikolay Shirokovskiy)
- virJSONValueArraySize: return ssize_t (Michal Privoznik)
- src: Include $(builddir)/util in the header search path (Andrea Bolognani)
- storage: Perform some cleanup of calls (John Ferlan)
- AUTHORS: Add myself to the list of committers (Andrea Bolognani)
- virSecurityManagerNew: Turn array of booleans into flags (Michal Privoznik)
- qemu: Fix indentation issue (Andrea Bolognani)
- qemu: Remove explicit values from virQEMUCapsFlags (Andrea Bolognani)
- qemu: migration: Use migration flags in qemuMigrationIsAllowed (Peter Krempa)
- qemu: migration: Drop @def from qemuMigrationIsAllowed (Peter Krempa)
- qemu: migration: Split source and destination migration checks (Peter Krempa)
- spec: Delete .git after applying patches (Cole Robinson)
- tests: qemu: Add aarch64 virtio pci tests (Cole Robinson)
- qemu: Make updating stats in qemuMigrationCheckJobStatus optional (Jiri Denemark)
- qemu: Introduce flags in qemuMigrationCompleted (Jiri Denemark)
- qemu: Copy completed migration stats only on success (Jiri Denemark)
- qemu: Always update migration times on destination (Jiri Denemark)
- tests: Check GIC-related XMLs in qemuxml2xmltest (Martin Kletzander)
- Do not distribute generated virkeymaps.h (Martin Kletzander)
- apparmor: differentiate between error and unconfined profiles (Cédric Bosdonnat)
- testutils: Drop virtTestResult (Cole Robinson)
- tests: eventtest: Open code virtTestResult (Cole Robinson)
- tests: sheepdog: Drop use of virtTestResult (Cole Robinson)
- testutils: Add coloring to verbose PASS/FAILED output (Cole Robinson)
- storage: Introduce virStorageBackendDiskStartPool (John Ferlan)
- storage: Add additional errors/checks for disk label (John Ferlan)
- storage: Add param to check whether we can write a disk label (John Ferlan)
- storage: Refactor disk label checking (John Ferlan)
- virfile: Add extra check for direct delete in virFileRemove (John Ferlan)
- qemu: Add conditions for qemu-kvm use on ppc64 (Andrea Bolognani)
- rpc: libssh2: Add more debugging info (Peter Krempa)
- conf: Reuse virDomainDefCheckDuplicateDiskWWN to check disk serial too (Peter Krempa)
- qemu: Perform the disk WWN check only on fresh starts (Peter Krempa)
- interface: let netcf pre-filter for active vs. inactive (Laine Stump)
- interface: re-use name and mac address rather than re-retrieving (Laine Stump)
- interface: report correct interface count when not returning list (Laine Stump)
- qemu: Add -mem-path even with numa (Martin Kletzander)
- qemu: Extract -mem-path building into its own function (Martin Kletzander)
- qemu: Move memory size detection to the top of the function (Martin Kletzander)
- qemu: Move simplification variable to begining of the function (Martin Kletzander)
- qemu: Add test cases for gic-version option (Pavel Fedin)
- qemu: Add support for gic-version machine option (Pavel Fedin)
- qemu: Introduce QEMU_CAPS_MACH_VIRT_GIC_VERSION capability (Pavel Fedin)
- Post-release version bump to 1.2.21 (Martin Kletzander)
Cleanups:
- tests: Remove unused nodeinfo test data (Andrea Bolognani)
- vz: cleanup (Maxim Nestratov)
- vz: remove storage driver as never used (Maxim Nestratov)
- vz: remove network driver as never used (Maxim Nestratov)
Thanks everybody for your contributions to this release !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
9 years
[libvirt] [PATCH 0/5] Some qemuProcessStart cleanups
by Jiri Denemark
Jiri Denemark (5):
qemu: Use correct type when calling qemuPrepareNVRAM
qemu: Rename cleanup label in qemuProcessStart
qemu: Rename ret variable in qemuProcessStart
qemu: Introduce cleanup label in qemuProcessStart
qemu: Fix memory leak in qemuProcessStart
src/qemu/qemu_process.c | 215 ++++++++++++++++++++++++------------------------
1 file changed, 106 insertions(+), 109 deletions(-)
--
2.6.2
9 years
[libvirt] [PATCH v2] Remove new lines from debug messages
by Jiri Denemark
VIR_DEBUG will automatically add a new line to the message, having "\n"
at the end or at the beginning of the message results in empty lines.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
src/nwfilter/nwfilter_gentech_driver.c | 2 +-
src/nwfilter/nwfilter_learnipaddr.c | 10 +++++-----
src/rpc/virnetsocket.c | 2 +-
src/util/virfile.c | 2 +-
src/util/virhash.c | 2 +-
src/util/virnetdevmacvlan.c | 26 ++++++++++++------------
src/util/virprocess.c | 2 +-
src/xen/xend_internal.c | 2 +-
tests/virhostdevtest.c | 36 +++++++++++++++++-----------------
tests/virnetsockettest.c | 2 +-
tests/virtimetest.c | 2 +-
12 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index f05d4a8..bd6d25f 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -2017,7 +2017,7 @@ static void
virNWFilterSnoopJoinThreads(void)
{
while (virAtomicIntGet(&virNWFilterSnoopState.nThreads) != 0) {
- VIR_WARN("Waiting for snooping threads to terminate: %u\n",
+ VIR_WARN("Waiting for snooping threads to terminate: %u",
virAtomicIntGet(&virNWFilterSnoopState.nThreads));
usleep(1000 * 1000);
}
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index 701f8d8..5a4cff1 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -540,7 +540,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
if (rc)
break;
} else if (inc) {
- VIR_DEBUG("Following filter %s\n", inc->filterref);
+ VIR_DEBUG("Following filter %s", inc->filterref);
obj = virNWFilterObjFindByName(&driver->nwfilters, inc->filterref);
if (obj) {
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 5b55055..1adbadb 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -413,7 +413,7 @@ learnIPAddressThread(void *arg)
handle = pcap_open_live(listen_if, BUFSIZ, 0, PKT_TIMEOUT_MS, errbuf);
if (handle == NULL) {
- VIR_DEBUG("Couldn't open device %s: %s\n", listen_if, errbuf);
+ VIR_DEBUG("Couldn't open device %s: %s", listen_if, errbuf);
req->status = ENODEV;
goto done;
}
@@ -448,13 +448,13 @@ learnIPAddressThread(void *arg)
filter = virBufferContentAndReset(&buf);
if (pcap_compile(handle, &fp, filter, 1, 0) != 0) {
- VIR_DEBUG("Couldn't compile filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't compile filter '%s'", filter);
req->status = EINVAL;
goto done;
}
if (pcap_setfilter(handle, &fp) != 0) {
- VIR_DEBUG("Couldn't set filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't set filter '%s'", filter);
req->status = EINVAL;
pcap_freecode(&fp);
goto done;
@@ -626,7 +626,7 @@ learnIPAddressThread(void *arg)
req->filtername,
req->filterparams);
VIR_DEBUG("Result from applying firewall rules on "
- "%s with IP addr %s : %d\n", req->ifname, inetaddr, ret);
+ "%s with IP addr %s : %d", req->ifname, inetaddr, ret);
}
} else {
if (showError)
@@ -638,7 +638,7 @@ learnIPAddressThread(void *arg)
techdriver->applyDropAllRules(req->ifname);
}
- VIR_DEBUG("pcap thread terminating for interface %s\n", req->ifname);
+ VIR_DEBUG("pcap thread terminating for interface %s", req->ifname);
virNWFilterUnlockIface(req->ifname);
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 5e5f1ab..526d291 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -196,7 +196,7 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
freeaddrinfo(ai);
- VIR_DEBUG("Protocols: v4 %d v6 %d\n", *hasIPv4, *hasIPv6);
+ VIR_DEBUG("Protocols: v4 %d v6 %d", *hasIPv4, *hasIPv6);
ret = 0;
cleanup:
diff --git a/src/util/virfile.c b/src/util/virfile.c
index e5cf2c5..f45e18f 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -681,7 +681,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0)
return -1;
- VIR_DEBUG("Return from loop-control got fd %d\n", loop_fd);
+ VIR_DEBUG("Return from loop-control got fd %d", loop_fd);
if (loop_fd >= 0)
return loop_fd;
diff --git a/src/util/virhash.c b/src/util/virhash.c
index bc90c44..fab621b 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -287,7 +287,7 @@ virHashGrow(virHashTablePtr table, size_t size)
VIR_FREE(oldtable);
#ifdef DEBUG_GROW
- VIR_DEBUG("virHashGrow : from %d to %d, %ld elems\n", oldsize,
+ VIR_DEBUG("virHashGrow : from %d to %d, %ld elems", oldsize,
size, nbElem);
#endif
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 89985b8..de345e6 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -473,16 +473,16 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
case RTM_DELLINK:
case RTM_SETLINK:
case RTM_GETLINK:
- VIR_DEBUG(" IFINFOMSG\n");
- VIR_DEBUG(" ifi_family = 0x%02x\n",
+ VIR_DEBUG(" IFINFOMSG");
+ VIR_DEBUG(" ifi_family = 0x%02x",
((struct ifinfomsg *)data)->ifi_family);
- VIR_DEBUG(" ifi_type = 0x%x\n",
+ VIR_DEBUG(" ifi_type = 0x%x",
((struct ifinfomsg *)data)->ifi_type);
- VIR_DEBUG(" ifi_index = %i\n",
+ VIR_DEBUG(" ifi_index = %i",
((struct ifinfomsg *)data)->ifi_index);
- VIR_DEBUG(" ifi_flags = 0x%04x\n",
+ VIR_DEBUG(" ifi_flags = 0x%04x",
((struct ifinfomsg *)data)->ifi_flags);
- VIR_DEBUG(" ifi_change = 0x%04x\n",
+ VIR_DEBUG(" ifi_change = 0x%04x",
((struct ifinfomsg *)data)->ifi_change);
}
/* DEBUG end */
@@ -544,23 +544,23 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
if (tb[IFLA_IFNAME]) {
ifname = (char *)RTA_DATA(tb[IFLA_IFNAME]);
- VIR_DEBUG("IFLA_IFNAME = %s\n", ifname);
+ VIR_DEBUG("IFLA_IFNAME = %s", ifname);
}
if (tb[IFLA_OPERSTATE]) {
rem = *(unsigned short *)RTA_DATA(tb[IFLA_OPERSTATE]);
- VIR_DEBUG("IFLA_OPERSTATE = %d\n", rem);
+ VIR_DEBUG("IFLA_OPERSTATE = %d", rem);
}
if (tb[IFLA_VF_PORTS]) {
struct nlattr *tb_vf_ports;
- VIR_DEBUG("found IFLA_VF_PORTS\n");
+ VIR_DEBUG("found IFLA_VF_PORTS");
nla_for_each_nested(tb_vf_ports, tb[IFLA_VF_PORTS], rem) {
- VIR_DEBUG("iterating\n");
+ VIR_DEBUG("iterating");
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
- VIR_DEBUG("not a IFLA_VF_PORT. skipping\n");
+ VIR_DEBUG("not a IFLA_VF_PORT. skipping");
continue;
}
if (nla_parse_nested(tb3, IFLA_PORT_MAX, tb_vf_ports,
@@ -600,7 +600,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
uuid = (unsigned char *)
RTA_DATA(tb3[IFLA_PORT_INSTANCE_UUID]);
instance2str(uuid, instance, sizeof(instance));
- VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s\n",
+ VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s",
instance);
}
@@ -615,7 +615,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
}
if (tb3[IFLA_PORT_RESPONSE]) {
- VIR_DEBUG("IFLA_PORT_RESPONSE = %d\n", *(uint16_t *)
+ VIR_DEBUG("IFLA_PORT_RESPONSE = %d", *(uint16_t *)
RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
}
}
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 43118f8..103c114 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -407,7 +407,7 @@ virProcessKillPainfully(pid_t pid, bool force)
int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
{
size_t i;
- VIR_DEBUG("Set process affinity on %lld\n", (long long)pid);
+ VIR_DEBUG("Set process affinity on %lld", (long long)pid);
# ifdef CPU_ALLOC
/* New method dynamically allocates cpu mask, allowing unlimted cpus */
int numcpus = 1024;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 62ce930..21d99e3 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -507,7 +507,7 @@ xend_op_ext(virConnectPtr xend, const char *path, const char *key, va_list ap)
return -1;
content = virBufferContentAndReset(&buf);
- VIR_DEBUG("xend op: %s\n", content);
+ VIR_DEBUG("xend op: %s", content);
ret = http2unix(xend_post(xend, path, content));
VIR_FREE(content);
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 065b825..faebdd4 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -169,14 +169,14 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
NULL, 0, 0) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
/* Test unmanaged hostdevs */
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -186,21 +186,21 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -223,7 +223,7 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != false) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
@@ -231,11 +231,11 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -261,7 +261,7 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -269,19 +269,19 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -303,18 +303,18 @@ testVirHostdevReAttachPCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != true) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -392,13 +392,13 @@ testVirHostdevUpdateActivePCIHostdevs(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, NULL, 0,
drv_name, dom_name) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, hostdevs, nhostdevs,
drv_name, dom_name) < 0)
goto cleanup;
@@ -432,7 +432,7 @@ mymain(void)
# define DO_TEST(fnc) \
do { \
- VIR_DEBUG("\nTesting: %s", #fnc); \
+ VIR_DEBUG("Testing: %s", #fnc); \
if (virtTestRun(#fnc, fnc, NULL) < 0) \
ret = -1; \
} while (0)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index ce9eeab..5786870 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -105,7 +105,7 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
break;
}
- VIR_DEBUG("Choose port %d\n", *freePort);
+ VIR_DEBUG("Choose port %d", *freePort);
ret = 0;
diff --git a/tests/virtimetest.c b/tests/virtimetest.c
index 9ab38ae..49040d3 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -92,7 +92,7 @@ testTimeLocalOffset(const void *args)
return -1;
if (data->offset != actual) {
- VIR_DEBUG("Expect Offset %ld got %ld\n",
+ VIR_DEBUG("Expect Offset %ld got %ld",
data->offset, actual);
return -1;
}
--
2.6.2
9 years
[libvirt] [PATCH] Revert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl"
by Daniel P. Berrange
This reverts commit 6f2a0198e913c91a2ef8b99db79b7d3cc5396957.
This commit removed error reporting from virNetDevSendEthtoolIoctl
pushing responsibility onto the callers. This is wrong, however,
since virNetDevSendEthtoolIoctl calls virNetDevSetupControl
which can still report errors. So as a result virNetDevSendEthtoolIoctl
may or may not report errors depending on which bit of it fails, and as
a result callers now overwrite some errors.
It also introduced a regression causing unprivileged libvirtd to
spew error messages to the console due to inability to query the
NIC features, an error which was previously ignored.
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
Looking back at the original posting I see no explanation of why
thsi refactoring was needed, so reverting the clearly broken
error reporting logic looks like the best option.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/util/virnetdev.c | 56 +++++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 16 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 9789e93..657df3a 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -3145,15 +3145,39 @@ static int
virNetDevSendEthtoolIoctl(const char *ifname, void *cmd)
{
int ret = -1;
- int fd;
- struct ifreq ifr;
+ int sock = -1;
+ virIfreq ifr;
- if ((fd = virNetDevSetupControl(ifname, &ifr)) < 0)
- return ret;
+ sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
+ if (sock < 0) {
+ virReportSystemError(errno, "%s", _("Cannot open control socket"));
+ goto cleanup;
+ }
+
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, ifname);
ifr.ifr_data = cmd;
- ret = ioctl(fd, SIOCETHTOOL, &ifr);
+ ret = ioctl(sock, SIOCETHTOOL, &ifr);
+ if (ret != 0) {
+ switch (errno) {
+ case EPERM:
+ VIR_DEBUG("ethtool ioctl: permission denied");
+ break;
+ case EINVAL:
+ VIR_DEBUG("ethtool ioctl: invalid request");
+ break;
+ case EOPNOTSUPP:
+ VIR_DEBUG("ethtool ioctl: request not supported");
+ break;
+ default:
+ virReportSystemError(errno, "%s", _("ethtool ioctl error"));
+ goto cleanup;
+ }
+ }
- VIR_FORCE_CLOSE(fd);
+ cleanup:
+ if (sock)
+ VIR_FORCE_CLOSE(sock);
return ret;
}
@@ -3170,12 +3194,12 @@ virNetDevSendEthtoolIoctl(const char *ifname, void *cmd)
static int
virNetDevFeatureAvailable(const char *ifname, struct ethtool_value *cmd)
{
+ int ret = -1;
+
cmd = (void*)cmd;
- if (virNetDevSendEthtoolIoctl(ifname, cmd) < 0) {
- virReportSystemError(errno, _("Cannot get device %s flags"), ifname);
- return -1;
- }
- return cmd->data > 0 ? 1 : 0;
+ if (!virNetDevSendEthtoolIoctl(ifname, cmd))
+ ret = cmd->data > 0 ? 1 : 0;
+ return ret;
}
@@ -3192,12 +3216,12 @@ virNetDevFeatureAvailable(const char *ifname, struct ethtool_value *cmd)
static int
virNetDevGFeatureAvailable(const char *ifname, struct ethtool_gfeatures *cmd)
{
+ int ret = -1;
+
cmd = (void*)cmd;
- if (virNetDevSendEthtoolIoctl(ifname, cmd) < 0) {
- virReportSystemError(errno, _("Cannot get device %s generic features"), ifname);
- return -1;
- }
- return FEATURE_BIT_IS_SET(cmd->features, TX_UDP_TNL, active);
+ if (!virNetDevSendEthtoolIoctl(ifname, cmd))
+ ret = FEATURE_BIT_IS_SET(cmd->features, TX_UDP_TNL, active);
+ return ret;
}
# endif
--
2.5.0
9 years