Commit Graph

30628 Commits

Author SHA1 Message Date
Bing Niu
f7c7f8ea65 util: Rename some functions of virresctrl
Some functions in virresctrl are for CAT only, while some of other
functions are for resource allocation, not just CAT. So change
their names to reflect the reality.

Signed-off-by: Bing Niu <bing.niu@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-08-13 14:19:41 -04:00
Sukrit Bhatnagar
1077b46de6 util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:59 +02:00
Sukrit Bhatnagar
85e04482a8 util: netdevip: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:59 +02:00
Sukrit Bhatnagar
5266bb9165 util: netdevbridge: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:58 +02:00
Sukrit Bhatnagar
3a90015238 util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:57 +02:00
Sukrit Bhatnagar
5392743c10 util: netlink: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:56 +02:00
Sukrit Bhatnagar
b16e623b27 util: netlink: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:55 +02:00
Sukrit Bhatnagar
f7d0663d49 util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

This commit also typedefs virNetlinkMsg to struct nl_msg type for use
with the cleanup macros.

When a variable of type virNetlinkMsg * is declared using VIR_AUTOPTR,
the function nlmsg_free will be run automatically on it when it
goes out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:53 +02:00
Sukrit Bhatnagar
cbc1326b21 util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types
Add another usage for VIR_AUTOFREE macro which was left in the
commit ec3e878, thereby dropping a VIR_FREE call and and a cleanup
section.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 20:03:51 +02:00
Cole Robinson
34a6962c41 spec: Add libvirt-daemon-driver-storage-iscsi-direct
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-08-13 11:43:56 -04:00
Michal Privoznik
9eae8398ed qemu: Prefer nvdimmPath over hugepages for memory-backend-file
If a domain has hugepages configured and we're currently building
memory-backend-file for a nvdimm device that domain has we will
put hugepages path onto the command line. It should have been
nvdimm path configured in the XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 16:33:45 +02:00
Pavel Hrdina
baebd9f3d8 vircgroup: fix MinGW build
Broken by commit <901d2b9c87>.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 16:14:23 +02:00
Marcos Paulo de Souza
242b7c2d38 esx: Fix nodeGetInfo so cpu model fits inside nodeinfo->model
Commit 6c0d0210cb changed the behavior of
virStr*cpy* functions, so now the nodeGetInfo call fails. Version 4.1.0
(default for Fedora 28) works:

Model: Intel Core i7-4500U CPU @ 1.80G

Current master tries to write "Intel Core i7-4500U CPU @ 1.80GHz", but
the string is bigger than nodeinfo->model (which is a char[32]). So this
patch "cuts" the string, and presents the same output from 4.1.0.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2018-08-13 16:03:18 +02:00
Ján Tomko
86db0db979 Revert "build: add --with-jansson"
This reverts commit 12b34f094e.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Conflicts:
  configure.ac:
    Commit 8aa85e0b introduced LIBVIRT_*_LIBISCSI macros.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
074a7e1478 Revert "build: undef WITH_JANSSON for SETUID_RPC_CLIENT"
This reverts commit 93fdc9e0b0.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
d99a89592d Revert "Switch from yajl to Jansson"
This reverts commit 9cf38263d0.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
e96e71d8d0 Revert "Remove functions using yajl"
This reverts commit bf114decb3.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
8687eba5ca Revert "build: remove references to WITH_YAJL for SETUID_RPC_CLIENT"
This reverts commit 1caf844160.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
63f6e0e950 Revert "Remove virJSONValueNewStringLen"
This reverts commit 8f802c6d86.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
5a58b5ed68 Revert "build: switch --with-qemu default from yes to check"
This reverts commit c5ae8e0c2b.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
f204cf5103 Revert "build: require Jansson if QEMU driver is enabled"
This reverts commit 01ce04375c.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:01 +02:00
Ján Tomko
6f99de3148 Revert "m4: Introduce STABLE_ORDERING_JANSSON"
This reverts commit 4dd6054000.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
8e373e6d80 Revert "tests: also skip qemuagenttest with old jansson"
This reverts commit c31146685f.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
6c3d66ac74 Revert "util: avoid symbol clash between json libraries"
This reverts commit ce3c6ef684.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
b56950fd27 Revert "tests: qemucapsprobe: Fix output after switching to jansson"
This reverts commit 397447f805.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
54f2b5e330 Revert "util: jsoncompat: Stub out virJSONInitialize when compiling without jansson"
This reverts commit 9e44c2db8a.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
9ed59012d3 Revert "remote: daemon: Make sure that JSON symbols are properly loaded at startup"
This reverts commit 3251fc9c9b.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
44ef7d9e01 Revert "Fix link errors in tools/nss and tests"
This reverts commit b3d9b08ef7.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Ján Tomko
9c3dad5677 Revert "src: Move DLOPEN_LIBS to libraries introducing the dependency"
This reverts commit 5d40272ea6.

Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.

https://bugzilla.redhat.com/show_bug.cgi?id=1614569

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-13 15:50:00 +02:00
Michal Privoznik
b88fce05ff networkStartNetworkVirtual: Don't leak macmap object
When starting network a macmap object is created (which stores
MAC -> domain name mappings). However, if something goes wrong
(e.g. virNetDevIPCheckIPv6Forwarding() fails) then the object is
leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 12:32:02 +02:00
Michal Privoznik
e101960761 virnetdevip: Free data.devices in virNetDevIPCheckIPv6Forwarding() too
We are freeing the individual strings (which were filled by
virNetDevIPCheckIPv6ForwardingCallback()) but not the array
itself.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-13 12:32:02 +02:00
Pavel Hrdina
e634c7cd0d lxc: Use virCgroupGetMemoryStat
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
901d2b9c87 vircgroup: Introduce virCgroupGetMemoryStat
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
db868852fd vircgroup: Remove virCgroupAddTaskController
There is no need for this function, both of the checks are done
later by virCgroupGetControllerPath.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
f9d18f89f7 vircgroup: machinename will never be NULL
Commit <eaf2c9f89107b9f60cf8db2c919f78b987ff7177> moved machineName
generation before virCgroupNewDetectMachine() is called.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
fc221c053b vircgroup: Introduce virCgroupEnableMissingControllers
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
801d95d259 vircgroup: Use virCgroupMountOptsMatchController in virCgroupDetectPlacement
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
6d5b91f0f5 vircgroup: Extract mount options matching into function
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
0490a74aa1 vircgroup: Remove pointless bool parameter
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
8ea2d5a6cb vircgroup: Move function used in tests into vircgrouppriv.h
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
32686849fc vircgroup: Unexport unused function virCgroupRemoveRecursively
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
0aaac42a6e vircgroup: Unexport unused function virCgroupAddTaskController()
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
c8b1ae607d vircgroup: Remove unused function virCgroupKill()
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
00a0085aa1 vircgroup: Extract file link resolving into separate function
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
cd77242504 vircgroup: Introduce standard set of typedefs and use them
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
70dc671a27 vircgroup: Rename structs to start with underscore
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
7966414194 docs: Update how we create cgroup directory names
Commit <c3bd0019c0> changed the way how cgroup directory names are
constructed but the documentation was not updated.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Pavel Hrdina
9c29690478 docs: List cpuacct in controllers used by QEMU driver
The cpuacct controller is used to get cpu stats.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-08-13 11:53:53 +02:00
Jiri Denemark
dddcb601eb qemu_migration: Avoid writing to freed memory
When a domain is killed on the source host while it is being migrated
and libvirtd is waiting for the migration to finish (waiting for the
domain condition in qemuMigrationSrcWaitForCompletion), the run-time
state including priv->job.current may already be freed once
virDomainObjWait returns with -1. Thus the priv->job.current pointer
cached in jobInfo is no longer valid and setting jobInfo->status may
crash the daemon.

https://bugzilla.redhat.com/show_bug.cgi?id=1593137

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-13 11:29:09 +02:00
Clementine Hayat
e41bfae562 storage: add wipeVol to iscsi-direct storage backend
Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-13 08:44:34 +02:00