[libvirt] [PATCH] qemu: fix crash on getting block stats for empty cdrom
by Nikolay Shirokovskiy
Looks like it was introduced in c5f61513. Before this commit handling empty cdrom
was correct becase physical sizes of non block disks are not updated.
Now when all types are supported we need to check for empty drives.
[1] crash backtrace
0 __strrchr_sse42 () at ../sysdeps/x86_64/multiarch/strrchr.S:138
1 0x00007ffff7242192 in virFileIsSharedFSType (path=0x0, fstypes=63) at util/virfile.c:3351
2 0x00007ffff7242a5b in virFileIsSharedFS (path=0x0) at util/virfile.c:3557
3 0x00007fffdb835443 in qemuOpenFileAs (fallback_uid=0, fallback_gid=107, dynamicOwnership=true, path=0x0,
oflags=0, needUnlink=0x0, bypassSecurityDriver=0x0) at qemu/qemu_driver.c:2927
4 0x00007fffdb83539b in qemuOpenFile (driver=0x7fffcc1062f0, vm=0x7fffcc25aa50, path=0x0, oflags=0,
needUnlink=0x0, bypassSecurityDriver=0x0) at qemu/qemu_driver.c:2908
5 0x00007fffdb84d2d3 in qemuDomainStorageOpenStat (driver=0x7fffcc1062f0, cfg=0x7fffcc188880, vm=0x7fffcc25aa50,
src=0x7fffcc256920, ret_fd=0x7fffe6a49488, ret_sb=0x7fffe6a49490) at qemu/qemu_driver.c:11266
6 0x00007fffdb84d4ff in qemuDomainStorageUpdatePhysical (driver=0x7fffcc1062f0, cfg=0x7fffcc188880,
vm=0x7fffcc25aa50, src=0x7fffcc256920) at qemu/qemu_driver.c:11319
7 0x00007fffdb8661e7 in qemuDomainGetStatsOneBlock (driver=0x7fffcc1062f0, cfg=0x7fffcc188880, dom=0x7fffcc25aa50,
record=0x7fffa8000e70, maxparams=0x7fffe6a49790, disk=0x7fffcc2565a0, src=0x7fffcc256920, block_idx=7,
backing_idx=0, stats=0x7fffa8000e90) at qemu/qemu_driver.c:19223
8 0x00007fffdb86652b in qemuDomainGetStatsBlock (driver=0x7fffcc1062f0, dom=0x7fffcc25aa50, record=0x7fffa8000e70,
maxparams=0x7fffe6a49790, privflags=1) at qemu/qemu_driver.c:19282
9 0x00007fffdb8669f7 in qemuDomainGetStats (conn=0x7fffb80009a0, dom=0x7fffcc25aa50, stats=127,
record=0x7fffe6a49870, flags=1) at qemu/qemu_driver.c:19444
10 0x00007fffdb866dc8 in qemuConnectGetAllDomainStats (conn=0x7fffb80009a0, doms=0x0, ndoms=0, stats=127,
retStats=0x7fffe6a499a0, flags=1) at qemu/qemu_driver.c:19534
11 0x00007ffff7388376 in virConnectGetAllDomainStats (conn=0x7fffb80009a0, stats=0, retStats=0x7fffe6a499a0,
flags=1) at libvirt-domain.c:11311
---
src/qemu/qemu_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bc5e448..16b435a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19170,6 +19170,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx,
disk->dst);
+
if (virStorageSourceIsLocalStorage(src) && src->path)
QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path",
block_idx, src->path);
@@ -19216,7 +19217,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
if (entry->capacity)
QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx,
"capacity", entry->capacity);
- if (entry->physical) {
+ if (entry->physical || virStorageSourceIsEmpty(src)) {
QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx,
"physical", entry->physical);
} else {
--
1.8.3.1
7 years, 7 months
Re: [libvirt] Determining domain job kind from job stats?
by Milan Zamazal
[Starting to move to the development list.]
Milan Zamazal <mzamazal(a)redhat.com> writes:
> Jiri Denemark <jdenemar(a)redhat.com> writes:
>
>> On Fri, Feb 17, 2017 at 12:38:24 +0100, Milan Zamazal wrote:
>>>
>>> There are basically two problems:
>>>
>>> - When the job completion callback is called, I need to distinguish what
>>> kind of job was it to perform the appropriate actions. It would be
>>> easier if I knew the job type directly in the callback (no need to
>>> coordinate anything), but "external" job tracking is also possible.
>>
>> An immediate answer would be: "don't rely on the completion callback and
>> just check the return value of the API which started the job", but I
>> guess you want it because checking the return value is not possible when
>> the process which started the job is not running anymore as described
>> below.
>
> Well, avoiding using the completion callback is probably OK for me.
Thinking about it more, it's not very nice: I have to use the callback
to get the completed job stats (I'm not guaranteed the domain still
exists on the source host when I ask it for the stats explicitly) *and*
to track the jobs outside the callback to know whether the callback is
related to the type of domain jobs I'm going to handle.
Although not absolutely necessary, it would be much nicer if the job
type was identified in the callback.
> (In case of the process restart, I don't expect having everything
> perfectly working, just some basic sanity.)
>
>>> - If I lost track of my jobs (e.g. because of a crash and restart), I'd
>>> like to find out whether a given VM is migrating. Examining the job
>>> looked like a good candidate to get the information, but apparently
>>> it's not. Again, I can probably arrange things to handle that, but to
>>> get the information directly from libvirt (not necessarily via job
>>> info) would be easier and more reliable.
>>
>> Apparently you are talking about peer-to-peer migration,
>
> Yes.
>
>> otherwise the migration would be automatically canceled when the
>> process which started it disappears. I'm afraid this is not currently
>> possible in general. You might be able to get something by checking
>> the domain's status, but it won't work in all cases.
>
> Too bad. Could some future libvirt version provide that information?
If libvirt provided information about the job type, it would help with
several things, for instance: With the callback problem above, with
using libvirt as the ultimate single source of information about the
VMs, or with handling VMs not running under complete control of a
particular piece of software.
If some piece of information about a VM is missing from libvirt I need
to store it somewhere. Domain metadata is a natural place for that,
since it's closely bound to the corresponding VM and keeps libvirt as
the ultimate single source of information. But putting there
information about migration is weird at best.
Based on those thoughts I think libvirt should really provide a simple
way to find out whether the VM is migrating to another host and to
identify the domain job type in the job completed callback. Is there
anything preventing to add that information?
Thanks,
Milan
7 years, 7 months
[libvirt] [PATCH v4 00/14] Introduce vGPU mdev framework to libvirt
by Erik Skultety
since v1:
- new <hostdev> attribute model introduced which tells libvirt which device API
should be considered when auto-assigning guest address
- device_api is properly checked, thus taking the 'model' attribute only as a
hint to assign "some" address
- new address type 'mdev' is introduced rather than using plain <uuid> element,
since the address element is more conveniently extendable.
- the emulated mtty driver now works as well out of the box, so no HW needed to
review this series --> let's try it :)
- fixed all the nits from v1
since v2:
- dropped the patch introducing new address type 'mdev' since I added by
mistake and only after that realized that the device address type enum is used
for guest addresses only
--> the mdevs are still identified by address element containing an 'uuid'
attribute, I just dropped the enum
- resolved the driver hostdev list race condition raised by Pavel in his review
--> the device API is now checked every time our internal mdev object is
created as opposed to the previous version where because of the model being
checked separately, the locking issues arose.
- rewrote the docs, reflecting the mdev address type drop change
- squashed all security related stuff into 1 patch, also added app-armor bits
- as Pavel suggested, moved most of the mdev-related functions out of
virhostdev.c to virmdev.c
- added a few more test cases
- created a new branch 'mdev-next' on my github (more suitable name than a
strict version number) on https://github.com/eskultety/libvirt/commits/mdev-next
since v3:
- 'undo' an accidental squash of virmdev.{c,h} module introduction into patch
4/15 and made it a separate patch again
- squash 5/15 into 4/15 as Pavel suggested
- dropped the NEWS patch, as I've so far got at least 4 merge conflicts because
of it when rebasing...I'll add it before the series is ready to be
merged...or I'll forget about it like I usually do and add it later :/
Erik
Erik Skultety (14):
conf: hostdev: Enforce enum-in-switch compile-time checks
conf: hostdev: Introduce virDomainHostdevSubsysSCSIClear
conf: Introduce virDomainHostdevDefPostParse
util: Introduce new module virmdev
conf: Introduce new hostdev device type mdev
security: Enable labeling of vfio mediated devices
conf: Enable cold-plug of a mediated device
qemu: Assign PCI addresses for mediated devices as well
hostdev: Maintain a driver list of active mediated devices
qemu: cgroup: Adjust cgroups' logic to allow mediated devices
qemu: Bump the memory locking limit for mdevs as well
qemu: Format mdevs on qemu command line
test: Add some test cases for our test suite regarding the mdevs
docs: Document the new hostdev and address type 'mdev'
docs/formatdomain.html.in | 46 +-
docs/schemas/domaincommon.rng | 22 +
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 225 ++++++++--
src/conf/domain_conf.h | 9 +
src/libvirt_private.syms | 25 ++
src/qemu/qemu_command.c | 45 ++
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_domain.c | 24 +-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_domain_address.c | 14 +-
src/qemu/qemu_hostdev.c | 56 +++
src/qemu/qemu_hostdev.h | 10 +
src/qemu/qemu_hotplug.c | 2 +
src/security/security_apparmor.c | 22 +
src/security/security_dac.c | 43 ++
src/security/security_selinux.c | 45 ++
src/util/virhostdev.c | 165 ++++++-
src/util/virhostdev.h | 23 +
src/util/virmdev.c | 487 +++++++++++++++++++++
src/util/virmdev.h | 123 ++++++
tests/domaincapsschemadata/full.xml | 1 +
...ml2argv-hostdev-mdev-invalid-target-address.xml | 33 ++
...muxml2argv-hostdev-mdev-src-address-invalid.xml | 35 ++
.../qemuxml2argv-hostdev-mdev-unmanaged.args | 25 ++
.../qemuxml2argv-hostdev-mdev-unmanaged.xml | 35 ++
tests/qemuxml2argvtest.c | 9 +
.../qemuxml2xmlout-hostdev-mdev-unmanaged.xml | 40 ++
tests/qemuxml2xmltest.c | 1 +
30 files changed, 1518 insertions(+), 55 deletions(-)
create mode 100644 src/util/virmdev.c
create mode 100644 src/util/virmdev.h
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-invalid-target-address.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-src-address-invalid.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-unmanaged.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-unmanaged.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-mdev-unmanaged.xml
--
2.12.1
7 years, 7 months
[libvirt] [PATCH 0/7] qemu: Use migratable host CPU model from QEMU
by Jiri Denemark
Current libvirt makes a migratable host CPU model by removing features
marked in cpu_map.xml with migratable='no'. This is not ideal because
cpu_map.xml is a static database while feature migrtability may differ
depending on a hypervisor or its version. Thus we should preferably use
the data we got from QEMU.
Jiri Denemark (7):
cpu: Introduce virCPUCopyMigratable
qemu: Move common code in virQEMUCapsInitCPUModel one layer up
qemu: Add migratable parameter to virQEMUCapsInitCPUModel
qemu: Move qemuCaps->{kvm,tcg}CPUModel into a struct
qemu: Store migratable host CPU model in qemuCaps
qemu: Pass migratable host model to virCPUUpdate
cpu: Drop feature filtering from virCPUUpdate
src/cpu/cpu.c | 29 +++++++
src/cpu/cpu.h | 8 ++
src/cpu/cpu_x86.c | 34 ++++++--
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 200 ++++++++++++++++++++++++++++++-------------
src/qemu/qemu_capabilities.h | 3 +-
src/qemu/qemu_capspriv.h | 3 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_process.c | 4 +-
tests/cputest.c | 9 +-
10 files changed, 221 insertions(+), 72 deletions(-)
--
2.12.0
7 years, 7 months
[libvirt] [PATCH (RFC?)] Remove usage of __attribute__((nonnull))
by Martin Kletzander
The attribute (defined as ATTRIBUTE_NONNULL) was added long time
ago (2009), but in 2012 (commit eefb881d4683) it was disabled for
normal build, making it used only when coverity was building libvirt
or on special request. It was disabled because it was being misused
and misunderstood -- the attribute is there as an optimization hint
for the compiler, not to enhance static analysis.
However, it is used until today in many places and since it is
disabled by default, it just screws up builds with STATIC_ANALYSIS
enabled.
Remove that attribute and all its usages.
Moreover lv_cv_static_analysis should not be used after this patch as
it does not have any other effect than just disabling one check in
domain_conf.c. That check is there for developers to make sure no
device is forgotten, which for coverity is just a dead code.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Sorry for long mail, but I figured it's not worth splitting this.
daemon/libvirtd.c | 2 +-
src/bhyve/bhyve_device.h | 3 +-
src/bhyve/bhyve_driver.c | 2 +-
src/conf/cpu_conf.c | 4 +-
src/conf/cpu_conf.h | 9 ++-
src/conf/domain_addr.c | 4 +-
src/conf/domain_addr.h | 96 ++++++++++------------------
src/conf/domain_audit.h | 60 ++++++------------
src/conf/domain_conf.c | 4 +-
src/conf/domain_conf.h | 58 +++++++----------
src/conf/domain_event.h | 24 +++----
src/conf/netdev_bandwidth_conf.h | 5 +-
src/conf/network_event.h | 8 +--
src/conf/node_device_event.h | 8 +--
src/conf/numa_conf.h | 24 +++----
src/conf/object_event.c | 2 +-
src/conf/object_event.h | 15 ++---
src/conf/object_event_private.h | 12 +---
src/conf/secret_event.h | 8 +--
src/conf/storage_event.h | 8 +--
src/conf/virnodedeviceobj.h | 3 +-
src/cpu/cpu.h | 36 ++++-------
src/interface/interface_backend_netcf.c | 2 +-
src/interface/interface_backend_udev.c | 18 ++----
src/internal.h | 21 -------
src/libxl/libxl_domain.h | 3 +-
src/network/bridge_driver.c | 2 +-
src/network/bridge_driver.h | 21 +++----
src/phyp/phyp_driver.c | 8 ---
src/qemu/qemu_alias.h | 6 +-
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_capabilities.h | 6 +-
src/qemu/qemu_command.h | 12 ++--
src/qemu/qemu_conf.h | 15 ++---
src/qemu/qemu_domain.c | 4 +-
src/qemu/qemu_domain.h | 95 +++++++++-------------------
src/qemu/qemu_domain_address.h | 9 +--
src/qemu/qemu_driver.c | 8 +--
src/qemu/qemu_interface.h | 3 +-
src/qemu/qemu_migration.h | 19 +++---
src/qemu/qemu_monitor.h | 63 +++++++------------
src/qemu/qemu_monitor_json.h | 107 +++++++++++---------------------
src/rpc/virkeepalive.h | 4 +-
src/rpc/virnetclientstream.h | 3 +-
src/rpc/virnetmessage.h | 23 +++----
src/secret/secret_util.h | 3 +-
src/security/security_dac.c | 4 --
src/storage/storage_driver.h | 11 ++--
src/storage/storage_util.c | 2 +-
src/storage/storage_util.h | 3 +-
src/util/viralloc.h | 25 ++++----
src/util/viratomic.h | 27 +++-----
src/util/virbitmap.h | 63 +++++++------------
src/util/virbuffer.h | 2 +-
src/util/vircgroup.h | 22 +++----
src/util/vircommand.h | 44 +++++++------
src/util/vircrypto.h | 4 +-
src/util/virfile.h | 62 +++++++++---------
src/util/virfirewall.h | 8 +--
src/util/virfirmware.h | 6 +-
src/util/virhostcpu.c | 4 --
src/util/virhostdev.h | 67 +++++++-------------
src/util/viridentity.h | 12 +---
src/util/viriscsi.h | 13 ++--
src/util/virjson.h | 16 ++---
src/util/virkeyfile.h | 13 ++--
src/util/virkmod.h | 9 +--
src/util/virlog.h | 14 ++---
src/util/virmacaddr.h | 2 +-
src/util/virnetdev.h | 75 ++++++++++------------
src/util/virnetdevbandwidth.c | 2 +-
src/util/virnetdevbandwidth.h | 8 +--
src/util/virnetdevbridge.h | 30 +++++----
src/util/virnetdevip.h | 10 ++-
src/util/virnetdevmacvlan.h | 29 ++++-----
src/util/virnetdevmidonet.h | 4 +-
src/util/virnetdevopenvswitch.h | 11 ++--
src/util/virnetdevtap.h | 12 ++--
src/util/virnetdevveth.h | 4 +-
src/util/virnetdevvportprofile.h | 4 +-
src/util/virnuma.h | 3 +-
src/util/virobject.h | 27 +++-----
src/util/virpci.h | 2 +-
src/util/virpidfile.h | 2 +-
src/util/virqemu.h | 3 +-
src/util/virrandom.h | 2 +-
src/util/virscsihost.h | 3 +-
src/util/virseclabel.h | 3 +-
src/util/virsocketaddr.h | 3 +-
src/util/virstorageencryption.h | 3 +-
src/util/virstoragefile.h | 27 +++-----
src/util/virstring.h | 37 +++++------
src/util/virsysinfo.h | 3 +-
src/util/virthread.h | 2 +-
src/util/virthreadpool.h | 5 +-
src/util/virtime.h | 17 +++--
src/util/viruri.h | 6 +-
src/util/virutil.h | 11 ++--
src/util/viruuid.h | 6 +-
src/util/virvhba.h | 12 ++--
src/vz/vz_utils.h | 2 +-
src/xen/xen_hypervisor.h | 33 ++++------
src/xen/xend_internal.c | 5 +-
tools/virsh-domain-monitor.h | 2 +-
tools/vsh.c | 4 +-
tools/vsh.h | 27 ++++----
106 files changed, 625 insertions(+), 1099 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 891238bcbe0d..5cd3fa4ebccb 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -410,7 +410,7 @@ static void daemonInitialize(void)
#undef VIR_DAEMON_LOAD_MODULE
-static int ATTRIBUTE_NONNULL(3)
+static int
daemonSetupNetworking(virNetServerPtr srv,
virNetServerPtr srvAdm,
struct daemonConfig *config,
diff --git a/src/bhyve/bhyve_device.h b/src/bhyve/bhyve_device.h
index 1144f51dbe94..7d834708e86b 100644
--- a/src/bhyve/bhyve_device.h
+++ b/src/bhyve/bhyve_device.h
@@ -32,7 +32,6 @@ int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, virDomainObjPtr obj);
virDomainPCIAddressSetPtr bhyveDomainPCIAddressSetCreate(virDomainDefPtr def,
unsigned int nbuses);
-int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1);
+int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj);
#endif /* __BHYVE_DEVICE_H__ */
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 74cc5ab219cc..d1ed4dea830e 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -129,7 +129,7 @@ bhyveAutostartDomains(bhyveConnPtr driver)
*
* Returns: a reference to a virCapsPtr instance or NULL
*/
-virCapsPtr ATTRIBUTE_NONNULL(1)
+virCapsPtr
bhyveDriverGetCapabilities(bhyveConnPtr driver)
{
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index b78531e60261..ce58958c9f3d 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -75,7 +75,7 @@ virCPUDefFreeFeatures(virCPUDefPtr def)
}
-void ATTRIBUTE_NONNULL(1)
+void
virCPUDefFreeModel(virCPUDefPtr def)
{
@@ -96,7 +96,7 @@ virCPUDefFree(virCPUDefPtr def)
}
-int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+int
virCPUDefCopyModel(virCPUDefPtr dst,
const virCPUDef *src,
bool resetPolicy)
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index 3e02deed4bc5..ccc334e94ea4 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -124,16 +124,16 @@ struct _virCPUDef {
};
-void ATTRIBUTE_NONNULL(1)
+void
virCPUDefFreeFeatures(virCPUDefPtr def);
-void ATTRIBUTE_NONNULL(1)
+void
virCPUDefFreeModel(virCPUDefPtr def);
void
virCPUDefFree(virCPUDefPtr def);
-int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+int
virCPUDefCopyModel(virCPUDefPtr dst,
const virCPUDef *src,
bool resetPolicy);
@@ -149,8 +149,7 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst,
const virCPUDef *src,
bool resetPolicy,
virCPUDefFeatureFilter filter,
- void *opaque)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ void *opaque);
void
virCPUDefStealModel(virCPUDefPtr dst,
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 35bdc34537e1..23b6a574d379 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -524,7 +524,7 @@ virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
* automatically created by libvirt, so it is an internal error (not
* XML).
*/
-static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+static int
virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags flags,
@@ -735,7 +735,7 @@ virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus,
}
-static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+static int
virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr next_addr,
int function,
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
index f884b8af2bb6..c705ce39c6d6 100644
--- a/src/conf/domain_addr.h
+++ b/src/conf/domain_addr.h
@@ -114,8 +114,7 @@ struct _virDomainPCIAddressSet {
typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet;
typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr;
-char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr)
- ATTRIBUTE_NONNULL(1);
+char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr);
virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses);
@@ -126,52 +125,42 @@ bool virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags busFlags,
virDomainPCIConnectFlags devFlags,
bool reportError,
- bool fromConfig)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool fromConfig);
bool virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
const char *addrStr,
virDomainPCIConnectFlags flags,
- bool fromConfig)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool fromConfig);
int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
- virDomainControllerModelPCI model)
- ATTRIBUTE_NONNULL(1);
+ virDomainControllerModelPCI model);
bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
- virPCIDeviceAddressPtr addr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virPCIDeviceAddressPtr addr);
int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
- virDomainPCIConnectFlags flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainPCIConnectFlags flags);
int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
- virDomainPCIConnectFlags flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainPCIConnectFlags flags);
int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
- virDomainPCIConnectFlags flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainPCIConnectFlags flags);
int virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
- virPCIDeviceAddressPtr addr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virPCIDeviceAddressPtr addr);
int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
virDomainPCIConnectFlags flags,
- int function)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int function);
-void virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+void virDomainPCIAddressSetAllMulti(virDomainDefPtr def);
struct _virDomainCCWAddressSet {
virHashTablePtr defined;
@@ -182,23 +171,19 @@ typedef virDomainCCWAddressSet *virDomainCCWAddressSetPtr;
int virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
virDomainCCWAddressSetPtr addrs,
- bool autoassign)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool autoassign);
void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs);
int virDomainCCWAddressAllocate(virDomainDefPtr def,
virDomainDeviceDefPtr dev,
virDomainDeviceInfoPtr info,
- void *data)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ void *data);
int virDomainCCWAddressValidate(virDomainDefPtr def,
virDomainDeviceDefPtr dev,
virDomainDeviceInfoPtr info,
- void *data)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ void *data);
int virDomainCCWAddressReleaseAddr(virDomainCCWAddressSetPtr addrs,
- virDomainDeviceInfoPtr dev)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDeviceInfoPtr dev);
virDomainCCWAddressSetPtr virDomainCCWAddressSetCreate(void);
struct _virDomainVirtioSerialController {
@@ -220,59 +205,49 @@ virDomainVirtioSerialAddrSetPtr
virDomainVirtioSerialAddrSetCreate(void);
int
virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSetPtr addrs,
- virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDefPtr def);
void
virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs);
virDomainVirtioSerialAddrSetPtr
-virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def);
bool
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info);
int
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info,
- bool allowZero)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool allowZero);
int
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
virDomainDeviceInfoPtr info,
- bool allowZero)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool allowZero);
int
virDomainVirtioSerialAddrAssign(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info,
bool allowZero,
- bool portOnly)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool portOnly);
int
virDomainVirtioSerialAddrReserve(virDomainDefPtr def,
virDomainDeviceDefPtr dev,
virDomainDeviceInfoPtr info,
- void *data)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ void *data);
int
virDomainVirtioSerialAddrRelease(virDomainVirtioSerialAddrSetPtr addrs,
- virDomainDeviceInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDeviceInfoPtr info);
bool
-virDomainUSBAddressPortIsValid(unsigned int *port)
- ATTRIBUTE_NONNULL(1);
+virDomainUSBAddressPortIsValid(unsigned int *port);
void
virDomainUSBAddressPortFormatBuf(virBufferPtr buf,
- unsigned int *port)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ unsigned int *port);
char *
-virDomainUSBAddressPortFormat(unsigned int *port)
- ATTRIBUTE_NONNULL(1);
+virDomainUSBAddressPortFormat(unsigned int *port);
# define VIR_DOMAIN_USB_HUB_PORTS 8
@@ -298,37 +273,30 @@ typedef virDomainUSBAddressSet *virDomainUSBAddressSetPtr;
virDomainUSBAddressSetPtr virDomainUSBAddressSetCreate(void);
int virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs,
- virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDefPtr def);
int
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
- virDomainHubDefPtr hub)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainHubDefPtr hub);
size_t
virDomainUSBAddressCountAllPorts(virDomainDefPtr def);
void virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs);
int
virDomainUSBAddressPresent(virDomainDeviceInfoPtr info,
- void *data)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ void *data);
int
virDomainUSBAddressReserve(virDomainDeviceInfoPtr info,
- void *data)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ void *data);
int
virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs,
- virDomainDeviceInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDeviceInfoPtr info);
int
virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs,
- virDomainDeviceInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDeviceInfoPtr info);
int
virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs,
- virDomainDeviceInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainDeviceInfoPtr info);
#endif /* __DOMAIN_ADDR_H__ */
diff --git a/src/conf/domain_audit.h b/src/conf/domain_audit.h
index 8cb585dc7d96..f01d5b8344b4 100644
--- a/src/conf/domain_audit.h
+++ b/src/conf/domain_audit.h
@@ -29,110 +29,88 @@
void virDomainAuditStart(virDomainObjPtr vm,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool success);
void virDomainAuditInit(virDomainObjPtr vm,
pid_t pid,
- ino_t pidns)
- ATTRIBUTE_NONNULL(1);
+ ino_t pidns);
void virDomainAuditStop(virDomainObjPtr vm,
- const char *reason)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *reason);
void virDomainAuditDisk(virDomainObjPtr vm,
virStorageSourcePtr oldDef,
virStorageSourcePtr newDef,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditFS(virDomainObjPtr vm,
virDomainFSDefPtr oldDef,
virDomainFSDefPtr newDef,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditNet(virDomainObjPtr vm,
virDomainNetDefPtr oldDef,
virDomainNetDefPtr newDef,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditNetDevice(virDomainDefPtr vmDef,
virDomainNetDefPtr netDef,
const char *device,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool success);
void virDomainAuditHostdev(virDomainObjPtr vm,
virDomainHostdevDefPtr def,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool success);
void virDomainAuditCgroup(virDomainObjPtr vm,
virCgroupPtr group,
const char *reason,
const char *extra,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditCgroupMajor(virDomainObjPtr vm,
virCgroupPtr group,
const char *reason,
int maj,
const char *name,
const char *perms,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6);
+ bool success);
void virDomainAuditCgroupPath(virDomainObjPtr vm,
virCgroupPtr group,
const char *reason,
const char *path,
const char *perms,
- int rc)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ int rc);
void virDomainAuditMemory(virDomainObjPtr vm,
unsigned long long oldmem,
unsigned long long newmem,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditVcpu(virDomainObjPtr vm,
unsigned int oldvcpu,
unsigned int newvcpu,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditIOThread(virDomainObjPtr vm,
unsigned int oldiothread,
unsigned int newiothread,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditSecurityLabel(virDomainObjPtr vm,
- bool success)
- ATTRIBUTE_NONNULL(1);
+ bool success);
void virDomainAuditRedirdev(virDomainObjPtr vm,
virDomainRedirdevDefPtr def,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool success);
void virDomainAuditChardev(virDomainObjPtr vm,
virDomainChrDefPtr oldDef,
virDomainChrDefPtr newDef,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditRNG(virDomainObjPtr vm,
virDomainRNGDefPtr oldDef,
virDomainRNGDefPtr newDef,
const char *reason,
- bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ bool success);
void virDomainAuditShmem(virDomainObjPtr vm,
virDomainShmemDefPtr def,
- const char *reason, bool success)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *reason, bool success);
#endif /* __VIR_DOMAIN_AUDIT_H__ */
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1b0a55b27fa9..63ba3e5bd1d1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1947,7 +1947,7 @@ virDomainNetDefFree(virDomainNetDefPtr def)
VIR_FREE(def);
}
-void ATTRIBUTE_NONNULL(1)
+void
virDomainChrSourceDefClear(virDomainChrSourceDefPtr def)
{
switch (def->type) {
@@ -5181,7 +5181,7 @@ virDomainDefValidate(virDomainDefPtr def,
/* Generate a string representation of a device address
* @info address Device address to stringify
*/
-static int ATTRIBUTE_NONNULL(2)
+static int
virDomainDeviceInfoFormat(virBufferPtr buf,
virDomainDeviceInfoPtr info,
unsigned int flags)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 47eaacef3d48..ff33a235bcc8 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2531,8 +2531,7 @@ virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr mac);
virDomainXMLNamespacePtr
-virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt)
- ATTRIBUTE_NONNULL(1);
+virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt);
int virDomainDefPostParse(virDomainDefPtr def,
virCapsPtr caps,
@@ -2565,8 +2564,7 @@ void virDomainDefVcpuOrderClear(virDomainDefPtr def);
int virDomainDefGetVcpusTopology(const virDomainDef *def,
unsigned int *maxvcpus);
-virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps)
- ATTRIBUTE_NONNULL(1);
+virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps);
void virDomainObjEndAPI(virDomainObjPtr *vm);
@@ -2651,7 +2649,7 @@ int virDomainDeviceInfoIterate(virDomainDefPtr def,
bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
virDomainDeviceInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
void virDomainDefFree(virDomainDefPtr vm);
@@ -2886,11 +2884,9 @@ int virDomainHostdevFind(virDomainDefPtr def, virDomainHostdevDefPtr match,
virDomainGraphicsListenDefPtr
virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i);
int virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
- const char *address)
- ATTRIBUTE_NONNULL(1);
+ const char *address);
int virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def,
- const char *socket)
- ATTRIBUTE_NONNULL(1);
+ const char *socket);
virDomainNetType virDomainNetGetActualType(virDomainNetDefPtr iface);
const char *virDomainNetGetActualBridgeName(virDomainNetDefPtr iface);
@@ -2921,8 +2917,7 @@ int virDomainControllerFindByPCIAddress(virDomainDefPtr def,
int virDomainControllerFindUnusedIndex(virDomainDef const *def, int type);
virDomainControllerDefPtr virDomainControllerRemove(virDomainDefPtr def, size_t i);
const char *virDomainControllerAliasFind(const virDomainDef *def,
- int type, int idx)
- ATTRIBUTE_NONNULL(1);
+ int type, int idx);
int virDomainLeaseIndex(virDomainDefPtr def,
virDomainLeaseDefPtr lease);
@@ -2942,8 +2937,7 @@ void
virDomainChrGetDomainPtrs(const virDomainDef *vmdef,
virDomainChrDeviceType type,
const virDomainChrDef ***arrPtr,
- size_t *cntPtr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ size_t *cntPtr);
virDomainChrDefPtr
virDomainChrFind(virDomainDefPtr def,
virDomainChrDefPtr target);
@@ -3040,11 +3034,9 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
void *opaque);
void
-virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason)
- ATTRIBUTE_NONNULL(1);
+virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason);
virDomainState
-virDomainObjGetState(virDomainObjPtr obj, int *reason)
- ATTRIBUTE_NONNULL(1);
+virDomainObjGetState(virDomainObjPtr obj, int *reason);
virSecurityLabelDefPtr
virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model);
@@ -3056,23 +3048,21 @@ typedef const char* (*virEventActionToStringFunc)(int type);
typedef int (*virEventActionFromStringFunc)(const char *type);
int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
+virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx);
int virDomainMemoryFindByDef(virDomainDefPtr def, virDomainMemoryDefPtr mem)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDomainMemoryFindInactiveByDef(virDomainDefPtr def,
virDomainMemoryDefPtr mem)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDomainShmemDefInsert(virDomainDefPtr def, virDomainShmemDefPtr shmem)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
bool virDomainShmemDefEquals(virDomainShmemDefPtr src, virDomainShmemDefPtr dst)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
ssize_t virDomainShmemDefFind(virDomainDefPtr def, virDomainShmemDefPtr shmem)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-virDomainShmemDefPtr virDomainShmemDefRemove(virDomainDefPtr def, size_t idx)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
+virDomainShmemDefPtr virDomainShmemDefRemove(virDomainDefPtr def, size_t idx);
VIR_ENUM_DECL(virDomainTaint)
VIR_ENUM_DECL(virDomainVirt)
@@ -3228,12 +3218,10 @@ virDomainParseMemory(const char *xpath,
bool required,
bool capped);
-bool virDomainDefNeedsPlacementAdvice(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+bool virDomainDefNeedsPlacementAdvice(virDomainDefPtr def);
int virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a,
- const virDomainDiskDef *b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const virDomainDiskDef *b);
int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
int maplen,
@@ -3241,11 +3229,11 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
unsigned char *cpumaps,
int hostcpus,
virBitmapPtr autoCpuset)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
-bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
+bool virDomainDefHasMemballoon(const virDomainDef *def);
-char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
+char *virDomainObjGetShortName(const virDomainDef *def);
int
virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
@@ -3256,7 +3244,7 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
bool
virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
const virDomainDeviceInfo *b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk,
virDomainBlockIoTuneInfo *info);
diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
index 3992a29c5804..3f898d44fbb0 100644
--- a/src/conf/domain_event.h
+++ b/src/conf/domain_event.h
@@ -264,8 +264,7 @@ virDomainEventStateRegister(virConnectPtr conn,
virObjectEventStatePtr state,
virConnectDomainEventCallback callback,
void *opaque,
- virFreeCallback freecb)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virFreeCallback freecb);
int
virDomainEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
@@ -274,8 +273,7 @@ virDomainEventStateRegisterID(virConnectPtr conn,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
+ int *callbackID);
int
virDomainEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
@@ -286,23 +284,18 @@ virDomainEventStateRegisterClient(virConnectPtr conn,
virFreeCallback freecb,
bool legacy,
int *callbackID,
- bool remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(9);
+ bool remoteID);
int
virDomainEventStateCallbackID(virConnectPtr conn,
virObjectEventStatePtr state,
virConnectDomainEventCallback callback,
- int *remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ int *remoteID);
int
virDomainEventStateDeregister(virConnectPtr conn,
virObjectEventStatePtr state,
- virConnectDomainEventCallback callback)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virConnectDomainEventCallback callback);
int
virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
@@ -313,9 +306,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
void *opaque,
virFreeCallback freecb,
unsigned int flags,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(9);
+ int *callbackID);
virObjectEventPtr
virDomainQemuMonitorEventNew(int id,
@@ -324,7 +315,6 @@ virDomainQemuMonitorEventNew(int id,
const char *event,
long long seconds,
unsigned int micros,
- const char *details)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ const char *details);
#endif
diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h
index 30f988953cfd..413546666dbc 100644
--- a/src/conf/netdev_bandwidth_conf.h
+++ b/src/conf/netdev_bandwidth_conf.h
@@ -32,12 +32,11 @@
int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth,
xmlNodePtr node,
int net_type)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBandwidthFormat(virNetDevBandwidthPtr def,
virBufferPtr buf);
-void virDomainClearNetBandwidth(virDomainObjPtr vm)
- ATTRIBUTE_NONNULL(1);
+void virDomainClearNetBandwidth(virDomainObjPtr vm);
static inline bool virNetDevSupportBandwidth(virDomainNetType type)
{
diff --git a/src/conf/network_event.h b/src/conf/network_event.h
index 51bd949beeae..8a23070318b7 100644
--- a/src/conf/network_event.h
+++ b/src/conf/network_event.h
@@ -36,9 +36,7 @@ virNetworkEventStateRegisterID(virConnectPtr conn,
virConnectNetworkEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
int
virNetworkEventStateRegisterClient(virConnectPtr conn,
@@ -48,9 +46,7 @@ virNetworkEventStateRegisterClient(virConnectPtr conn,
virConnectNetworkEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
virObjectEventPtr
virNetworkEventLifecycleNew(const char *name,
diff --git a/src/conf/node_device_event.h b/src/conf/node_device_event.h
index 5a32d33abe5c..440a388b623a 100644
--- a/src/conf/node_device_event.h
+++ b/src/conf/node_device_event.h
@@ -35,9 +35,7 @@ virNodeDeviceEventStateRegisterID(virConnectPtr conn,
virConnectNodeDeviceEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
int
virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
@@ -47,9 +45,7 @@ virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
virConnectNodeDeviceEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
virObjectEventPtr
virNodeDeviceEventLifecycleNew(const char *name,
diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
index b6a535403d33..6fcfc2dad6d9 100644
--- a/src/conf/numa_conf.h
+++ b/src/conf/numa_conf.h
@@ -63,11 +63,9 @@ void virDomainNumaFree(virDomainNumaPtr numa);
*/
int virDomainNumatuneParseXML(virDomainNumaPtr numa,
bool placement_static,
- xmlXPathContextPtr ctxt)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ xmlXPathContextPtr ctxt);
-int virDomainNumatuneFormatXML(virBufferPtr buf, virDomainNumaPtr numatune)
- ATTRIBUTE_NONNULL(1);
+int virDomainNumatuneFormatXML(virBufferPtr buf, virDomainNumaPtr numatune);
/*
* Getters
@@ -88,16 +86,12 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa);
virBitmapPtr virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
- size_t node)
- ATTRIBUTE_NONNULL(1);
+ size_t node);
virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
- size_t node)
- ATTRIBUTE_NONNULL(1);
+ size_t node);
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
- size_t node)
- ATTRIBUTE_NONNULL(1);
-unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
- ATTRIBUTE_NONNULL(1);
+ size_t node);
+unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa);
unsigned int
virDomainNumaGetMaxCPUID(virDomainNumaPtr numa);
@@ -121,13 +115,11 @@ int virDomainNumatuneSet(virDomainNumaPtr numa,
bool placement_static,
int placement,
int mode,
- virBitmapPtr nodeset)
- ATTRIBUTE_NONNULL(1);
+ virBitmapPtr nodeset);
void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
size_t node,
- unsigned long long size)
- ATTRIBUTE_NONNULL(1);
+ unsigned long long size);
/*
* Other accessors
diff --git a/src/conf/object_event.c b/src/conf/object_event.c
index e5f942f0cca9..eaba3ad2eb6f 100644
--- a/src/conf/object_event.c
+++ b/src/conf/object_event.c
@@ -335,7 +335,7 @@ virObjectEventCallbackListPurgeMarked(virObjectEventCallbackListPtr cbList)
*
* Return the id if found, or -1 with no error issued if not present.
*/
-static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+static int
virObjectEventCallbackLookup(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
const char *key,
diff --git a/src/conf/object_event.h b/src/conf/object_event.h
index 7a9995e122e7..f16a89bb51a7 100644
--- a/src/conf/object_event.h
+++ b/src/conf/object_event.h
@@ -61,33 +61,28 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn,
void
virObjectEventStateQueue(virObjectEventStatePtr state,
- virObjectEventPtr event)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virObjectEventPtr event);
void
virObjectEventStateQueueRemote(virObjectEventStatePtr state,
virObjectEventPtr event,
- int remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int remoteID);
int
virObjectEventStateDeregisterID(virConnectPtr conn,
virObjectEventStatePtr state,
- int callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int callbackID);
int
virObjectEventStateEventID(virConnectPtr conn,
virObjectEventStatePtr state,
int callbackID,
- int *remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int *remoteID);
void
virObjectEventStateSetRemote(virConnectPtr conn,
virObjectEventStatePtr state,
int callbackID,
- int remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int remoteID);
#endif
diff --git a/src/conf/object_event_private.h b/src/conf/object_event_private.h
index 27b461f17785..bc03f9c53c1b 100644
--- a/src/conf/object_event_private.h
+++ b/src/conf/object_event_private.h
@@ -83,9 +83,7 @@ virObjectEventStateRegisterID(virConnectPtr conn,
virFreeCallback freecb,
bool legacy,
int *callbackID,
- bool remoteFilter)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6)
- ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(12);
+ bool remoteFilter);
int
virObjectEventStateCallbackID(virConnectPtr conn,
@@ -93,9 +91,7 @@ virObjectEventStateCallbackID(virConnectPtr conn,
virClassPtr klass,
int eventID,
virConnectObjectEventGenericCallback callback,
- int *remoteID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(5);
+ int *remoteID);
void *
virObjectEventNew(virClassPtr klass,
@@ -104,8 +100,6 @@ virObjectEventNew(virClassPtr klass,
int id,
const char *name,
const unsigned char *uuid,
- const char *key)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(7);
+ const char *key);
#endif
diff --git a/src/conf/secret_event.h b/src/conf/secret_event.h
index 5fd52f3fd3d2..c7deec1073f6 100644
--- a/src/conf/secret_event.h
+++ b/src/conf/secret_event.h
@@ -35,9 +35,7 @@ virSecretEventStateRegisterID(virConnectPtr conn,
virConnectSecretEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
int
virSecretEventStateRegisterClient(virConnectPtr conn,
@@ -47,9 +45,7 @@ virSecretEventStateRegisterClient(virConnectPtr conn,
virConnectSecretEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
virObjectEventPtr
virSecretEventLifecycleNew(const unsigned char *uuid,
diff --git a/src/conf/storage_event.h b/src/conf/storage_event.h
index ea726911fa33..f1f7d58c11bc 100644
--- a/src/conf/storage_event.h
+++ b/src/conf/storage_event.h
@@ -35,9 +35,7 @@ virStoragePoolEventStateRegisterID(virConnectPtr conn,
virConnectStoragePoolEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
int
virStoragePoolEventStateRegisterClient(virConnectPtr conn,
@@ -47,9 +45,7 @@ virStoragePoolEventStateRegisterClient(virConnectPtr conn,
virConnectStoragePoolEventGenericCallback cb,
void *opaque,
virFreeCallback freecb,
- int *callbackID)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
- ATTRIBUTE_NONNULL(8);
+ int *callbackID);
virObjectEventPtr
virStoragePoolEventLifecycleNew(const char *name,
diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h
index e32bbf8fb5fe..326e57b6a9f0 100644
--- a/src/conf/virnodedeviceobj.h
+++ b/src/conf/virnodedeviceobj.h
@@ -50,8 +50,7 @@ virNodeDeviceObjFindByName(virNodeDeviceObjListPtr devs,
virNodeDeviceObjPtr
virNodeDeviceObjFindBySysfsPath(virNodeDeviceObjListPtr devs,
- const char *sysfs_path)
- ATTRIBUTE_NONNULL(2);
+ const char *sysfs_path);
virNodeDeviceObjPtr
virNodeDeviceObjAssignDef(virNodeDeviceObjListPtr devs,
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index 8c238ad553d4..2ceac118b36d 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -151,16 +151,14 @@ virCPUCompareResult
virCPUCompare(virArch arch,
virCPUDefPtr host,
virCPUDefPtr cpu,
- bool failIncompatible)
- ATTRIBUTE_NONNULL(3);
+ bool failIncompatible);
int
cpuDecode (virCPUDefPtr cpu,
const virCPUData *data,
const char **models,
unsigned int nmodels,
- const char *preferred)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *preferred);
int
cpuEncode (virArch arch,
@@ -170,8 +168,7 @@ cpuEncode (virArch arch,
virCPUDataPtr *optional,
virCPUDataPtr *disabled,
virCPUDataPtr *forbidden,
- virCPUDataPtr *vendor)
- ATTRIBUTE_NONNULL(2);
+ virCPUDataPtr *vendor);
virCPUDataPtr
virCPUDataNew(virArch arch);
@@ -206,34 +203,29 @@ cpuBaseline (virCPUDefPtr *cpus,
int
virCPUUpdate(virArch arch,
virCPUDefPtr guest,
- const virCPUDef *host)
- ATTRIBUTE_NONNULL(2);
+ const virCPUDef *host);
int
virCPUUpdateLive(virArch arch,
virCPUDefPtr cpu,
virCPUDataPtr dataEnabled,
- virCPUDataPtr dataDisabled)
- ATTRIBUTE_NONNULL(2);
+ virCPUDataPtr dataDisabled);
int
virCPUCheckFeature(virArch arch,
const virCPUDef *cpu,
- const char *feature)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *feature);
int
virCPUDataCheckFeature(const virCPUData *data,
- const char *feature)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *feature);
bool
virCPUModelIsAllowed(const char *model,
const char **models,
- unsigned int nmodels)
- ATTRIBUTE_NONNULL(1);
+ unsigned int nmodels);
int
virCPUGetModels(virArch arch, char ***models);
@@ -242,13 +234,11 @@ int
virCPUTranslate(virArch arch,
virCPUDefPtr cpu,
const char **models,
- unsigned int nmodels)
- ATTRIBUTE_NONNULL(2);
+ unsigned int nmodels);
int
virCPUConvertLegacy(virArch arch,
- virCPUDefPtr cpu)
- ATTRIBUTE_NONNULL(2);
+ virCPUDefPtr cpu);
int
virCPUExpandFeatures(virArch arch,
@@ -257,9 +247,7 @@ virCPUExpandFeatures(virArch arch,
/* virCPUDataFormat and virCPUDataParse are implemented for unit tests only and
* have no real-life usage
*/
-char *virCPUDataFormat(const virCPUData *data)
- ATTRIBUTE_NONNULL(1);
-virCPUDataPtr virCPUDataParse(const char *xmlStr)
- ATTRIBUTE_NONNULL(1);
+char *virCPUDataFormat(const virCPUData *data);
+virCPUDataPtr virCPUDataParse(const char *xmlStr);
#endif /* __VIR_CPU_H__ */
diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c
index 700a8a075c39..960eff2d4973 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -153,7 +153,7 @@ netcfStateReload(void)
* for access control checks to be performed. Currently
* this implies existence of name and mac address attributes
*/
-static virInterfaceDef * ATTRIBUTE_NONNULL(1)
+static virInterfaceDef *
netcfGetMinimalDefForDevice(struct netcf_if *iface)
{
virInterfaceDef *def;
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 18a45fa85479..f4397d1fd25f 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -73,7 +73,7 @@ virUdevStatusString(virUdevStatus status)
* for access control checks to be performed. Currently
* this implies existence of name and mac address attributes
*/
-static virInterfaceDef * ATTRIBUTE_NONNULL(1)
+static virInterfaceDef *
udevGetMinimalDefForDevice(struct udev_device *dev)
{
virInterfaceDef *def;
@@ -96,7 +96,7 @@ udevGetMinimalDefForDevice(struct udev_device *dev)
}
-static struct udev_enumerate * ATTRIBUTE_NONNULL(1)
+static struct udev_enumerate *
udevGetDevices(struct udev *udev, virUdevStatus status)
{
struct udev_enumerate *enumerate;
@@ -579,9 +579,7 @@ udevBridgeScanDirFilter(const struct dirent *entry)
}
-static int
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK
+static int ATTRIBUTE_RETURN_CHECK
udevGetIfaceDefBond(struct udev *udev,
struct udev_device *dev,
const char *name,
@@ -804,9 +802,7 @@ udevGetIfaceDefBond(struct udev *udev,
return -1;
}
-static int
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK
+static int ATTRIBUTE_RETURN_CHECK
udevGetIfaceDefBridge(struct udev *udev,
struct udev_device *dev,
const char *name,
@@ -910,9 +906,7 @@ udevGetIfaceDefBridge(struct udev *udev,
return -1;
}
-static int
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK
+static int ATTRIBUTE_RETURN_CHECK
udevGetIfaceDefVlan(struct udev *udev ATTRIBUTE_UNUSED,
struct udev_device *dev ATTRIBUTE_UNUSED,
const char *name,
@@ -978,7 +972,7 @@ udevGetIfaceDefVlan(struct udev *udev ATTRIBUTE_UNUSED,
return ret;
}
-static virInterfaceDef * ATTRIBUTE_NONNULL(1)
+static virInterfaceDef *
udevGetIfaceDef(struct udev *udev, const char *name)
{
struct udev_device *dev = NULL;
diff --git a/src/internal.h b/src/internal.h
index d64be93b348a..6d2a6f9c0a68 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -197,27 +197,6 @@
# endif
# endif
-/* gcc's handling of attribute nonnull is less than stellar - it does
- * NOT improve diagnostics, and merely allows gcc to optimize away
- * null code checks even when the caller manages to pass null in spite
- * of the attribute, leading to weird crashes. Coverity, on the other
- * hand, knows how to do better static analysis based on knowing
- * whether a parameter is nonnull. Make this attribute conditional
- * based on whether we are compiling for real or for analysis, while
- * still requiring correct gcc syntax when it is turned off. See also
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308 */
-# ifndef ATTRIBUTE_NONNULL
-# if __GNUC_PREREQ (3, 3)
-# if STATIC_ANALYSIS
-# define ATTRIBUTE_NONNULL(m) __attribute__((__nonnull__(m)))
-# else
-# define ATTRIBUTE_NONNULL(m) __attribute__(())
-# endif
-# else
-# define ATTRIBUTE_NONNULL(m)
-# endif
-# endif
-
# ifndef ATTRIBUTE_FALLTHROUGH
# if __GNUC_PREREQ (7, 0)
# define ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough))
diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
index 3a3890b732e3..73e16253a30e 100644
--- a/src/libxl/libxl_domain.h
+++ b/src/libxl/libxl_domain.h
@@ -108,8 +108,7 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
libxlDriverConfigPtr cfg,
const char *from,
virDomainDefPtr *ret_def,
- libxlSavefileHeaderPtr ret_hdr)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ libxlSavefileHeaderPtr ret_hdr);
int
libxlDomainDestroyInternal(libxlDriverPrivatePtr driver,
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3270dc50074e..fb4c92a5c3e7 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1494,7 +1494,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
}
/* build the dnsmasq command line */
-static int ATTRIBUTE_NONNULL(3)
+static int
networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr driver,
virNetworkObjPtr network,
virCommandPtr *cmdout,
diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index c696f0301ff7..bd45d9e0ae7d 100644
--- a/src/network/bridge_driver.h
+++ b/src/network/bridge_driver.h
@@ -35,20 +35,15 @@ int networkRegister(void);
# if WITH_NETWORK
int networkAllocateActualDevice(virDomainDefPtr dom,
- virDomainNetDefPtr iface)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainNetDefPtr iface);
int networkNotifyActualDevice(virDomainDefPtr dom,
- virDomainNetDefPtr iface)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainNetDefPtr iface);
int networkReleaseActualDevice(virDomainDefPtr dom,
- virDomainNetDefPtr iface)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainNetDefPtr iface);
-int networkGetNetworkAddress(const char *netname, char **netaddr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+int networkGetNetworkAddress(const char *netname, char **netaddr);
-int networkGetActualType(virDomainNetDefPtr iface)
- ATTRIBUTE_NONNULL(1);
+int networkGetActualType(virDomainNetDefPtr iface);
int networkDnsmasqConfContents(virNetworkObjPtr network,
const char *pidfile,
@@ -57,12 +52,10 @@ int networkDnsmasqConfContents(virNetworkObjPtr network,
dnsmasqCapsPtr caps);
bool networkBandwidthChangeAllowed(virDomainNetDefPtr iface,
- virNetDevBandwidthPtr newBandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virNetDevBandwidthPtr newBandwidth);
int networkBandwidthUpdate(virDomainNetDefPtr iface,
- virNetDevBandwidthPtr newBandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virNetDevBandwidthPtr newBandwidth);
# else
/* Define no-op replacements that don't drag in any link dependencies. */
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 1803aa53b744..a8d24b699c92 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -140,9 +140,6 @@ waitsocket(int socket_fd, LIBSSH2_SESSION * session)
/* this function is the layer that manipulates the ssh channel itself
* and executes the commands on the remote machine */
-static char *phypExec(LIBSSH2_SESSION *, const char *, int *, virConnectPtr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
static char *
phypExec(LIBSSH2_SESSION *session, const char *cmd, int *exit_status,
virConnectPtr conn)
@@ -240,9 +237,6 @@ phypExec(LIBSSH2_SESSION *session, const char *cmd, int *exit_status,
}
/* Convenience wrapper function */
-static char *phypExecBuffer(LIBSSH2_SESSION *, virBufferPtr buf, int *,
- virConnectPtr, bool) ATTRIBUTE_NONNULL(1)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
static char *
phypExecBuffer(LIBSSH2_SESSION *session, virBufferPtr buf, int *exit_status,
virConnectPtr conn, bool strip_newline)
@@ -264,8 +258,6 @@ phypExecBuffer(LIBSSH2_SESSION *session, virBufferPtr buf, int *exit_status,
}
/* Convenience wrapper function */
-static int phypExecInt(LIBSSH2_SESSION *, virBufferPtr, virConnectPtr, int *)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
static int
phypExecInt(LIBSSH2_SESSION *session, virBufferPtr buf, virConnectPtr conn,
int *result)
diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
index 300fd4de5658..26364ebce387 100644
--- a/src/qemu/qemu_alias.h
+++ b/src/qemu/qemu_alias.h
@@ -81,10 +81,8 @@ char *qemuDomainGetMasterKeyAlias(void);
char *qemuDomainGetSecretAESAlias(const char *srcalias,
bool isLuks);
-char *qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
- ATTRIBUTE_NONNULL(1);
+char *qemuAliasTLSObjFromSrcAlias(const char *srcAlias);
-char *qemuAliasChardevFromDevAlias(const char *devAlias)
- ATTRIBUTE_NONNULL(1);
+char *qemuAliasChardevFromDevAlias(const char *devAlias);
#endif /* __QEMU_ALIAS_H__*/
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f51141b99062..c54075689201 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5052,7 +5052,7 @@ virQEMUCapsCacheNew(const char *libDir,
}
-static void ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+static void
virQEMUCapsCacheValidate(virQEMUCapsCachePtr cache,
const char *binary,
virCapsPtr caps,
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index d44682f2ad09..c8e4dc47ec68 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -414,12 +414,12 @@ typedef virQEMUCapsCache *virQEMUCapsCachePtr;
virQEMUCapsPtr virQEMUCapsNew(void);
void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
- virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
+ virQEMUCapsFlags flag);
-void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1);
+void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...);
void virQEMUCapsClear(virQEMUCapsPtr qemuCaps,
- virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
+ virQEMUCapsFlags flag);
bool virQEMUCapsGet(virQEMUCapsPtr qemuCaps,
virQEMUCapsFlags flag);
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 7da92c8c98f5..195f419b3f41 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -57,8 +57,7 @@ virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver,
virBitmapPtr nodeset,
size_t *nnicindexes,
int **nicindexes,
- const char *domainLibDir)
- ATTRIBUTE_NONNULL(15);
+ const char *domainLibDir);
/* Generate the object properties for a secret */
@@ -193,16 +192,13 @@ bool qemuCheckCCWS390AddressSupport(const virDomainDef *def,
virQEMUCapsPtr qemuCaps,
const char *devicename);
-virJSONValuePtr qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu)
- ATTRIBUTE_NONNULL(1);
+virJSONValuePtr qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu);
-virJSONValuePtr qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem)
- ATTRIBUTE_NONNULL(1);
+virJSONValuePtr qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem);
char *qemuBuildShmemDevStr(virDomainDefPtr def,
virDomainShmemDefPtr shmem,
- virQEMUCapsPtr qemuCaps)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virQEMUCapsPtr qemuCaps);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 1407eef4d4f0..455f4244c15a 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -313,28 +313,23 @@ typedef qemuSharedDeviceEntry *qemuSharedDeviceEntryPtr;
bool qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry,
const char *name,
- int *idx)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int *idx);
-char *qemuGetSharedDeviceKey(const char *disk_path)
- ATTRIBUTE_NONNULL(1);
+char *qemuGetSharedDeviceKey(const char *disk_path);
void qemuSharedDeviceEntryFree(void *payload, const void *name);
int qemuAddSharedDevice(virQEMUDriverPtr driver,
virDomainDeviceDefPtr dev,
- const char *name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *name);
int qemuRemoveSharedDevice(virQEMUDriverPtr driver,
virDomainDeviceDefPtr dev,
- const char *name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *name);
int qemuRemoveSharedDisk(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk,
- const char *name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *name);
int qemuSetUnprivSGIO(virDomainDeviceDefPtr dev);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 458bb5f9a431..3c3ae1696af3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3475,7 +3475,7 @@ qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv, qemuDomainJob job)
/*
* obj must be locked before calling
*/
-static int ATTRIBUTE_NONNULL(1)
+static int
qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
virDomainObjPtr obj,
qemuDomainJob job,
@@ -3774,7 +3774,7 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
return 0;
}
-static void ATTRIBUTE_NONNULL(1)
+static void
qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 91573ff06338..861dba6a0dd6 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -456,31 +456,24 @@ void qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj);
void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj);
-qemuMonitorPtr qemuDomainGetMonitor(virDomainObjPtr vm)
- ATTRIBUTE_NONNULL(1);
+qemuMonitorPtr qemuDomainGetMonitor(virDomainObjPtr vm);
void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainObjPtr obj);
int qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_RETURN_CHECK;
int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
virDomainObjPtr obj,
qemuDomainAsyncJob asyncJob)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
-qemuAgentPtr qemuDomainObjEnterAgent(virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1);
-void qemuDomainObjExitAgent(virDomainObjPtr obj, qemuAgentPtr agent)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+qemuAgentPtr qemuDomainObjEnterAgent(virDomainObjPtr obj);
+void qemuDomainObjExitAgent(virDomainObjPtr obj, qemuAgentPtr agent);
-void qemuDomainObjEnterRemote(virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1);
-void qemuDomainObjExitRemote(virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainObjEnterRemote(virDomainObjPtr obj);
+void qemuDomainObjExitRemote(virDomainObjPtr obj);
virDomainDefPtr qemuDomainDefCopy(virQEMUDriverPtr driver,
virDomainDefPtr src,
@@ -651,25 +644,18 @@ bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
bool qemuDomainAgentAvailable(virDomainObjPtr vm,
bool reportError);
-int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo)
- ATTRIBUTE_NONNULL(1);
-int qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo)
- ATTRIBUTE_NONNULL(1);
+int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo);
+int qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo);
int qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo,
- virDomainJobInfoPtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virDomainJobInfoPtr info);
int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
int *type,
virTypedParameterPtr *params,
- int *nparams)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ int *nparams);
-int qemuDomainSupportsBlockJobs(virDomainObjPtr vm, bool *modern)
- ATTRIBUTE_NONNULL(1);
+int qemuDomainSupportsBlockJobs(virDomainObjPtr vm, bool *modern);
bool qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk);
-bool qemuDomainHasBlockjob(virDomainObjPtr vm, bool copy_only)
- ATTRIBUTE_NONNULL(1);
+bool qemuDomainHasBlockjob(virDomainObjPtr vm, bool copy_only);
int qemuDomainAlignMemorySizes(virDomainDefPtr def);
void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def,
@@ -739,17 +725,13 @@ int qemuDomainMasterKeyCreate(virDomainObjPtr vm);
void qemuDomainMasterKeyRemove(qemuDomainObjPrivatePtr priv);
-void qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr *secinfo)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr *secinfo);
-void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk);
-bool qemuDomainSecretDiskCapable(virStorageSourcePtr src)
- ATTRIBUTE_NONNULL(1);
+bool qemuDomainSecretDiskCapable(virStorageSourcePtr src);
-bool qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src)
- ATTRIBUTE_NONNULL(1);
+bool qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src);
qemuDomainSecretInfoPtr
qemuDomainSecretInfoTLSNew(virConnectPtr conn,
@@ -759,59 +741,44 @@ qemuDomainSecretInfoTLSNew(virConnectPtr conn,
int qemuDomainSecretDiskPrepare(virConnectPtr conn,
qemuDomainObjPrivatePtr priv,
- virDomainDiskDefPtr disk)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virDomainDiskDefPtr disk);
-void qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr disk)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr disk);
int qemuDomainSecretHostdevPrepare(virConnectPtr conn,
qemuDomainObjPrivatePtr priv,
- virDomainHostdevDefPtr hostdev)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virDomainHostdevDefPtr hostdev);
-void qemuDomainSecretChardevDestroy(virDomainChrSourceDefPtr dev)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainSecretChardevDestroy(virDomainChrSourceDefPtr dev);
int qemuDomainSecretChardevPrepare(virConnectPtr conn,
virQEMUDriverConfigPtr cfg,
qemuDomainObjPrivatePtr priv,
const char *chrAlias,
- virDomainChrSourceDefPtr dev)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ virDomainChrSourceDefPtr dev);
-void qemuDomainSecretDestroy(virDomainObjPtr vm)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainSecretDestroy(virDomainObjPtr vm);
int qemuDomainSecretPrepare(virConnectPtr conn,
virQEMUDriverPtr driver,
- virDomainObjPtr vm)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virDomainObjPtr vm);
-int qemuDomainDefValidateDiskLunSource(const virStorageSource *src)
- ATTRIBUTE_NONNULL(1);
+int qemuDomainDefValidateDiskLunSource(const virStorageSource *src);
int qemuDomainPrepareChannel(virDomainChrDefPtr chr,
- const char *domainChannelTargetDir)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *domainChannelTargetDir);
void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source,
- virQEMUDriverConfigPtr cfg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virQEMUDriverConfigPtr cfg);
void qemuDomainPrepareChardevSource(virDomainDefPtr def,
- virQEMUDriverPtr driver)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virQEMUDriverPtr driver);
-int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem)
- ATTRIBUTE_NONNULL(1);
+int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem);
-bool qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+bool qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def);
-void qemuDomainVcpuPersistOrder(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+void qemuDomainVcpuPersistOrder(virDomainDefPtr def);
int qemuDomainCheckMonitor(virQEMUDriverPtr driver,
virDomainObjPtr vm,
diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h
index 067f4e799703..4a98c2c4bf8d 100644
--- a/src/qemu/qemu_domain_address.h
+++ b/src/qemu/qemu_domain_address.h
@@ -36,21 +36,18 @@ int qemuDomainAssignAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps,
virQEMUDriverPtr driver,
virDomainObjPtr obj,
- bool newDomain)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool newDomain);
int qemuDomainEnsurePCIAddress(virDomainObjPtr obj,
virDomainDeviceDefPtr dev,
- virQEMUDriverPtr driver)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ virQEMUDriverPtr driver);
void qemuDomainReleaseDeviceAddress(virDomainObjPtr vm,
virDomainDeviceInfoPtr info,
const char *devstr);
virDomainCCWAddressSetPtr
-qemuDomainCCWAddrSetCreateFromDomain(virDomainDefPtr def)
- ATTRIBUTE_NONNULL(1);
+qemuDomainCCWAddrSetCreateFromDomain(virDomainDefPtr def);
int qemuDomainAssignMemoryDeviceSlot(virDomainDefPtr def,
virDomainMemoryDefPtr mem);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d5fc00eba231..9ad3019172a9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3269,7 +3269,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
* no there was an error, then just return RAW
* indicating none.
*/
-static int ATTRIBUTE_NONNULL(2)
+static int
qemuGetCompressionProgram(const char *imageFormat,
char **compresspath,
const char *styleFormat,
@@ -6160,7 +6160,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
* on success. On error returns -1 on most failures, -3 if corrupt image was
* unlinked (no error raised).
*/
-static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
+static int
qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
const char *path,
virDomainDefPtr *ret_def,
@@ -6287,7 +6287,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
return -1;
}
-static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6)
+static int
qemuDomainSaveImageStartVM(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
@@ -11732,7 +11732,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
*
* This starts an empty VM listening on a TCP port.
*/
-static int ATTRIBUTE_NONNULL(5)
+static int
qemuDomainMigratePrepare2(virConnectPtr dconn,
char **cookie ATTRIBUTE_UNUSED,
int *cookielen ATTRIBUTE_UNUSED,
diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h
index ba74ac2cfe4b..24ac90fa4954 100644
--- a/src/qemu/qemu_interface.h
+++ b/src/qemu/qemu_interface.h
@@ -52,8 +52,7 @@ int qemuInterfaceBridgeConnect(virDomainDefPtr def,
virDomainNetDefPtr net,
int *tapfd,
size_t *tapfdSize,
- unsigned int *mtu)
- ATTRIBUTE_NONNULL(2);
+ unsigned int *mtu);
int qemuInterfaceOpenVhostNet(virDomainDefPtr def,
virDomainNetDefPtr net,
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 5248f399de4a..6e9aad6c3366 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -135,22 +135,17 @@ qemuMigrationParams(virTypedParameterPtr params,
int qemuMigrationJobStart(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainAsyncJob job)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
void qemuMigrationJobSetPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- qemuMigrationJobPhase phase)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ qemuMigrationJobPhase phase);
void qemuMigrationJobStartPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- qemuMigrationJobPhase phase)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuMigrationJobContinue(virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1);
+ qemuMigrationJobPhase phase);
+void qemuMigrationJobContinue(virDomainObjPtr obj);
bool qemuMigrationJobIsActive(virDomainObjPtr vm,
- qemuDomainAsyncJob job)
- ATTRIBUTE_NONNULL(1);
-void qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ qemuDomainAsyncJob job);
+void qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr obj);
int qemuMigrationSetOffline(virQEMUDriverPtr driver,
virDomainObjPtr vm);
@@ -247,7 +242,7 @@ int qemuMigrationToFile(virQEMUDriverPtr driver,
int fd,
const char *compressor,
qemuDomainAsyncJob asyncJob)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int qemuMigrationCancel(virQEMUDriverPtr driver,
virDomainObjPtr vm);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 87a1496cf78d..bdf2a70661ec 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -287,17 +287,14 @@ qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm,
bool json,
unsigned long long timeout,
qemuMonitorCallbacksPtr cb,
- void *opaque)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
+ void *opaque);
qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm,
int sockfd,
bool json,
qemuMonitorCallbacksPtr cb,
- void *opaque)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ void *opaque);
-void qemuMonitorUnregister(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
+void qemuMonitorUnregister(qemuMonitorPtr mon);
void qemuMonitorClose(qemuMonitorPtr mon);
virErrorPtr qemuMonitorLastError(qemuMonitorPtr mon);
@@ -306,25 +303,20 @@ int qemuMonitorSetCapabilities(qemuMonitorPtr mon);
int qemuMonitorSetLink(qemuMonitorPtr mon,
const char *name,
- virDomainNetInterfaceLinkState state)
- ATTRIBUTE_NONNULL(2);
+ virDomainNetInterfaceLinkState state);
/* These APIs are for use by the internal Text/JSON monitor impl code only */
char *qemuMonitorNextCommandID(qemuMonitorPtr mon);
int qemuMonitorSend(qemuMonitorPtr mon,
qemuMonitorMessagePtr msg);
-virJSONValuePtr qemuMonitorGetOptions(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
-void qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options)
- ATTRIBUTE_NONNULL(1);
+virJSONValuePtr qemuMonitorGetOptions(qemuMonitorPtr mon);
+void qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options);
int qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
virDomainVideoDefPtr video,
- const char *videoName)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *videoName);
int qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon,
virDomainVideoDefPtr video,
- const char *videoName)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *videoName);
int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon,
const char *cmd,
int scm_fd,
@@ -431,8 +423,7 @@ int qemuMonitorVMStatusToPausedReason(const char *status);
int qemuMonitorCheck(qemuMonitorPtr mon);
int qemuMonitorGetStatus(qemuMonitorPtr mon,
bool *running,
- virDomainPausedReason *reason)
- ATTRIBUTE_NONNULL(2);
+ virDomainPausedReason *reason);
int qemuMonitorSystemReset(qemuMonitorPtr mon);
int qemuMonitorSystemPowerdown(qemuMonitorPtr mon);
@@ -541,13 +532,11 @@ struct _qemuBlockStats {
int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr *ret_stats,
- bool backingChain)
- ATTRIBUTE_NONNULL(2);
+ bool backingChain);
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats,
- bool backingChain)
- ATTRIBUTE_NONNULL(2);
+ bool backingChain);
int qemuMonitorBlockResize(qemuMonitorPtr mon,
const char *dev_name,
@@ -839,8 +828,7 @@ int qemuMonitorDiskSnapshot(qemuMonitorPtr mon,
const char *file,
const char *format,
bool reuse);
-int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
- ATTRIBUTE_NONNULL(2);
+int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions);
int qemuMonitorDriveMirror(qemuMonitorPtr mon,
const char *device,
const char *file,
@@ -848,25 +836,21 @@ int qemuMonitorDriveMirror(qemuMonitorPtr mon,
unsigned long long bandwidth,
unsigned int granularity,
unsigned long long buf_size,
- unsigned int flags)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ unsigned int flags);
int qemuMonitorDrivePivot(qemuMonitorPtr mon,
- const char *device)
- ATTRIBUTE_NONNULL(2);
+ const char *device);
int qemuMonitorBlockCommit(qemuMonitorPtr mon,
const char *device,
const char *top,
const char *base,
const char *backingName,
- unsigned long long bandwidth)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ unsigned long long bandwidth);
bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon);
char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon,
const char *device,
virStorageSourcePtr top,
- virStorageSourcePtr target)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ virStorageSourcePtr target);
int qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
const char *cmd,
@@ -888,13 +872,11 @@ int qemuMonitorBlockStream(qemuMonitorPtr mon,
const char *base,
const char *backingName,
unsigned long long bandwidth,
- bool modern)
- ATTRIBUTE_NONNULL(2);
+ bool modern);
int qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
const char *device,
- bool modern)
- ATTRIBUTE_NONNULL(2);
+ bool modern);
int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
const char *device,
@@ -914,8 +896,7 @@ struct _qemuMonitorBlockJobInfo {
virHashTablePtr qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon);
int qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon,
const char *device,
- qemuMonitorBlockJobInfoPtr info)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ qemuMonitorBlockJobInfoPtr info);
int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
const char *protocol,
@@ -940,8 +921,7 @@ int qemuMonitorGetVersion(qemuMonitorPtr mon,
int *major,
int *minor,
int *micro,
- char **package)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ char **package);
typedef struct _qemuMonitorMachineInfo qemuMonitorMachineInfo;
@@ -1097,8 +1077,7 @@ struct _qemuMonitorMemoryDeviceInfo {
};
int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
- virHashTablePtr *info)
- ATTRIBUTE_NONNULL(2);
+ virHashTablePtr *info);
int qemuMonitorMigrateIncoming(qemuMonitorPtr mon,
const char *uri);
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 9495efd034f8..1fe975fc87f8 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -246,11 +246,8 @@ int qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon,
const char *device,
const char *file,
const char *format,
- bool reuse)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
-int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool reuse);
+int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr actions);
int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
const char *device,
const char *file,
@@ -258,26 +255,21 @@ int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
unsigned long long speed,
unsigned int granularity,
unsigned long long buf_size,
- unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ unsigned int flags);
int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
- const char *device)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *device);
int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon,
const char *device,
const char *top,
const char *base,
const char *backingName,
- unsigned long long bandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ unsigned long long bandwidth);
char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
const char *device,
virStorageSourcePtr top,
- virStorageSourcePtr target)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ virStorageSourcePtr target);
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
const char *cmd_str,
@@ -299,22 +291,18 @@ int qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
const char *base,
const char *backingName,
unsigned long long speed,
- bool modern)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool modern);
int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
const char *device,
- bool modern)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool modern);
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
const char *device,
unsigned long long speed,
- bool modern)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ bool modern);
-virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
+virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon);
int qemuMonitorJSONSetLink(qemuMonitorPtr mon,
const char *name,
@@ -342,43 +330,34 @@ int qemuMonitorJSONGetVersion(qemuMonitorPtr mon,
int *major,
int *minor,
int *micro,
- char **package)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ char **package);
int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
- qemuMonitorMachineInfoPtr **machines)
- ATTRIBUTE_NONNULL(2);
+ qemuMonitorMachineInfoPtr **machines);
int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
- qemuMonitorCPUDefInfoPtr **cpus)
- ATTRIBUTE_NONNULL(2);
+ qemuMonitorCPUDefInfoPtr **cpus);
int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
qemuMonitorCPUModelExpansionType type,
const char *model_name,
- qemuMonitorCPUModelInfoPtr *model_info)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ qemuMonitorCPUModelInfoPtr *model_info);
int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
- char ***commands)
- ATTRIBUTE_NONNULL(2);
+ char ***commands);
int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
- char ***events)
- ATTRIBUTE_NONNULL(2);
+ char ***events);
int qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
const char *option,
char ***params,
- bool *found)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool *found);
int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon,
bool *enabled,
- bool *present)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ bool *present);
int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
- char ***types)
- ATTRIBUTE_NONNULL(2);
+ char ***types);
/* ListPath structures and API's are public only for qemumonitorjsontest */
typedef struct _qemuMonitorJSONListPath qemuMonitorJSONListPath;
@@ -391,8 +370,7 @@ struct _qemuMonitorJSONListPath {
int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon,
const char *path,
- qemuMonitorJSONListPathPtr **paths)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ qemuMonitorJSONListPathPtr **paths);
void qemuMonitorJSONListPathFree(qemuMonitorJSONListPathPtr paths);
@@ -430,19 +408,16 @@ struct _qemuMonitorJSONObjectProperty {
int qemuMonitorJSONGetObjectProperty(qemuMonitorPtr mon,
const char *path,
const char *property,
- qemuMonitorJSONObjectPropertyPtr prop)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ qemuMonitorJSONObjectPropertyPtr prop);
int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon,
const char *path,
const char *property,
- qemuMonitorJSONObjectPropertyPtr prop)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
+ qemuMonitorJSONObjectPropertyPtr prop);
int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon,
const char *type,
- char ***props)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ char ***props);
char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
@@ -453,12 +428,10 @@ int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
bool writable);
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
- char ***tpmmodels)
- ATTRIBUTE_NONNULL(2);
+ char ***tpmmodels);
int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon,
- char ***tpmtypes)
- ATTRIBUTE_NONNULL(2);
+ char ***tpmtypes);
int qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon,
const char *chrID,
@@ -481,44 +454,34 @@ int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon);
int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon,
- qemuMonitorIOThreadInfoPtr **iothreads)
- ATTRIBUTE_NONNULL(2);
+ qemuMonitorIOThreadInfoPtr **iothreads);
int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
- virHashTablePtr info)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virHashTablePtr info);
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
const char *name,
const char *alias,
- char **path)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
+ char **path);
int qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
- const char *uri)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *uri);
-int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
+int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon);
int qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon,
- struct tm *tm)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ struct tm *tm);
int qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon,
struct qemuMonitorQueryHotpluggableCpusEntry **entries,
- size_t *nentries)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ size_t *nentries);
-virHashTablePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
+virHashTablePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon);
int qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon,
const char *nodename,
- unsigned long long threshold)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ unsigned long long threshold);
-virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon)
- ATTRIBUTE_NONNULL(1);
+virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon);
#endif /* QEMU_MONITOR_JSON_H */
diff --git a/src/rpc/virkeepalive.h b/src/rpc/virkeepalive.h
index 2297cd95e83c..a92c77c50ae4 100644
--- a/src/rpc/virkeepalive.h
+++ b/src/rpc/virkeepalive.h
@@ -39,9 +39,7 @@ virKeepAlivePtr virKeepAliveNew(int interval,
void *client,
virKeepAliveSendFunc sendCB,
virKeepAliveDeadFunc deadCB,
- virKeepAliveFreeFunc freeCB)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
- ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6);
+ virKeepAliveFreeFunc freeCB);
int virKeepAliveStart(virKeepAlivePtr ka,
int interval,
diff --git a/src/rpc/virnetclientstream.h b/src/rpc/virnetclientstream.h
index a0d2be9ed749..0450fe90eeaa 100644
--- a/src/rpc/virnetclientstream.h
+++ b/src/rpc/virnetclientstream.h
@@ -69,7 +69,6 @@ int virNetClientStreamEventUpdateCallback(virNetClientStreamPtr st,
int events);
int virNetClientStreamEventRemoveCallback(virNetClientStreamPtr st);
-bool virNetClientStreamEOF(virNetClientStreamPtr st)
- ATTRIBUTE_NONNULL(1);
+bool virNetClientStreamEOF(virNetClientStreamPtr st);
#endif /* __VIR_NET_CLIENT_STREAM_H__ */
diff --git a/src/rpc/virnetmessage.h b/src/rpc/virnetmessage.h
index d7406fcd24d5..85a135cb7e95 100644
--- a/src/rpc/virnetmessage.h
+++ b/src/rpc/virnetmessage.h
@@ -60,27 +60,25 @@ void virNetMessageClear(virNetMessagePtr);
void virNetMessageFree(virNetMessagePtr msg);
-virNetMessagePtr virNetMessageQueueServe(virNetMessagePtr *queue)
- ATTRIBUTE_NONNULL(1);
+virNetMessagePtr virNetMessageQueueServe(virNetMessagePtr *queue);
void virNetMessageQueuePush(virNetMessagePtr *queue,
- virNetMessagePtr msg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virNetMessagePtr msg);
int virNetMessageEncodeHeader(virNetMessagePtr msg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageDecodeLength(virNetMessagePtr msg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageDecodeHeader(virNetMessagePtr msg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageEncodePayload(virNetMessagePtr msg,
xdrproc_t filter,
void *data)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageDecodePayload(virNetMessagePtr msg,
xdrproc_t filter,
void *data)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageEncodeNumFDs(virNetMessagePtr msg);
int virNetMessageDecodeNumFDs(virNetMessagePtr msg);
@@ -88,12 +86,11 @@ int virNetMessageDecodeNumFDs(virNetMessagePtr msg);
int virNetMessageEncodePayloadRaw(virNetMessagePtr msg,
const char *buf,
size_t len)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetMessageEncodePayloadEmpty(virNetMessagePtr msg)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
-void virNetMessageSaveError(virNetMessageErrorPtr rerr)
- ATTRIBUTE_NONNULL(1);
+void virNetMessageSaveError(virNetMessageErrorPtr rerr);
int virNetMessageDupFD(virNetMessagePtr msg,
size_t slot);
diff --git a/src/secret/secret_util.h b/src/secret/secret_util.h
index 12b51b1aa295..0c9ea4a2bf8a 100644
--- a/src/secret/secret_util.h
+++ b/src/secret/secret_util.h
@@ -30,6 +30,5 @@ int virSecretGetSecretString(virConnectPtr conn,
virSecretUsageType secretUsageType,
uint8_t **ret_secret,
size_t *ret_secret_size)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
- ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_SECRET_UTIL_H__ */
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 922e484942c4..759299ecaf69 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -247,7 +247,6 @@ virSecurityDACSetChownCallback(virSecurityManagerPtr mgr,
/* returns 1 if label isn't found, 0 on success, -1 on error */
static int
-ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
virSecurityDACParseIds(virSecurityLabelDefPtr seclabel,
uid_t *uidPtr, gid_t *gidPtr)
{
@@ -261,7 +260,6 @@ virSecurityDACParseIds(virSecurityLabelDefPtr seclabel,
}
static int
-ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
virSecurityDACGetIds(virSecurityLabelDefPtr seclabel,
virSecurityDACDataPtr priv,
uid_t *uidPtr, gid_t *gidPtr,
@@ -292,7 +290,6 @@ virSecurityDACGetIds(virSecurityLabelDefPtr seclabel,
/* returns 1 if label isn't found, 0 on success, -1 on error */
static int
-ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
virSecurityDACParseImageIds(virSecurityLabelDefPtr seclabel,
uid_t *uidPtr, gid_t *gidPtr)
{
@@ -306,7 +303,6 @@ virSecurityDACParseImageIds(virSecurityLabelDefPtr seclabel,
}
static int
-ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
virSecurityDACGetImageIds(virSecurityLabelDefPtr seclabel,
virSecurityDACDataPtr priv,
uid_t *uidPtr, gid_t *gidPtr)
diff --git a/src/storage/storage_driver.h b/src/storage/storage_driver.h
index 530bc338806c..2962eaa75aa0 100644
--- a/src/storage/storage_driver.h
+++ b/src/storage/storage_driver.h
@@ -51,23 +51,20 @@ bool virStorageFileSupportsSecurityDriver(const virStorageSource *src);
int virStorageFileGetMetadata(virStorageSourcePtr src,
uid_t uid, gid_t gid,
bool allow_probe,
- bool report_broken)
- ATTRIBUTE_NONNULL(1);
+ bool report_broken);
int virStorageTranslateDiskSourcePool(virConnectPtr conn,
virDomainDiskDefPtr def);
-virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *uuid)
- ATTRIBUTE_NONNULL(1);
+virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *uuid);
virStoragePoolPtr
storagePoolLookupByTargetPath(virConnectPtr conn,
- const char *path)
- ATTRIBUTE_NONNULL(2);
+ const char *path);
char *virStoragePoolObjBuildTempFilePath(virStoragePoolObjPtr pool,
virStorageVolDefPtr vol)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int storageRegister(void);
int storageRegisterAll(void);
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 7687eb89a0ba..00f9bc89e0ba 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -96,7 +96,7 @@ btrfsCloneFile(int dest_fd ATTRIBUTE_UNUSED,
}
#endif
-static int ATTRIBUTE_NONNULL(2)
+static int
virStorageBackendCopyToFD(virStorageVolDefPtr vol,
virStorageVolDefPtr inputvol,
int fd,
diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h
index fa3b6522c9a8..5bba088cd635 100644
--- a/src/storage/storage_util.h
+++ b/src/storage/storage_util.h
@@ -131,8 +131,7 @@ enum {
int virStorageBackendVolOpen(const char *path, struct stat *sb,
unsigned int flags)
- ATTRIBUTE_RETURN_CHECK
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_RETURN_CHECK;
# define VIR_STORAGE_DEFAULT_POOL_PERM_MODE 0755
# define VIR_STORAGE_DEFAULT_VOL_PERM_MODE 0600
diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index 088f18f42548..45ded9a41a16 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -48,38 +48,35 @@
/* Don't call these directly - use the macros below */
int virAlloc(void *ptrptr, size_t size, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
int virAllocN(void *ptrptr, size_t size, size_t count, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
int virReallocN(void *ptrptr, size_t size, size_t count, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add, bool report,
int domcode, const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
int virResizeN(void *ptrptr, size_t size, size_t *alloc, size_t count, size_t desired,
bool report, int domcode, const char *filename,
const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
-void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
+void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove);
int virInsertElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
size_t add, void *newelem,
bool clearOriginal, bool inPlace, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ ATTRIBUTE_RETURN_CHECK;
int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
- size_t toremove, bool inPlace)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ size_t toremove, bool inPlace);
int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size, size_t count,
bool report, int domcode, const char *filename,
const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
-void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
+void virFree(void *ptrptr);
-void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countptr)
- ATTRIBUTE_NONNULL(1);
+void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countptr);
/**
* VIR_ALLOC:
diff --git a/src/util/viratomic.h b/src/util/viratomic.h
index 4d7f7e582519..f4e3acfb9e90 100644
--- a/src/util/viratomic.h
+++ b/src/util/viratomic.h
@@ -41,8 +41,7 @@
* This call acts as a full compiler and hardware memory barrier
* (before the get)
*/
-VIR_STATIC int virAtomicIntGet(volatile int *atomic)
- ATTRIBUTE_NONNULL(1);
+VIR_STATIC int virAtomicIntGet(volatile int *atomic);
/**
* virAtomicIntSet:
@@ -52,8 +51,7 @@ VIR_STATIC int virAtomicIntGet(volatile int *atomic)
* (after the set)
*/
VIR_STATIC void virAtomicIntSet(volatile int *atomic,
- int newval)
- ATTRIBUTE_NONNULL(1);
+ int newval);
/**
* virAtomicIntInc:
@@ -64,8 +62,7 @@ VIR_STATIC void virAtomicIntSet(volatile int *atomic,
*
* This call acts as a full compiler and hardware memory barrier.
*/
-VIR_STATIC int virAtomicIntInc(volatile int *atomic)
- ATTRIBUTE_NONNULL(1);
+VIR_STATIC int virAtomicIntInc(volatile int *atomic);
/**
* virAtomicIntDecAndTest:
@@ -76,8 +73,7 @@ VIR_STATIC int virAtomicIntInc(volatile int *atomic)
*
* This call acts as a full compiler and hardware memory barrier.
*/
-VIR_STATIC bool virAtomicIntDecAndTest(volatile int *atomic)
- ATTRIBUTE_NONNULL(1);
+VIR_STATIC bool virAtomicIntDecAndTest(volatile int *atomic);
/**
* virAtomicIntCompareExchange:
@@ -94,8 +90,7 @@ VIR_STATIC bool virAtomicIntDecAndTest(volatile int *atomic)
*/
VIR_STATIC bool virAtomicIntCompareExchange(volatile int *atomic,
int oldval,
- int newval)
- ATTRIBUTE_NONNULL(1);
+ int newval);
/**
* virAtomicIntAdd:
@@ -107,8 +102,7 @@ VIR_STATIC bool virAtomicIntCompareExchange(volatile int *atomic,
* This call acts as a full compiler and hardware memory barrier.
*/
VIR_STATIC int virAtomicIntAdd(volatile int *atomic,
- int val)
- ATTRIBUTE_NONNULL(1);
+ int val);
/**
* virAtomicIntAnd:
@@ -121,8 +115,7 @@ VIR_STATIC int virAtomicIntAdd(volatile int *atomic,
* { tmp = *atomic; *atomic &= val; return tmp; }
*/
VIR_STATIC unsigned int virAtomicIntAnd(volatile unsigned int *atomic,
- unsigned int val)
- ATTRIBUTE_NONNULL(1);
+ unsigned int val);
/**
* virAtomicIntOr:
@@ -135,8 +128,7 @@ VIR_STATIC unsigned int virAtomicIntAnd(volatile unsigned int *atomic,
* This call acts as a full compiler and hardware memory barrier.
*/
VIR_STATIC unsigned int virAtomicIntOr(volatile unsigned int *atomic,
- unsigned int val)
- ATTRIBUTE_NONNULL(1);
+ unsigned int val);
/**
* virAtomicIntXor:
@@ -149,8 +141,7 @@ VIR_STATIC unsigned int virAtomicIntOr(volatile unsigned int *atomic,
* This call acts as a full compiler and hardware memory barrier.
*/
VIR_STATIC unsigned int virAtomicIntXor(volatile unsigned int *atomic,
- unsigned int val)
- ATTRIBUTE_NONNULL(1);
+ unsigned int val);
# undef VIR_STATIC
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 36282af1cddf..9a87e44b2f53 100644
--- a/src/util/virbitmap.h
+++ b/src/util/virbitmap.h
@@ -54,41 +54,40 @@ int virBitmapCopy(virBitmapPtr dst, virBitmapPtr src);
* Set bit position @b in @bitmap
*/
int virBitmapSetBit(virBitmapPtr bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virBitmapSetBitExpand(virBitmapPtr bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
/*
* Clear bit position @b in @bitmap
*/
int virBitmapClearBit(virBitmapPtr bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virBitmapClearBitExpand(virBitmapPtr bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
/*
* Get bit @b in @bitmap. Returns false if b is out of range.
*/
bool virBitmapIsBitSet(virBitmapPtr bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
/*
* Get setting of bit position @b in @bitmap and store in @result
*/
int virBitmapGetBit(virBitmapPtr bitmap, size_t b, bool *result)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virBitmapString(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virBitmapFormat(virBitmapPtr bitmap);
int virBitmapParse(const char *str,
virBitmapPtr *bitmap,
- size_t bitmapSize)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ size_t bitmapSize);
int
virBitmapParseSeparator(const char *str,
char terminator,
@@ -97,53 +96,39 @@ virBitmapParseSeparator(const char *str,
virBitmapPtr
virBitmapParseUnlimited(const char *str);
-virBitmapPtr virBitmapNewCopy(virBitmapPtr src) ATTRIBUTE_NONNULL(1);
+virBitmapPtr virBitmapNewCopy(virBitmapPtr src);
-virBitmapPtr virBitmapNewData(const void *data, int len) ATTRIBUTE_NONNULL(1);
+virBitmapPtr virBitmapNewData(const void *data, int len);
-int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen);
-void virBitmapToDataBuf(virBitmapPtr bitmap, unsigned char *data, size_t len)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+void virBitmapToDataBuf(virBitmapPtr bitmap, unsigned char *data, size_t len);
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2);
-size_t virBitmapSize(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+size_t virBitmapSize(virBitmapPtr bitmap);
-void virBitmapSetAll(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+void virBitmapSetAll(virBitmapPtr bitmap);
-void virBitmapClearAll(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+void virBitmapClearAll(virBitmapPtr bitmap);
-bool virBitmapIsAllSet(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+bool virBitmapIsAllSet(virBitmapPtr bitmap);
-bool virBitmapIsAllClear(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+bool virBitmapIsAllClear(virBitmapPtr bitmap);
-ssize_t virBitmapNextSetBit(virBitmapPtr bitmap, ssize_t pos)
- ATTRIBUTE_NONNULL(1);
+ssize_t virBitmapNextSetBit(virBitmapPtr bitmap, ssize_t pos);
-ssize_t virBitmapLastSetBit(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+ssize_t virBitmapLastSetBit(virBitmapPtr bitmap);
-ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos)
- ATTRIBUTE_NONNULL(1);
+ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos);
-size_t virBitmapCountBits(virBitmapPtr bitmap)
- ATTRIBUTE_NONNULL(1);
+size_t virBitmapCountBits(virBitmapPtr bitmap);
char *virBitmapDataToString(const void *data,
- int len)
- ATTRIBUTE_NONNULL(1);
+ int len);
bool virBitmapOverlaps(virBitmapPtr b1,
- virBitmapPtr b2)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virBitmapPtr b2);
-void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b);
#endif
diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h
index d1b64ca3a3de..db42bea8c0f6 100644
--- a/src/util/virbuffer.h
+++ b/src/util/virbuffer.h
@@ -58,7 +58,7 @@ int virBufferCheckErrorInternal(const virBuffer *buf,
const char *filename,
const char *funcname,
size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
/**
* virBufferCheckError
*
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index 2de1bf2de4ce..2e427bd95fd5 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -66,25 +66,21 @@ bool virCgroupAvailable(void);
int virCgroupNewPartition(const char *path,
bool create,
int controllers,
- virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+ virCgroupPtr *group);
-int virCgroupNewSelf(virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1);
+int virCgroupNewSelf(virCgroupPtr *group);
int virCgroupNewDomainPartition(virCgroupPtr partition,
const char *driver,
const char *name,
bool create,
- virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
+ virCgroupPtr *group);
int virCgroupNewThread(virCgroupPtr domain,
virCgroupThreadName nameval,
int id,
bool create,
- virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(5);
+ virCgroupPtr *group);
int virCgroupDelThread(virCgroupPtr cgroup,
virCgroupThreadName nameval,
@@ -100,8 +96,7 @@ int virCgroupNewDetectMachine(const char *name,
bool privileged,
pid_t pid,
int controllers,
- virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virCgroupPtr *group);
int virCgroupNewMachine(const char *name,
const char *drivername,
@@ -113,12 +108,9 @@ int virCgroupNewMachine(const char *name,
int *nicindexes,
const char *partition,
int controllers,
- virCgroupPtr *group)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
- ATTRIBUTE_NONNULL(3);
+ virCgroupPtr *group);
-int virCgroupTerminateMachine(const char *name)
- ATTRIBUTE_NONNULL(1);
+int virCgroupTerminateMachine(const char *name);
bool virCgroupNewIgnoreError(void);
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index 99dcdeb541a7..8fd1c8da0e90 100644
--- a/src/util/vircommand.h
+++ b/src/util/vircommand.h
@@ -37,15 +37,14 @@ pid_t virFork(void) ATTRIBUTE_RETURN_CHECK;
int virRun(const char *const*argv, int *status) ATTRIBUTE_RETURN_CHECK;
-virCommandPtr virCommandNew(const char *binary) ATTRIBUTE_NONNULL(1);
+virCommandPtr virCommandNew(const char *binary);
-virCommandPtr virCommandNewArgs(const char *const*args) ATTRIBUTE_NONNULL(1);
+virCommandPtr virCommandNewArgs(const char *const*args);
virCommandPtr virCommandNewArgList(const char *binary, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
+ ATTRIBUTE_SENTINEL;
-virCommandPtr virCommandNewVAList(const char *binary, va_list list)
- ATTRIBUTE_NONNULL(1);
+virCommandPtr virCommandNewVAList(const char *binary, va_list list);
/* All error report from these setup APIs is
* delayed until the Run/RunAsync methods
@@ -66,7 +65,7 @@ int virCommandPassFDGetFDIndex(virCommandPtr cmd,
int fd);
void virCommandSetPidFile(virCommandPtr cmd,
- const char *pidfile) ATTRIBUTE_NONNULL(2);
+ const char *pidfile);
void virCommandSetGID(virCommandPtr cmd, gid_t gid);
@@ -96,73 +95,72 @@ void virCommandNonblockingFDs(virCommandPtr cmd);
void virCommandRawStatus(virCommandPtr cmd);
void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3);
+ ATTRIBUTE_FMT_PRINTF(2, 3);
void virCommandAddEnvPair(virCommandPtr cmd,
const char *name,
- const char *value) ATTRIBUTE_NONNULL(2);
+ const char *value);
void virCommandAddEnvString(virCommandPtr cmd,
- const char *str) ATTRIBUTE_NONNULL(2);
+ const char *str);
void virCommandAddEnvBuffer(virCommandPtr cmd,
virBufferPtr buf);
void virCommandAddEnvPassBlockSUID(virCommandPtr cmd,
const char *name,
- const char *defvalue) ATTRIBUTE_NONNULL(2);
+ const char *defvalue);
void virCommandAddEnvPassAllowSUID(virCommandPtr cmd,
- const char *name) ATTRIBUTE_NONNULL(2);
+ const char *name);
void virCommandAddEnvPassCommon(virCommandPtr cmd);
void virCommandAddArg(virCommandPtr cmd,
- const char *val) ATTRIBUTE_NONNULL(2);
+ const char *val);
void virCommandAddArgBuffer(virCommandPtr cmd,
virBufferPtr buf);
void virCommandAddArgFormat(virCommandPtr cmd,
const char *format, ...)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3);
+ ATTRIBUTE_FMT_PRINTF(2, 3);
void virCommandAddArgPair(virCommandPtr cmd,
const char *name,
- const char *val)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *val);
void virCommandAddArgSet(virCommandPtr cmd,
- const char *const*vals) ATTRIBUTE_NONNULL(2);
+ const char *const*vals);
void virCommandAddArgList(virCommandPtr cmd,
... /* const char *arg, ..., NULL */)
ATTRIBUTE_SENTINEL;
void virCommandSetWorkingDirectory(virCommandPtr cmd,
- const char *pwd) ATTRIBUTE_NONNULL(2);
+ const char *pwd);
void virCommandSetInputBuffer(virCommandPtr cmd,
- const char *inbuf) ATTRIBUTE_NONNULL(2);
+ const char *inbuf);
void virCommandSetOutputBuffer(virCommandPtr cmd,
- char **outbuf) ATTRIBUTE_NONNULL(2);
+ char **outbuf);
void virCommandSetErrorBuffer(virCommandPtr cmd,
- char **errbuf) ATTRIBUTE_NONNULL(2);
+ char **errbuf);
void virCommandSetInputFD(virCommandPtr cmd,
int infd);
void virCommandSetOutputFD(virCommandPtr cmd,
- int *outfd) ATTRIBUTE_NONNULL(2);
+ int *outfd);
void virCommandSetErrorFD(virCommandPtr cmd,
- int *errfd) ATTRIBUTE_NONNULL(2);
+ int *errfd);
void virCommandSetPreExecHook(virCommandPtr cmd,
virExecHook hook,
- void *opaque) ATTRIBUTE_NONNULL(2);
+ void *opaque);
void virCommandWriteArgLog(virCommandPtr cmd,
int logfd);
diff --git a/src/util/vircrypto.h b/src/util/vircrypto.h
index 52ba3b3ad022..81f401421973 100644
--- a/src/util/vircrypto.h
+++ b/src/util/vircrypto.h
@@ -42,7 +42,6 @@ int
virCryptoHashString(virCryptoHash hash,
const char *input,
char **output)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
bool virCryptoHaveCipher(virCryptoCipher algorithm);
@@ -52,8 +51,7 @@ int virCryptoEncryptData(virCryptoCipher algorithm,
uint8_t *iv, size_t ivlen,
uint8_t *data, size_t datalen,
uint8_t **ciphertext, size_t *ciphertextlen)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6)
- ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
uint8_t *virCryptoGenerateRandom(size_t nbytes);
diff --git a/src/util/virfile.h b/src/util/virfile.h
index ba1c57c06a8e..9749d3195a7b 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -93,7 +93,7 @@ typedef enum {
virFileWrapperFdPtr virFileWrapperFdNew(int *fd,
const char *name,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virFileWrapperFdClose(virFileWrapperFdPtr dfd);
@@ -128,18 +128,18 @@ int virFileNBDDeviceAssociate(const char *file,
int virFileDeleteTree(const char *dir);
int virFileReadHeaderFD(int fd, int maxlen, char **buf)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
int virFileReadLimFD(int fd, int maxlen, char **buf)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
int virFileReadAll(const char *path, int maxlen, char **buf)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
int virFileReadAllQuiet(const char *path, int maxlen, char **buf)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_RETURN_CHECK;
int virFileReadBufQuiet(const char *file, char *buf, int len)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_RETURN_CHECK;
int virFileWriteStr(const char *path, const char *str, mode_t mode)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virFileMatchesNameSuffix(const char *file,
const char *name,
@@ -152,12 +152,10 @@ int virFileStripSuffix(char *str,
const char *suffix) ATTRIBUTE_RETURN_CHECK;
int virFileLinkPointsTo(const char *checkLink,
- const char *checkDest)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *checkDest);
int virFileRelLinkPointsTo(const char *directory,
const char *checkLink,
- const char *checkDest)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *checkDest);
int virFileResolveLink(const char *linkpath,
char **resultpath) ATTRIBUTE_RETURN_CHECK;
@@ -165,31 +163,28 @@ int virFileResolveAllLinks(const char *linkpath,
char **resultpath) ATTRIBUTE_RETURN_CHECK;
int virFileIsLink(const char *linkpath)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virFileReadLink(const char *linkpath, char **resultpath)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virFindFileInPath(const char *file);
char *virFileFindResource(const char *filename,
const char *builddir,
- const char *installdir)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *installdir);
char *virFileFindResourceFull(const char *filename,
const char *prefix,
const char *suffix,
const char *builddir,
const char *installdir,
- const char *envname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
-void virFileActivateDirOverride(const char *argv0)
- ATTRIBUTE_NONNULL(1);
+ const char *envname);
+void virFileActivateDirOverride(const char *argv0);
-off_t virFileLength(const char *path, int fd) ATTRIBUTE_NONNULL(1);
-bool virFileIsDir (const char *file) ATTRIBUTE_NONNULL(1);
-bool virFileExists(const char *file) ATTRIBUTE_NONNULL(1);
-bool virFileIsExecutable(const char *file) ATTRIBUTE_NONNULL(1);
+off_t virFileLength(const char *path, int fd);
+bool virFileIsDir (const char *file);
+bool virFileExists(const char *file);
+bool virFileIsExecutable(const char *file);
enum {
VIR_FILE_SHFS_NFS = (1 << 0),
@@ -200,9 +195,9 @@ enum {
VIR_FILE_SHFS_CIFS = (1 << 5),
};
-int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);
-int virFileIsSharedFS(const char *path) ATTRIBUTE_NONNULL(1);
-int virFileIsMountPoint(const char *file) ATTRIBUTE_NONNULL(1);
+int virFileIsSharedFSType(const char *path, int fstypes);
+int virFileIsSharedFS(const char *path);
+int virFileIsMountPoint(const char *file);
int virFileGetMountSubtree(const char *mtabpath,
const char *prefix,
@@ -224,11 +219,11 @@ enum {
};
int virFileAccessibleAs(const char *path, int mode,
uid_t uid, gid_t gid)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virFileOpenAs(const char *path, int openflags, mode_t mode,
uid_t uid, gid_t gid,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virFileRemove(const char *path, uid_t uid, gid_t gid);
enum {
@@ -239,15 +234,14 @@ enum {
int virDirCreate(const char *path, mode_t mode, uid_t uid, gid_t gid,
unsigned int flags) ATTRIBUTE_RETURN_CHECK;
int virDirOpen(DIR **dirp, const char *dirname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDirOpenIfExists(DIR **dirp, const char *dirname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDirOpenQuiet(DIR **dirp, const char *dirname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDirRead(DIR *dirp, struct dirent **ent, const char *dirname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-void virDirClose(DIR **dirp)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
+void virDirClose(DIR **dirp);
# define VIR_DIR_CLOSE(dir) virDirClose(&(dir))
int virFileMakePath(const char *path) ATTRIBUTE_RETURN_CHECK;
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index b04ab4870dba..8df547bdf893 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -74,18 +74,16 @@ void virFirewallRemoveRule(virFirewallPtr firewall,
void virFirewallRuleAddArg(virFirewallPtr firewall,
virFirewallRulePtr rule,
- const char *arg)
- ATTRIBUTE_NONNULL(3);
+ const char *arg);
void virFirewallRuleAddArgFormat(virFirewallPtr firewall,
virFirewallRulePtr rule,
const char *fmt, ...)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_FMT_PRINTF(3, 4);
+ ATTRIBUTE_FMT_PRINTF(3, 4);
void virFirewallRuleAddArgSet(virFirewallPtr firewall,
virFirewallRulePtr rule,
- const char *const *args)
- ATTRIBUTE_NONNULL(3);
+ const char *const *args);
void virFirewallRuleAddArgList(virFirewallPtr firewall,
virFirewallRulePtr rule,
diff --git a/src/util/virfirmware.h b/src/util/virfirmware.h
index 682a865ee966..583224ccbe73 100644
--- a/src/util/virfirmware.h
+++ b/src/util/virfirmware.h
@@ -38,14 +38,12 @@ void
virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares);
int
-virFirmwareParse(const char *str, virFirmwarePtr firmware)
- ATTRIBUTE_NONNULL(2);
+virFirmwareParse(const char *str, virFirmwarePtr firmware);
int
virFirmwareParseList(const char *list,
virFirmwarePtr **firmwares,
- size_t *nfirmwares)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ size_t *nfirmwares);
#endif /* __VIR_FIRMWARE_H__ */
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 02b9fc8eb94f..57c3c4a60e7a 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -282,10 +282,6 @@ virHostCPUGetSiblingsList(unsigned int cpu)
/* parses a node entry, returning number of processors in the node and
* filling arguments */
static int
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
-ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(6)
-ATTRIBUTE_NONNULL(7) ATTRIBUTE_NONNULL(8)
-ATTRIBUTE_NONNULL(9)
virHostCPUParseNode(const char *node,
virArch arch,
virBitmapPtr present_cpus_map,
diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h
index 54e1c66be36f..35f7c9f319c9 100644
--- a/src/util/virhostdev.h
+++ b/src/util/virhostdev.h
@@ -67,140 +67,117 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
const unsigned char *uuid,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
- unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ unsigned int flags);
int
virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev,
bool mandatory,
- virUSBDevicePtr *usb)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ virUSBDevicePtr *usb);
int
virHostdevPrepareUSBDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
- unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ unsigned int flags);
int
virHostdevPrepareSCSIDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ int nhostdevs);
int
virHostdevPrepareSCSIVHostDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ int nhostdevs);
int
virHostdevPrepareMediatedDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ int nhostdevs);
void
virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
- const char *oldStateDir)
- ATTRIBUTE_NONNULL(1);
+ const char *oldStateDir);
void
virHostdevReAttachUSBDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1);
+ int nhostdevs);
void
virHostdevReAttachSCSIDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ int nhostdevs);
void
virHostdevReAttachSCSIVHostDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1);
+ int nhostdevs);
void
virHostdevReAttachMediatedDevices(virHostdevManagerPtr hostdev_mgr,
const char *drv_name,
const char *dom_name,
virDomainHostdevDefPtr *hostdevs,
- int nhostdevs)
- ATTRIBUTE_NONNULL(1);
+ int nhostdevs);
int
virHostdevUpdateActivePCIDevices(virHostdevManagerPtr mgr,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
const char *drv_name,
- const char *dom_name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ const char *dom_name);
int
virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
const char *drv_name,
- const char *dom_name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ const char *dom_name);
int
virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
const char *drv_name,
- const char *dom_name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ const char *dom_name);
int
virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs,
const char *drv_name,
- const char *dom_name)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
+ const char *dom_name);
int
virHostdevUpdateActiveDomainDevices(virHostdevManagerPtr mgr,
const char *driver,
virDomainDefPtr def,
- unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ unsigned int flags);
int
virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr,
const char *driver,
virDomainDefPtr def,
- unsigned int flags)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ unsigned int flags);
void
virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
const char *driver,
virDomainDefPtr def,
unsigned int flags,
- const char *oldStateDir)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *oldStateDir);
bool
-virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
- ATTRIBUTE_NONNULL(1);
+virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev);
/* functions used by NodeDevDetach/Reattach/Reset */
int virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr,
- virPCIDevicePtr pci)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virPCIDevicePtr pci);
int virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr mgr,
- virPCIDevicePtr pci)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virPCIDevicePtr pci);
int virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr,
- virPCIDevicePtr pci)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virPCIDevicePtr pci);
#endif /* __VIR_HOSTDEV_H__ */
diff --git a/src/util/viridentity.h b/src/util/viridentity.h
index 63aa63d573ca..8ff1d11627ac 100644
--- a/src/util/viridentity.h
+++ b/src/util/viridentity.h
@@ -50,20 +50,14 @@ virIdentityPtr virIdentityNew(void);
int virIdentitySetAttr(virIdentityPtr ident,
unsigned int attr,
- const char *value)
- ATTRIBUTE_NONNULL(1)
- ATTRIBUTE_NONNULL(3);
+ const char *value);
int virIdentityGetAttr(virIdentityPtr ident,
unsigned int attr,
- const char **value)
- ATTRIBUTE_NONNULL(1)
- ATTRIBUTE_NONNULL(3);
+ const char **value);
bool virIdentityIsEqual(virIdentityPtr identA,
- virIdentityPtr identB)
- ATTRIBUTE_NONNULL(1)
- ATTRIBUTE_NONNULL(2);
+ virIdentityPtr identB);
int virIdentityGetUNIXUserName(virIdentityPtr ident,
const char **username);
diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h
index a44beeaf6796..4db64370e52c 100644
--- a/src/util/viriscsi.h
+++ b/src/util/viriscsi.h
@@ -26,37 +26,33 @@
char *
virISCSIGetSession(const char *devpath,
- bool probe)
- ATTRIBUTE_NONNULL(1);
+ bool probe);
int
virISCSIConnectionLogin(const char *portal,
const char *initiatoriqn,
const char *target)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int
virISCSIConnectionLogout(const char *portal,
const char *initiatoriqn,
const char *target)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int
virISCSIRescanLUNs(const char *session)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int
virISCSIScanTargets(const char *portal,
size_t *ntargetsret,
char ***targetsret)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int
virISCSINodeNew(const char *portal,
const char *target)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_RETURN_CHECK;
int
@@ -64,6 +60,5 @@ virISCSINodeUpdate(const char *portal,
const char *target,
const char *name,
const char *value)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 14b74c0617c9..38673191aed9 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -84,13 +84,11 @@ void virJSONValueFree(virJSONValuePtr value);
void virJSONValueHashFree(void *opaque, const void *name);
int virJSONValueObjectCreate(virJSONValuePtr *obj, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
-int virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, va_list args)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_SENTINEL;
+int virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, va_list args);
int virJSONValueObjectAdd(virJSONValuePtr obj, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
-int virJSONValueObjectAddVArgs(virJSONValuePtr obj, va_list args)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_SENTINEL;
+int virJSONValueObjectAddVArgs(virJSONValuePtr obj, va_list args);
virJSONValuePtr virJSONValueNewString(const char *data);
@@ -136,8 +134,7 @@ int virJSONValueGetNumberLong(virJSONValuePtr object, long long *value);
int virJSONValueGetNumberUlong(virJSONValuePtr object, unsigned long long *value);
int virJSONValueGetNumberDouble(virJSONValuePtr object, double *value);
int virJSONValueGetBoolean(virJSONValuePtr object, bool *value);
-int virJSONValueGetArrayAsBitmap(const virJSONValue *val, virBitmapPtr *bitmap)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+int virJSONValueGetArrayAsBitmap(const virJSONValue *val, virBitmapPtr *bitmap);
bool virJSONValueIsNull(virJSONValuePtr object);
virJSONValuePtr virJSONValueObjectGetObject(virJSONValuePtr object,
const char *key);
@@ -165,8 +162,7 @@ int virJSONValueObjectAppendBoolean(virJSONValuePtr object, const char *key, int
int virJSONValueObjectAppendNull(virJSONValuePtr object, const char *key);
int virJSONValueObjectRemoveKey(virJSONValuePtr object, const char *key,
- virJSONValuePtr *value)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virJSONValuePtr *value);
virJSONValuePtr virJSONValueFromString(const char *jsonstring);
char *virJSONValueToString(virJSONValuePtr object,
diff --git a/src/util/virkeyfile.h b/src/util/virkeyfile.h
index e6f5ba872dc2..99fea952c6da 100644
--- a/src/util/virkeyfile.h
+++ b/src/util/virkeyfile.h
@@ -37,28 +37,25 @@ virKeyFilePtr virKeyFileNew(void);
int virKeyFileLoadFile(virKeyFilePtr conf,
const char *filename)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virKeyFileLoadData(virKeyFilePtr conf,
const char *filename,
const char *data,
size_t len)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
void virKeyFileFree(virKeyFilePtr conf);
bool virKeyFileHasGroup(virKeyFilePtr conf,
- const char *groupname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *groupname);
bool virKeyFileHasValue(virKeyFilePtr conf,
const char *groupname,
- const char *valuename)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *valuename);
const char *virKeyFileGetValueString(virKeyFilePtr conf,
const char *groupname,
- const char *valuename)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *valuename);
#endif /* __VIR_KEYFILE_H__ */
diff --git a/src/util/virkmod.h b/src/util/virkmod.h
index 608f1b884e7c..fe805078ec6e 100644
--- a/src/util/virkmod.h
+++ b/src/util/virkmod.h
@@ -25,10 +25,7 @@
# include "internal.h"
char *virKModConfig(void);
-char *virKModLoad(const char *, bool)
- ATTRIBUTE_NONNULL(1);
-char *virKModUnload(const char *)
- ATTRIBUTE_NONNULL(1);
-bool virKModIsBlacklisted(const char *)
- ATTRIBUTE_NONNULL(1);
+char *virKModLoad(const char *, bool);
+char *virKModUnload(const char *);
+bool virKModIsBlacklisted(const char *);
#endif /* __VIR_KMOD_H__ */
diff --git a/src/util/virlog.h b/src/util/virlog.h
index cc09f484afe9..c05da1e8d99f 100644
--- a/src/util/virlog.h
+++ b/src/util/virlog.h
@@ -223,20 +223,20 @@ virLogOutputPtr virLogOutputNew(virLogOutputFunc f,
void *data,
virLogPriority priority,
virLogDestination dest,
- const char *name) ATTRIBUTE_NONNULL(1);
+ const char *name);
virLogFilterPtr virLogFilterNew(const char *match,
virLogPriority priority,
- unsigned int flags) ATTRIBUTE_NONNULL(1);
+ unsigned int flags);
int virLogFindOutput(virLogOutputPtr *outputs, size_t noutputs,
virLogDestination dest, const void *opaque);
int virLogDefineOutputs(virLogOutputPtr *outputs,
- size_t noutputs) ATTRIBUTE_NONNULL(1);
+ size_t noutputs);
int virLogDefineFilters(virLogFilterPtr *filters, size_t nfilters);
-virLogOutputPtr virLogParseOutput(const char *src) ATTRIBUTE_NONNULL(1);
-virLogFilterPtr virLogParseFilter(const char *src) ATTRIBUTE_NONNULL(1);
+virLogOutputPtr virLogParseOutput(const char *src);
+virLogFilterPtr virLogParseFilter(const char *src);
int virLogParseOutputs(const char *src,
- virLogOutputPtr **outputs) ATTRIBUTE_NONNULL(1);
+ virLogOutputPtr **outputs);
int virLogParseFilters(const char *src,
- virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1);
+ virLogFilterPtr **filters);
#endif
diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h
index ae26867d4d33..f51415e01837 100644
--- a/src/util/virmacaddr.h
+++ b/src/util/virmacaddr.h
@@ -53,7 +53,7 @@ int virMacAddrParse(const char* str,
virMacAddrPtr addr) ATTRIBUTE_RETURN_CHECK;
int virMacAddrParseHex(const char* str,
virMacAddrPtr addr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
bool virMacAddrIsUnicast(const virMacAddr *addr);
bool virMacAddrIsMulticast(const virMacAddr *addr);
bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]);
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 437a776257b6..fa9a0aba85ee 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -117,87 +117,84 @@ int virNetDevSetupControl(const char *ifname,
ATTRIBUTE_RETURN_CHECK;
int virNetDevExists(const char *brname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetOnline(const char *ifname,
bool online)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetOnline(const char *ifname,
bool *online)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetMAC(const char *ifname,
const virMacAddr *macaddr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetMAC(const char *ifname,
virMacAddrPtr macaddr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevReplaceMacAddress(const char *linkdev,
const virMacAddr *macaddress,
const char *stateDir)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevRestoreMacAddress(const char *linkdev,
const char *stateDir)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetMTU(const char *ifname,
int mtu)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetMTUFromDevice(const char *ifname,
const char *otherifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetMTU(const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetNamespace(const char *ifname, pid_t pidInNs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetName(const char *ifname, const char *newifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virNetDevGetName(int ifindex)
ATTRIBUTE_RETURN_CHECK;
int virNetDevGetIndex(const char *ifname, int *ifindex)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetVLanID(const char *ifname, int *vlanid)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetMaster(const char *ifname, char **master)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevValidateConfig(const char *ifname,
const virMacAddr *macaddr, int ifindex)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevIsVirtualFunction(const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetVirtualFunctionIndex(const char *pfname, const char *vfname,
int *vf_index)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevGetPhysicalFunction(const char *ifname, char **pfname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevPFGetVF(const char *pfname, int vf, char **vfname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetVirtualFunctions(const char *pfname,
char ***vfname,
virPCIDeviceAddressPtr **virt_fns,
size_t *n_vfname,
unsigned int *max_vfs)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSaveNetConfig(const char *linkdev, int vf,
const char *stateDir,
bool saveVlan)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int
virNetDevReadNetConfig(const char *linkdev, int vf,
@@ -205,8 +202,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
virMacAddrPtr *adminMAC,
virNetDevVlanPtr *vlan,
virMacAddrPtr *MAC)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
- ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int
virNetDevSetNetConfig(const char *linkdev, int vf,
@@ -214,55 +210,52 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
virNetDevVlanPtr vlan,
const virMacAddr *MAC,
bool setVLan)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
- int *vf)
- ATTRIBUTE_NONNULL(1);
+ int *vf);
int virNetDevGetFeatures(const char *ifname,
virBitmapPtr *out)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetLinkInfo(const char *ifname,
- virNetDevIfLinkPtr lnk)
- ATTRIBUTE_NONNULL(1);
+ virNetDevIfLinkPtr lnk);
virNetDevRxFilterPtr virNetDevRxFilterNew(void)
ATTRIBUTE_RETURN_CHECK;
void virNetDevRxFilterFree(virNetDevRxFilterPtr filter);
int virNetDevGetRxFilter(const char *ifname,
virNetDevRxFilterPtr *filter)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevAddMulti(const char *ifname,
virMacAddrPtr macaddr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevDelMulti(const char *ifname,
virMacAddrPtr macaddr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetPromiscuous(const char *ifname, bool promiscuous)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetPromiscuous(const char *ifname, bool *promiscuous)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetRcvMulti(const char *ifname, bool receive)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetRcvMulti(const char *ifname, bool *receive)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevSetRcvAllMulti(const char *ifname, bool receive)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevGetRcvAllMulti(const char *ifname, bool *receive)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
# define SYSFS_NET_DIR "/sys/class/net/"
# define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/"
int virNetDevSysfsFile(char **pf_sysfs_device_link,
const char *ifname,
const char *file)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevRunEthernetScript(const char *ifname, const char *script);
diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index 4e4ac617beb9..494719dd966c 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -97,7 +97,7 @@ virNetDevBandwidthCmdAddOptimalQuantum(virCommandPtr cmd,
* Returns: 0 on success,
* -1 otherwise (with error reported).
*/
-static int ATTRIBUTE_NONNULL(1)
+static int
virNetDevBandwidthManipulateFilter(const char *ifname,
const virMacAddr *ifmac_ptr,
unsigned int id,
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index 64f35372e484..c8c326cd818a 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -50,7 +50,7 @@ int virNetDevBandwidthSet(const char *ifname,
int virNetDevBandwidthClear(const char *ifname);
int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
const virNetDevBandwidth *src)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPtr b);
@@ -59,22 +59,20 @@ int virNetDevBandwidthPlug(const char *brname,
const virMacAddr *ifmac_ptr,
virNetDevBandwidthPtr bandwidth,
unsigned int id)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_RETURN_CHECK;
int virNetDevBandwidthUnplug(const char *brname,
unsigned int id)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBandwidthUpdateRate(const char *ifname,
unsigned int id,
virNetDevBandwidthPtr bandwidth,
unsigned long long new_rate)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBandwidthUpdateFilter(const char *ifname,
const virMacAddr *ifmac_ptr,
unsigned int id)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_BANDWIDTH_H__ */
diff --git a/src/util/virnetdevbridge.h b/src/util/virnetdevbridge.h
index 141f231c901f..44c9a8f4d251 100644
--- a/src/util/virnetdevbridge.h
+++ b/src/util/virnetdevbridge.h
@@ -27,56 +27,54 @@
# include "virmacaddr.h"
int virNetDevBridgeCreate(const char *brname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeDelete(const char *brname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeAddPort(const char *brname,
const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeRemovePort(const char *brname,
const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeSetSTPDelay(const char *brname,
int delay)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeGetSTPDelay(const char *brname,
int *delay)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeSetSTP(const char *brname,
bool enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeGetSTP(const char *brname,
bool *enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeSetVlanFiltering(const char *brname,
bool enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeGetVlanFiltering(const char *brname,
bool *enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgePortGetLearning(const char *brname,
const char *ifname,
bool *enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgePortSetLearning(const char *brname,
const char *ifname,
bool enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgePortGetUnicastFlood(const char *brname,
const char *ifname,
bool *enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgePortSetUnicastFlood(const char *brname,
const char *ifname,
bool enable)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
typedef enum {
VIR_NETDEVBRIDGE_FDB_FLAG_ROUTER = (1 << 0),
@@ -89,8 +87,8 @@ typedef enum {
int virNetDevBridgeFDBAdd(const virMacAddr *mac, const char *ifname,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevBridgeFDBDel(const virMacAddr *mac, const char *ifname,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_BRIDGE_H__ */
diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h
index cc466ca25969..3d66ddd6b644 100644
--- a/src/util/virnetdevip.h
+++ b/src/util/virnetdevip.h
@@ -67,22 +67,20 @@ int virNetDevIPAddrAdd(const char *ifname,
virSocketAddr *addr,
virSocketAddr *peer,
unsigned int prefix)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevIPRouteAdd(const char *ifname,
virSocketAddrPtr addr,
unsigned int prefix,
virSocketAddrPtr gateway,
unsigned int metric)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_RETURN_CHECK;
int virNetDevIPAddrDel(const char *ifname,
virSocketAddr *addr,
unsigned int prefix)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevIPAddrGet(const char *ifname, virSocketAddrPtr addr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-int virNetDevIPWaitDadFinish(virSocketAddrPtr *addrs, size_t count)
- ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
+int virNetDevIPWaitDadFinish(virSocketAddrPtr *addrs, size_t count);
bool virNetDevIPCheckIPv6Forwarding(void);
/* virNetDevIPRoute object */
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index c40f23ed2e9a..1fdd860042af 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -42,13 +42,13 @@ typedef enum {
VIR_ENUM_DECL(virNetDevMacVLanMode)
typedef enum {
- VIR_NETDEV_MACVLAN_CREATE_NONE = 0,
- /* Create with a tap device */
- VIR_NETDEV_MACVLAN_CREATE_WITH_TAP = 1 << 0,
- /* Bring the interface up */
- VIR_NETDEV_MACVLAN_CREATE_IFUP = 1 << 1,
- /* Enable VNET_HDR */
- VIR_NETDEV_MACVLAN_VNET_HDR = 1 << 2,
+ VIR_NETDEV_MACVLAN_CREATE_NONE = 0,
+ /* Create with a tap device */
+ VIR_NETDEV_MACVLAN_CREATE_WITH_TAP = 1 << 0,
+ /* Bring the interface up */
+ VIR_NETDEV_MACVLAN_CREATE_IFUP = 1 << 1,
+ /* Enable VNET_HDR */
+ VIR_NETDEV_MACVLAN_VNET_HDR = 1 << 2,
} virNetDevMacVLanCreateFlags;
int virNetDevMacVLanReserveName(const char *name, bool quietfail);
@@ -60,11 +60,10 @@ int virNetDevMacVLanCreate(const char *ifname,
const char *srcdev,
uint32_t macvlan_mode,
int *retry)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanDelete(const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
const virMacAddr *macaddress,
@@ -79,8 +78,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
int *tapfd,
size_t tapfdSize,
unsigned int flags)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6)
- ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) ATTRIBUTE_RETURN_CHECK;
+ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
const virMacAddr *macaddress,
@@ -88,8 +86,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
int mode,
virNetDevVPortProfilePtr virtPortProfile,
char *stateDir)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const virMacAddr *macaddress,
@@ -97,8 +94,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVPortProfileOp vmOp)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const virMacAddr *macaddress,
@@ -106,6 +102,5 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVPortProfileOp vmOp)
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ATTRIBUTE_RETURN_CHECK;
#endif /* __UTIL_MACVTAP_H__ */
diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h
index 3bfc1f6e6790..7e5878e56bfe 100644
--- a/src/util/virnetdevmidonet.h
+++ b/src/util/virnetdevmidonet.h
@@ -28,9 +28,9 @@
int virNetDevMidonetBindPort(const char *ifname,
virNetDevVPortProfilePtr virtualport)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_MIDONET_H__ */
diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h
index 7380a2d84bc3..52d1abd683f7 100644
--- a/src/util/virnetdevopenvswitch.h
+++ b/src/util/virnetdevopenvswitch.h
@@ -41,24 +41,23 @@ int virNetDevOpenvswitchAddPort(const char *brname,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr ovsport,
virNetDevVlanPtr virtVlan)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevOpenvswitchRemovePort(const char *brname, const char *ifname)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevOpenvswitchInterfaceStats(const char *ifname,
virDomainInterfaceStatsPtr stats)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevOpenvswitchGetVhostuserIfname(const char *path,
char **ifname)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_OPENVSWITCH_H__ */
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
index 6bb3b8891c21..25f070231ac8 100644
--- a/src/util/virnetdevtap.h
+++ b/src/util/virnetdevtap.h
@@ -38,17 +38,17 @@ int virNetDevTapCreate(char **ifname,
int *tapfd,
size_t tapfdSize,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevTapDelete(const char *ifname,
const char *tunpath)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevTapGetName(int tapfd, char **ifname)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char* virNetDevTapGetRealDeviceName(char *ifname)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
typedef enum {
VIR_NETDEV_TAP_CREATE_NONE = 0,
@@ -71,7 +71,6 @@ virNetDevTapAttachBridge(const char *tapname,
virNetDevVlanPtr virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevTapCreateInBridgePort(const char *brname,
@@ -86,11 +85,10 @@ int virNetDevTapCreateInBridgePort(const char *brname,
unsigned int mtu,
unsigned int *actualMTU,
unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevTapInterfaceStats(const char *ifname,
virDomainInterfaceStatsPtr stats)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_TAP_H__ */
diff --git a/src/util/virnetdevveth.h b/src/util/virnetdevveth.h
index 4c220c1b02bc..0892bae1f093 100644
--- a/src/util/virnetdevveth.h
+++ b/src/util/virnetdevveth.h
@@ -28,8 +28,8 @@
/* Function declarations */
int virNetDevVethCreate(char **veth1, char **veth2)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevVethDelete(const char *veth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_VETH_H__ */
diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h
index b706c411934e..f509e6b723d3 100644
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -101,7 +101,7 @@ int virNetDevVPortProfileAssociate(const char *ifname,
const unsigned char *vmuuid,
virNetDevVPortProfileOp vmOp,
bool setlink_only)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virNetDevVPortProfileDisassociate(const char *ifname,
const virNetDevVPortProfile *virtPort,
@@ -109,7 +109,7 @@ int virNetDevVPortProfileDisassociate(const char *ifname,
const char *linkdev,
int vf,
virNetDevVPortProfileOp vmOp)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_NETDEV_VPORT_PROFILE_H__ */
diff --git a/src/util/virnuma.h b/src/util/virnuma.h
index f3eef324a497..6357d4dcc12a 100644
--- a/src/util/virnuma.h
+++ b/src/util/virnuma.h
@@ -58,8 +58,7 @@ int virNumaGetPages(int node,
unsigned int **pages_size,
unsigned int **pages_avail,
unsigned int **pages_free,
- size_t *npages)
- ATTRIBUTE_NONNULL(5);
+ size_t *npages);
int virNumaSetPagePoolSize(int node,
unsigned int page_size,
unsigned long long page_count,
diff --git a/src/util/virobject.h b/src/util/virobject.h
index c3ecc1ef672a..d651b1c76eb1 100644
--- a/src/util/virobject.h
+++ b/src/util/virobject.h
@@ -63,41 +63,30 @@ struct _virObjectLockable {
virClassPtr virClassForObject(void);
virClassPtr virClassForObjectLockable(void);
-# ifndef VIR_PARENT_REQUIRED
-# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1)
-# endif
virClassPtr virClassNew(virClassPtr parent,
const char *name,
size_t objectSize,
- virObjectDisposeCallback dispose)
- VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(2);
+ virObjectDisposeCallback dispose);
-const char *virClassName(virClassPtr klass)
- ATTRIBUTE_NONNULL(1);
+const char *virClassName(virClassPtr klass);
bool virClassIsDerivedFrom(virClassPtr klass,
- virClassPtr parent)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virClassPtr parent);
-void *virObjectNew(virClassPtr klass)
- ATTRIBUTE_NONNULL(1);
+void *virObjectNew(virClassPtr klass);
bool virObjectUnref(void *obj);
void *virObjectRef(void *obj);
bool virObjectIsClass(void *obj,
- virClassPtr klass)
- ATTRIBUTE_NONNULL(2);
+ virClassPtr klass);
void virObjectFreeCallback(void *opaque);
void virObjectFreeHashData(void *opaque, const void *name);
-void *virObjectLockableNew(virClassPtr klass)
- ATTRIBUTE_NONNULL(1);
+void *virObjectLockableNew(virClassPtr klass);
-void virObjectLock(void *lockableobj)
- ATTRIBUTE_NONNULL(1);
-void virObjectUnlock(void *lockableobj)
- ATTRIBUTE_NONNULL(1);
+void virObjectLock(void *lockableobj);
+void virObjectUnlock(void *lockableobj);
void virObjectListFree(void *list);
void virObjectListFreeCount(void *list, size_t count);
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 8637c2c68513..3d01e9ca9ca7 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -217,7 +217,7 @@ int virPCIGetAddrString(unsigned int domain,
unsigned int slot,
unsigned int function,
char **pciConfigAddr)
- ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf);
diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h
index eb6516ca1503..4c4b9ab1825d 100644
--- a/src/util/virpidfile.h
+++ b/src/util/virpidfile.h
@@ -74,6 +74,6 @@ int virPidFileConstructPath(bool privileged,
const char *progname,
char **pidfile);
-int virPidFileForceCleanupPath(const char *path) ATTRIBUTE_NONNULL(1);
+int virPidFileForceCleanupPath(const char *path);
#endif /* __VIR_PIDFILE_H__ */
diff --git a/src/util/virqemu.h b/src/util/virqemu.h
index 10aeb67f4ecc..d8e77e59fe28 100644
--- a/src/util/virqemu.h
+++ b/src/util/virqemu.h
@@ -53,7 +53,6 @@ void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
void virQEMUBuildBufferEscape(virBufferPtr buf, const char *str);
void virQEMUBuildLuksOpts(virBufferPtr buf,
virStorageEncryptionInfoDefPtr enc,
- const char *alias)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *alias);
#endif /* __VIR_QEMU_H_ */
diff --git a/src/util/virrandom.h b/src/util/virrandom.h
index f457d2de66cd..1744fa5b6e6f 100644
--- a/src/util/virrandom.h
+++ b/src/util/virrandom.h
@@ -28,7 +28,7 @@ uint64_t virRandomBits(int nbits);
double virRandom(void);
uint32_t virRandomInt(uint32_t max);
int virRandomBytes(unsigned char *buf, size_t buflen)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virRandomGenerateWWN(char **wwn, const char *virt_type);
#endif /* __VIR_RANDOM_H__ */
diff --git a/src/util/virscsihost.h b/src/util/virscsihost.h
index c35ccb9f501d..7e1095da13be 100644
--- a/src/util/virscsihost.h
+++ b/src/util/virscsihost.h
@@ -28,8 +28,7 @@ char *virSCSIHostFindByPCI(const char *sysfs_prefix,
unsigned int unique_id);
int virSCSIHostGetNumber(const char *adapter_name,
- unsigned int *result)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ unsigned int *result);
char *virSCSIHostGetNameByParentaddr(unsigned int domain,
unsigned int bus,
diff --git a/src/util/virseclabel.h b/src/util/virseclabel.h
index 94c4dfc39634..5b13d13fde0a 100644
--- a/src/util/virseclabel.h
+++ b/src/util/virseclabel.h
@@ -62,8 +62,7 @@ virSecurityDeviceLabelDefPtr
virSecurityDeviceLabelDefNew(const char *model);
virSecurityDeviceLabelDefPtr
-virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabelDef *src)
- ATTRIBUTE_NONNULL(1);
+virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabelDef *src);
void virSecurityLabelDefFree(virSecurityLabelDefPtr def);
void virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def);
diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h
index 43a370620e71..0c4d456ebf4e 100644
--- a/src/util/virsocketaddr.h
+++ b/src/util/virsocketaddr.h
@@ -142,7 +142,6 @@ bool virSocketAddrIsNumericLocalhost(const char *addr);
int virSocketAddrPTRDomain(const virSocketAddr *addr,
unsigned int prefix,
- char **ptr)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ char **ptr);
#endif /* __VIR_SOCKETADDR_H__ */
diff --git a/src/util/virstorageencryption.h b/src/util/virstorageencryption.h
index fa439fb7237a..564e89ae9f62 100644
--- a/src/util/virstorageencryption.h
+++ b/src/util/virstorageencryption.h
@@ -77,8 +77,7 @@ struct _virStorageEncryption {
virStorageEncryptionInfoDef encinfo;
};
-virStorageEncryptionPtr virStorageEncryptionCopy(const virStorageEncryption *src)
- ATTRIBUTE_NONNULL(1);
+virStorageEncryptionPtr virStorageEncryptionCopy(const virStorageEncryption *src);
void virStorageEncryptionFree(virStorageEncryptionPtr enc);
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 9ebfc1108141..a4a492db30d3 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -292,8 +292,7 @@ int virStorageFileProbeFormat(const char *path, uid_t uid, gid_t gid);
int virStorageFileGetMetadataInternal(virStorageSourcePtr meta,
char *buf,
size_t len,
- int *backingFormat)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
+ int *backingFormat);
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
int fd,
@@ -303,27 +302,23 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
char *buf,
size_t len,
int format,
- int *backingFormat)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ int *backingFormat);
int virStorageFileChainGetBroken(virStorageSourcePtr chain,
char **broken_file);
int virStorageFileParseChainIndex(const char *diskTarget,
const char *name,
- unsigned int *chainIndex)
- ATTRIBUTE_NONNULL(3);
+ unsigned int *chainIndex);
int virStorageFileParseBackingStoreStr(const char *str,
char **target,
- unsigned int *chainIndex)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+ unsigned int *chainIndex);
virStorageSourcePtr virStorageFileChainLookup(virStorageSourcePtr chain,
virStorageSourcePtr startFrom,
const char *name,
unsigned int idx,
- virStorageSourcePtr *parent)
- ATTRIBUTE_NONNULL(1);
+ virStorageSourcePtr *parent);
int virStorageFileResize(const char *path,
unsigned long long capacity,
@@ -373,12 +368,10 @@ int virStorageSourceUpdateCapacity(virStorageSourcePtr src,
virStorageSourcePtr virStorageSourceNewFromBacking(virStorageSourcePtr parent);
virStorageSourcePtr virStorageSourceCopy(const virStorageSource *src,
- bool backingChain)
- ATTRIBUTE_NONNULL(1);
+ bool backingChain);
int virStorageSourceParseRBDColonString(const char *rbdstr,
- virStorageSourcePtr src)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ virStorageSourcePtr src);
typedef int
(*virStorageFileSimplifyPathReadlinkCallback)(const char *path,
@@ -390,8 +383,7 @@ char *virStorageFileCanonicalizePath(const char *path,
int virStorageFileGetRelativeBackingPath(virStorageSourcePtr from,
virStorageSourcePtr to,
- char **relpath)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ char **relpath);
int virStorageFileCheckCompat(const char *compat);
@@ -402,7 +394,6 @@ bool virStorageSourceIsRelative(virStorageSourcePtr src);
virStorageSourcePtr
virStorageSourceFindByNodeName(virStorageSourcePtr top,
const char *nodeName,
- unsigned int *index)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ unsigned int *index);
#endif /* __VIR_STORAGE_FILE_H__ */
diff --git a/src/util/virstring.h b/src/util/virstring.h
index a5550e30d2e2..5cc2d73d8711 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -29,17 +29,14 @@
char **virStringSplitCount(const char *string,
const char *delim,
size_t max_tokens,
- size_t *tokcount)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ size_t *tokcount);
char **virStringSplit(const char *string,
const char *delim,
- size_t max_tokens)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ size_t max_tokens);
char *virStringListJoin(const char **strings,
- const char *delim)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ const char *delim);
char **virStringListAdd(const char **strings,
const char *item);
@@ -53,8 +50,7 @@ void virStringListFreeCount(char **strings,
bool virStringListHasString(const char **strings,
const char *needle);
char *virStringListGetFirstWithPrefix(char **strings,
- const char *prefix)
- ATTRIBUTE_NONNULL(2);
+ const char *prefix);
char *virArgvToString(const char *const *argv);
@@ -109,11 +105,10 @@ int virStrToDouble(char const *s,
double *result)
ATTRIBUTE_RETURN_CHECK;
-void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1);
-void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1);
-void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1);
-void virSkipSpacesBackwards(const char *str, char **endp)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+void virSkipSpaces(const char **str);
+void virSkipSpacesAndBackslash(const char **str);
+void virTrimSpaces(char *str, char **endp);
+void virSkipSpacesBackwards(const char *str, char **endp);
bool virStringIsEmpty(const char *str);
@@ -126,21 +121,19 @@ char *virStrcpy(char *dest, const char *src, size_t destbytes)
/* Don't call these directly - use the macros below */
int virStrdup(char **dest, const char *src, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
int virStrndup(char **dest, const char *src, ssize_t n, bool report, int domcode,
const char *filename, const char *funcname, size_t linenr)
- ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+ ATTRIBUTE_RETURN_CHECK;
int virAsprintfInternal(bool report, int domcode, const char *filename,
const char *funcname, size_t linenr, char **strp,
const char *fmt, ...)
- ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7) ATTRIBUTE_FMT_PRINTF(7, 8)
- ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_FMT_PRINTF(7, 8) ATTRIBUTE_RETURN_CHECK;
int virVasprintfInternal(bool report, int domcode, const char *filename,
const char *funcname, size_t linenr, char **strp,
const char *fmt, va_list list)
- ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7) ATTRIBUTE_FMT_PRINTF(7, 0)
- ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_FMT_PRINTF(7, 0) ATTRIBUTE_RETURN_CHECK;
/**
* VIR_STRDUP:
@@ -271,13 +264,11 @@ int virStringToUpper(char **dst, const char *src);
ssize_t virStringSearch(const char *str,
const char *regexp,
size_t max_results,
- char ***matches)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
+ char ***matches);
char *virStringReplace(const char *haystack,
const char *oldneedle,
- const char *newneedle)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *newneedle);
void virStringStripIPv6Brackets(char *str);
bool virStringHasControlChars(const char *str);
diff --git a/src/util/virsysinfo.h b/src/util/virsysinfo.h
index 1e51d2cafa7e..70f4b3ae96f3 100644
--- a/src/util/virsysinfo.h
+++ b/src/util/virsysinfo.h
@@ -123,8 +123,7 @@ void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def);
void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def);
void virSysinfoDefFree(virSysinfoDefPtr def);
-int virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+int virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def);
bool virSysinfoIsEqual(virSysinfoDefPtr src,
virSysinfoDefPtr dst);
diff --git a/src/util/virthread.h b/src/util/virthread.h
index e466d9bf0184..a3f677ccefa6 100644
--- a/src/util/virthread.h
+++ b/src/util/virthread.h
@@ -125,7 +125,7 @@ unsigned long long virThreadID(virThreadPtr thread);
* }
*/
int virOnce(virOnceControlPtr once, virOnceFunc init)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virMutexInit(virMutexPtr m) ATTRIBUTE_RETURN_CHECK;
int virMutexInitRecursive(virMutexPtr m) ATTRIBUTE_RETURN_CHECK;
diff --git a/src/util/virthreadpool.h b/src/util/virthreadpool.h
index e1f362f5bb60..c3a91ea910fd 100644
--- a/src/util/virthreadpool.h
+++ b/src/util/virthreadpool.h
@@ -41,7 +41,7 @@ virThreadPoolPtr virThreadPoolNewFull(size_t minWorkers,
size_t prioWorkers,
virThreadPoolJobFunc func,
const char *funcName,
- void *opaque) ATTRIBUTE_NONNULL(4);
+ void *opaque);
size_t virThreadPoolGetMinWorkers(virThreadPoolPtr pool);
size_t virThreadPoolGetMaxWorkers(virThreadPoolPtr pool);
@@ -54,8 +54,7 @@ void virThreadPoolFree(virThreadPoolPtr pool);
int virThreadPoolSendJob(virThreadPoolPtr pool,
unsigned int priority,
- void *jobdata) ATTRIBUTE_NONNULL(1)
- ATTRIBUTE_RETURN_CHECK;
+ void *jobdata) ATTRIBUTE_RETURN_CHECK;
int virThreadPoolSetParameters(virThreadPoolPtr pool,
long long int minWorkers,
diff --git a/src/util/virtime.h b/src/util/virtime.h
index fbcd3ba66768..3492f30211fa 100644
--- a/src/util/virtime.h
+++ b/src/util/virtime.h
@@ -37,32 +37,31 @@
(4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 3 + 5 + 1)
/* Yr Mon Day Hour Min Sec Ms TZ NULL */
-void virTimeFieldsThen(unsigned long long when, struct tm *fields)
- ATTRIBUTE_NONNULL(2);
+void virTimeFieldsThen(unsigned long long when, struct tm *fields);
/* These APIs are async signal safe and return -1, setting
* errno on failure */
int virTimeMillisNowRaw(unsigned long long *now)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virTimeFieldsNowRaw(struct tm *fields)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virTimeStringNowRaw(char *buf)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virTimeStringThenRaw(unsigned long long when, char *buf)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
/* These APIs are *not* async signal safe and return -1,
* raising a libvirt error on failure
*/
int virTimeMillisNow(unsigned long long *now)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virTimeFieldsNow(struct tm *fields)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virTimeStringNow(void);
char *virTimeStringThen(unsigned long long when);
int virTimeLocalOffsetFromUTC(long *offset)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
typedef struct {
unsigned long long start_t;
diff --git a/src/util/viruri.h b/src/util/viruri.h
index 1e53abb0bc21..553cb7bbd971 100644
--- a/src/util/viruri.h
+++ b/src/util/viruri.h
@@ -52,10 +52,8 @@ struct _virURI {
virURIParamPtr params;
};
-virURIPtr virURIParse(const char *uri)
- ATTRIBUTE_NONNULL(1);
-char *virURIFormat(virURIPtr uri)
- ATTRIBUTE_NONNULL(1);
+virURIPtr virURIParse(const char *uri);
+char *virURIFormat(virURIPtr uri);
char *virURIFormatParams(virURIPtr uri);
diff --git a/src/util/virutil.h b/src/util/virutil.h
index e097b77212fc..46a3339f4a01 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -55,7 +55,7 @@ void virWaitForDevices(void);
int virScaleInteger(unsigned long long *value, const char *suffix,
unsigned long long scale, unsigned long long limit)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virHexToBin(unsigned char c);
@@ -64,10 +64,10 @@ int virParseVersionString(const char *str, unsigned long *version,
bool allowMissing);
int virDoubleToStr(char **strp, double number)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
char *virFormatIntDecimal(char *buf, size_t buflen, int val)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int virDiskNameParse(const char *name, int *disk, int *partition);
int virDiskNameToIndex(const char* str);
@@ -144,14 +144,13 @@ char *virGetUserRuntimeDirectory(void);
char *virGetUserShell(uid_t uid);
char *virGetUserName(uid_t uid);
char *virGetGroupName(gid_t gid);
-int virGetGroupList(uid_t uid, gid_t group, gid_t **groups)
- ATTRIBUTE_NONNULL(3);
+int virGetGroupList(uid_t uid, gid_t group, gid_t **groups);
int virGetUserID(const char *name,
uid_t *uid) ATTRIBUTE_RETURN_CHECK;
int virGetGroupID(const char *name,
gid_t *gid) ATTRIBUTE_RETURN_CHECK;
-bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
+bool virIsDevMapperDevice(const char *dev_name);
bool virValidateWWN(const char *wwn);
diff --git a/src/util/viruuid.h b/src/util/viruuid.h
index 5790a173648e..d60754d810f0 100644
--- a/src/util/viruuid.h
+++ b/src/util/viruuid.h
@@ -45,7 +45,7 @@
int virSetHostUUIDStr(const char *host_uuid);
-int virGetHostUUID(unsigned char *host_uuid) ATTRIBUTE_NONNULL(1);
+int virGetHostUUID(unsigned char *host_uuid);
int virUUIDIsValid(unsigned char *uuid);
@@ -53,9 +53,9 @@ int virUUIDGenerate(unsigned char *uuid);
int virUUIDParse(const char *uuidstr,
unsigned char *uuid)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
const char *virUUIDFormat(const unsigned char *uuid,
- char *uuidstr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ char *uuidstr);
#endif /* __VIR_UUID_H__ */
diff --git a/src/util/virvhba.h b/src/util/virvhba.h
index 67b1fa5376a0..46a2e8d38cfd 100644
--- a/src/util/virvhba.h
+++ b/src/util/virvhba.h
@@ -35,8 +35,7 @@ virVHBAIsVportCapable(const char *sysfs_prefix, int host);
char *
virVHBAGetConfig(const char *sysfs_prefix,
int host,
- const char *entry)
- ATTRIBUTE_NONNULL(3);
+ const char *entry);
char *
virVHBAFindVportHost(const char *sysfs_prefix);
@@ -45,18 +44,15 @@ int
virVHBAManageVport(const int parent_host,
const char *wwpn,
const char *wwnn,
- int operation)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ int operation);
char *
virVHBAGetHostByWWN(const char *sysfs_prefix,
const char *wwnn,
- const char *wwpn)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ const char *wwpn);
char *
virVHBAGetHostByFabricWWN(const char *sysfs_prefix,
- const char *fabric_wwn)
- ATTRIBUTE_NONNULL(2);
+ const char *fabric_wwn);
#endif /* __VIR_VBHA_H__ */
diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h
index ea2e2da684cf..66435e594584 100644
--- a/src/vz/vz_utils.h
+++ b/src/vz/vz_utils.h
@@ -123,7 +123,7 @@ virDomainObjPtr vzDomObjFromDomain(virDomainPtr domain);
virDomainObjPtr vzDomObjFromDomainRef(virDomainPtr domain);
char * vzGetOutput(const char *binary, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
+ ATTRIBUTE_SENTINEL;
vzDriverPtr
vzGetDriverConnection(void);
diff --git a/src/xen/xen_hypervisor.h b/src/xen/xen_hypervisor.h
index f59847ff144c..04636bed84f0 100644
--- a/src/xen/xen_hypervisor.h
+++ b/src/xen/xen_hypervisor.h
@@ -73,64 +73,53 @@ int xenHypervisorGetMaxVcpus (virConnectPtr conn,
const char *type);
int xenHypervisorGetDomainInfo (virConnectPtr conn,
virDomainDefPtr def,
- virDomainInfoPtr info)
- ATTRIBUTE_NONNULL (1);
+ virDomainInfoPtr info);
int xenHypervisorGetDomainState (virConnectPtr conn,
virDomainDefPtr def,
int *state,
- int *reason)
- ATTRIBUTE_NONNULL (1);
+ int *reason);
int xenHypervisorGetDomInfo (virConnectPtr conn,
int id,
virDomainInfoPtr info);
int xenHypervisorSetMaxMemory (virConnectPtr conn,
virDomainDefPtr def,
- unsigned long memory)
- ATTRIBUTE_NONNULL (1);
+ unsigned long memory);
int xenHypervisorCheckID (virConnectPtr conn,
int id);
int xenHypervisorPinVcpu (virConnectPtr conn,
virDomainDefPtr def,
unsigned int vcpu,
unsigned char *cpumap,
- int maplen)
- ATTRIBUTE_NONNULL (1);
+ int maplen);
int xenHypervisorGetVcpus (virConnectPtr conn,
virDomainDefPtr def,
virVcpuInfoPtr info,
int maxinfo,
unsigned char *cpumaps,
- int maplen)
- ATTRIBUTE_NONNULL (1);
+ int maplen);
int xenHypervisorGetVcpuMax (virConnectPtr conn,
- virDomainDefPtr def)
- ATTRIBUTE_NONNULL (1);
+ virDomainDefPtr def);
char * xenHypervisorGetSchedulerType (virConnectPtr conn,
- int *nparams)
- ATTRIBUTE_NONNULL (1);
+ int *nparams);
int xenHypervisorGetSchedulerParameters(virConnectPtr conn,
virDomainDefPtr def,
virTypedParameterPtr params,
- int *nparams)
- ATTRIBUTE_NONNULL (1);
+ int *nparams);
int xenHypervisorSetSchedulerParameters(virConnectPtr conn,
virDomainDefPtr def,
virTypedParameterPtr params,
- int nparams)
- ATTRIBUTE_NONNULL (1);
+ int nparams);
int xenHypervisorDomainBlockStats (virConnectPtr conn,
virDomainDefPtr def,
const char *path,
- virDomainBlockStatsPtr stats)
- ATTRIBUTE_NONNULL (1);
+ virDomainBlockStatsPtr stats);
int xenHypervisorDomainInterfaceStats (virDomainDefPtr def,
const char *path,
- virDomainInterfaceStatsPtr stats)
- ATTRIBUTE_NONNULL (1);
+ virDomainInterfaceStatsPtr stats);
int xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
unsigned long long *freeMems,
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 605c3cdccf2a..23aca667e5e5 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -275,7 +275,7 @@ istartswith(const char *haystack, const char *needle)
* Returns the HTTP return code and @content is set to the
* allocated memory containing HTTP content.
*/
-static int ATTRIBUTE_NONNULL(2)
+static int
xend_req(int fd, char **content)
{
char *buffer;
@@ -344,7 +344,7 @@ xend_req(int fd, char **content)
*
* Returns the HTTP return code or -1 in case or error.
*/
-static int ATTRIBUTE_NONNULL(3)
+static int
xend_get(virConnectPtr xend, const char *path, char **content)
{
int ret;
@@ -873,7 +873,6 @@ xenDaemonDomainLookupByName_ids(virConnectPtr xend,
* Returns domain's state.
*/
static int
-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
sexpr_to_xend_domain_state(virDomainDefPtr def, const struct sexpr *root)
{
const char *flags;
diff --git a/tools/virsh-domain-monitor.h b/tools/virsh-domain-monitor.h
index 08ccab59029a..3aad579afbb0 100644
--- a/tools/virsh-domain-monitor.h
+++ b/tools/virsh-domain-monitor.h
@@ -30,7 +30,7 @@
char *virshGetDomainDescription(vshControl *ctl, virDomainPtr dom,
bool title, unsigned int flags)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
extern const vshCmdDef domMonitoringCmds[];
diff --git a/tools/vsh.c b/tools/vsh.c
index d2024be9188a..0c25c21d91e9 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -1577,7 +1577,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
* --------------------
*/
-static vshCommandToken ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+static vshCommandToken
vshCommandArgvGetArg(vshControl *ctl, vshCommandParser *parser, char **res,
bool report ATTRIBUTE_UNUSED)
{
@@ -1610,7 +1610,7 @@ vshCommandArgvParse(vshControl *ctl, int nargs, char **argv)
* ----------------------
*/
-static vshCommandToken ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+static vshCommandToken
vshCommandStringGetArg(vshControl *ctl, vshCommandParser *parser, char **res,
bool report)
{
diff --git a/tools/vsh.h b/tools/vsh.h
index 8f5d1a69f712..d9edeab7a7e9 100644
--- a/tools/vsh.h
+++ b/tools/vsh.h
@@ -259,40 +259,38 @@ const vshCmdGrp *vshCmdGrpSearch(const char *grpname);
bool vshCmdGrpHelp(vshControl *ctl, const char *name);
int vshCommandOptInt(vshControl *ctl, const vshCmd *cmd,
- const char *name, int *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ const char *name, int *value);
int vshCommandOptUInt(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned int *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptUIntWrap(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned int *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptUL(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned long *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptULWrap(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned long *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptStringQuiet(vshControl *ctl, const vshCmd *cmd,
const char *name, const char **value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptStringReq(vshControl *ctl, const vshCmd *cmd,
const char *name, const char **value)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptLongLong(vshControl *ctl, const vshCmd *cmd,
const char *name, long long *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptULongLong(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned long long *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptULongLongWrap(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned long long *value)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd,
const char *name, unsigned long long *value,
int scale, unsigned long long max)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+ ATTRIBUTE_RETURN_CHECK;
int vshBlockJobOptionBandwidth(vshControl *ctl,
const vshCmd *cmd,
bool bytes,
@@ -323,8 +321,7 @@ int vshNameSorter(const void *a, const void *b);
virTypedParameterPtr vshFindTypedParamByName(const char *name,
virTypedParameterPtr list,
int count);
-char *vshGetTypedParamValue(vshControl *ctl, virTypedParameterPtr item)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+char *vshGetTypedParamValue(vshControl *ctl, virTypedParameterPtr item);
double vshPrettyCapacity(unsigned long long val, const char **unit);
int vshStringToArray(const char *str, char ***array);
--
2.12.1
7 years, 7 months
[libvirt] [PATCH] leasetime support per <dhcp> and <host>
by Alberto Ruiz
Support for custom dhcp wide and per host leasetime.
It is specified as a child tag for <dhcp>:
<dhcp>
<leasetime>24h</leasetime>
...
</dhcp>
And as an attribute for <host>:
<dhcp>
<host leasetime="7d" .../>
</dhcp>
These are the different notations:
-1 (infinite/unlimited lease)
120 (seconds are the default unit, 120 seconds is the minimum, if less is
specified it will use 120)
300s (seconds)
5m (minutes)
24h (hours)
7d (days)
---
docs/schemas/basictypes.rng | 5 +
docs/schemas/network.rng | 8 ++
src/conf/network_conf.c | 86 +++++++++++++-
src/conf/network_conf.h | 4 +-
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 132
+++++++++++++++++----
src/network/bridge_driver.h | 1 +
src/util/virdnsmasq.c | 106 +++++++++++------
src/util/virdnsmasq.h | 2 +
.../dhcp6-nat-network.hostsfile | 7 ++
tests/networkxml2confdata/dhcp6-network.hostsfile | 5 +
.../dhcp6host-routed-network.hostsfile | 7 ++
tests/networkxml2confdata/leasetime-days.conf | 17 +++
tests/networkxml2confdata/leasetime-days.xml | 18 +++
tests/networkxml2confdata/leasetime-host.conf | 16 +++
tests/networkxml2confdata/leasetime-host.hostsfile | 6 +
tests/networkxml2confdata/leasetime-host.xml | 22 ++++
tests/networkxml2confdata/leasetime-hours.conf | 17 +++
tests/networkxml2confdata/leasetime-hours.xml | 18 +++
tests/networkxml2confdata/leasetime-infinite.conf | 17 +++
tests/networkxml2confdata/leasetime-infinite.xml | 18 +++
tests/networkxml2confdata/leasetime-minutes.conf | 17 +++
tests/networkxml2confdata/leasetime-minutes.xml | 18 +++
tests/networkxml2confdata/leasetime-seconds.conf | 17 +++
tests/networkxml2confdata/leasetime-seconds.xml | 18 +++
tests/networkxml2confdata/leasetime.conf | 17 +++
tests/networkxml2confdata/leasetime.xml | 18 +++
.../nat-network-dns-srv-record-minimal.hostsfile | 2 +
.../nat-network-dns-srv-record.hostsfile | 2 +
.../nat-network-dns-txt-record.hostsfile | 2 +
.../nat-network-name-with-quotes.hostsfile | 2 +
tests/networkxml2confdata/nat-network.hostsfile | 2 +
tests/networkxml2conftest.c | 47 ++++++--
33 files changed, 597 insertions(+), 78 deletions(-)
create mode 100644 tests/networkxml2confdata/dhcp6-nat-network.hostsfile
create mode 100644 tests/networkxml2confdata/dhcp6-network.hostsfile
create mode 100644 tests/networkxml2confdata/dhcp6host-routed-network.
hostsfile
create mode 100644 tests/networkxml2confdata/leasetime-days.conf
create mode 100644 tests/networkxml2confdata/leasetime-days.xml
create mode 100644 tests/networkxml2confdata/leasetime-host.conf
create mode 100644 tests/networkxml2confdata/leasetime-host.hostsfile
create mode 100644 tests/networkxml2confdata/leasetime-host.xml
create mode 100644 tests/networkxml2confdata/leasetime-hours.conf
create mode 100644 tests/networkxml2confdata/leasetime-hours.xml
create mode 100644 tests/networkxml2confdata/leasetime-infinite.conf
create mode 100644 tests/networkxml2confdata/leasetime-infinite.xml
create mode 100644 tests/networkxml2confdata/leasetime-minutes.conf
create mode 100644 tests/networkxml2confdata/leasetime-minutes.xml
create mode 100644 tests/networkxml2confdata/leasetime-seconds.conf
create mode 100644 tests/networkxml2confdata/leasetime-seconds.xml
create mode 100644 tests/networkxml2confdata/leasetime.conf
create mode 100644 tests/networkxml2confdata/leasetime.xml
create mode 100644 tests/networkxml2confdata/nat-network-dns-srv-record-
minimal.hostsfile
create mode 100644 tests/networkxml2confdata/nat-network-dns-srv-record.
hostsfile
create mode 100644 tests/networkxml2confdata/nat-network-dns-txt-record.
hostsfile
create mode 100644 tests/networkxml2confdata/nat-network-name-with-quotes.
hostsfile
create mode 100644 tests/networkxml2confdata/nat-network.hostsfile
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 1b4f980..11fbe2b 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -518,4 +518,9 @@
</element>
</define>
+ <define name="leaseTime">
+ <data type="string">
+ <param name="pattern">-?[0-9]*[smhd]?</param>
+ </data>
+ </define>
</grammar>
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 1a18e64..e6ddb63 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -340,6 +340,11 @@
<!-- Define the range(s) of IP addresses that the DHCP
server should hand out -->
<element name="dhcp">
+ <optional>
+ <element name="leasetime">
+ <ref name="leaseTime"/>
+ </element>
+ </optional>
<zeroOrMore>
<element name="range">
<attribute name="start"><ref
name="ipAddr"/></attribute>
@@ -361,6 +366,9 @@
<attribute name="name"><text/></attribute>
</choice>
<attribute name="ip"><ref name="ipAddr"/></attribute>
+ <optional>
+ <attribute name="leasetime"><ref
name="leaseTime"/></attribute>
+ </optional>
</element>
</zeroOrMore>
<optional>
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index aa39776..bcc4bbb 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -30,6 +30,8 @@
#include <fcntl.h>
#include <string.h>
#include <dirent.h>
+#include <stdlib.h>
+#include <inttypes.h>
#include "virerror.h"
#include "datatypes.h"
@@ -911,16 +913,83 @@ virSocketAddrRangeParseXML(const char *networkName,
return ret;
}
+static int64_t
+virNetworkDHCPDefGetLeaseTime (xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
+ const char* query,
+ bool *error)
+{
+ int64_t multiplier = 1, result = -1;
+ char *leaseString;
+ xmlNodePtr save;
+ size_t len;
+
+ *error = 0;
+
+ save = ctxt->node;
+ ctxt->node = node;
+
+ leaseString = virXPathString (query, ctxt);
+
+ /* If value is not present we set the value to -2 */
+ if (leaseString == NULL) {
+ result = -2;
+ goto cleanup;
+ }
+
+ len = strlen (leaseString) - 1;
+
+ if (leaseString[len] == 'm')
+ multiplier = 60;
+ else if (leaseString[len] == 'h')
+ multiplier = 60 * 60;
+ else if (leaseString[len] == 'd')
+ multiplier = 60 * 60 * 24;
+
+ /* Remove the time unit suffix */
+ if (leaseString[len] < 48 || leaseString[len] > 57)
+ leaseString[len] = '\0';
+
+ errno = 0;
+ result = (int64_t) strtoll((const char*)leaseString, NULL, 10);
+
+ /* Report any errors parsing the string */
+ if (errno != 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("<leasetime> value could not be converted to a
signed integer: %s"),
+ leaseString);
+ *error = 1;
+ goto cleanup;
+ }
+
+ result = result * multiplier;
+
+ if (result > UINT32_MAX || result < -1) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("<leasetime> value cannot be greater than the
equivalent of %" PRIo32 " seconds or less than -1: %" PRId64),
+ UINT32_MAX, result);
+ *error = 1;
+ }
+
+cleanup:
+ VIR_FREE(leaseString);
+ ctxt->node = save;
+ return result;
+}
+
static int
virNetworkDHCPHostDefParseXML(const char *networkName,
virNetworkIPDefPtr def,
xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
virNetworkDHCPHostDefPtr host,
bool partialOkay)
{
char *mac = NULL, *name = NULL, *ip = NULL, *id = NULL;
virMacAddr addr;
virSocketAddr inaddr;
+ int64_t leasetime;
+ bool error;
int ret = -1;
mac = virXMLPropString(node, "mac");
@@ -1013,6 +1082,10 @@ virNetworkDHCPHostDefParseXML(const char
*networkName,
}
}
+ leasetime = virNetworkDHCPDefGetLeaseTime (node, ctxt,
"string(./@leasetime)", &error);
+ if (error)
+ goto cleanup;
+
host->mac = mac;
mac = NULL;
host->id = id;
@@ -1021,6 +1094,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName,
name = NULL;
if (ip)
host->ip = inaddr;
+ host->leasetime = leasetime;
ret = 0;
cleanup:
@@ -1034,9 +1108,11 @@ virNetworkDHCPHostDefParseXML(const char
*networkName,
static int
virNetworkDHCPDefParseXML(const char *networkName,
xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
virNetworkIPDefPtr def)
{
int ret = -1;
+ bool error;
xmlNodePtr cur;
virSocketAddrRange range;
virNetworkDHCPHostDef host;
@@ -1044,6 +1120,10 @@ virNetworkDHCPDefParseXML(const char *networkName,
memset(&range, 0, sizeof(range));
memset(&host, 0, sizeof(host));
+ def->leasetime = virNetworkDHCPDefGetLeaseTime (node, ctxt,
"string(./leasetime/text())", &error);
+ if (error)
+ goto cleanup;
+
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE &&
@@ -1057,7 +1137,7 @@ virNetworkDHCPDefParseXML(const char *networkName,
} else if (cur->type == XML_ELEMENT_NODE &&
xmlStrEqual(cur->name, BAD_CAST "host")) {
- if (virNetworkDHCPHostDefParseXML(networkName, def, cur,
+ if (virNetworkDHCPHostDefParseXML(networkName, def, cur, ctxt,
&host, false) < 0)
goto cleanup;
if (VIR_APPEND_ELEMENT(def->hosts, def->nhosts, host) < 0)
@@ -1607,7 +1687,7 @@ virNetworkIPDefParseXML(const char *networkName,
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE &&
xmlStrEqual(cur->name, BAD_CAST "dhcp")) {
- if (virNetworkDHCPDefParseXML(networkName, cur, def) < 0)
+ if (virNetworkDHCPDefParseXML(networkName, cur, ctxt, def) < 0)
goto cleanup;
} else if (cur->type == XML_ELEMENT_NODE &&
xmlStrEqual(cur->name, BAD_CAST "tftp")) {
@@ -3659,7 +3739,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
if (!ipdef)
goto cleanup;
- if (virNetworkDHCPHostDefParseXML(def->name, ipdef, ctxt->node,
+ if (virNetworkDHCPHostDefParseXML(def->name, ipdef, ctxt->node, ctxt,
&host, partialOkay) < 0)
goto cleanup;
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 3b227db..df687df 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -96,6 +96,7 @@ struct _virNetworkDHCPHostDef {
char *id;
char *name;
virSocketAddr ip;
+ int64_t leasetime;
};
typedef struct _virNetworkDNSTxtDef virNetworkDNSTxtDef;
@@ -170,7 +171,8 @@ struct _virNetworkIPDef {
char *tftproot;
char *bootfile;
virSocketAddr bootserver;
- };
+ int64_t leasetime;
+};
typedef struct _virNetworkForwardIfDef virNetworkForwardIfDef;
typedef virNetworkForwardIfDef *virNetworkForwardIfDefPtr;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b88e903..84fb62e 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1497,6 +1497,7 @@ dnsmasqCapsRefresh;
dnsmasqContextFree;
dnsmasqContextNew;
dnsmasqDelete;
+dnsmasqDhcpHostsToString;
dnsmasqReload;
dnsmasqSave;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 7b99aca..dccf743 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -41,6 +41,8 @@
#include <sys/ioctl.h>
#include <net/if.h>
#include <dirent.h>
+#include <inttypes.h>
+#include <stdint.h>
#if HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#endif
@@ -859,30 +861,6 @@ networkKillDaemon(pid_t pid, const char *daemonName,
const char *networkName)
return ret;
}
-/* the following does not build a file, it builds a list
- * which is later saved into a file
- */
-
-static int
-networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx,
- virNetworkIPDefPtr ipdef)
-{
- size_t i;
- bool ipv6 = false;
-
- if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET6))
- ipv6 = true;
- for (i = 0; i < ipdef->nhosts; i++) {
- virNetworkDHCPHostDefPtr host = &(ipdef->hosts[i]);
- if (VIR_SOCKET_ADDR_VALID(&host->ip))
- if (dnsmasqAddDhcpHost(dctx, host->mac, &host->ip,
- host->name, host->id, ipv6) < 0)
- return -1;
- }
-
- return 0;
-}
-
static int
networkBuildDnsmasqHostsList(dnsmasqContext *dctx,
virNetworkDNSDefPtr dnsdef)
@@ -903,11 +881,93 @@ networkBuildDnsmasqHostsList(dnsmasqContext *dctx,
return 0;
}
+/* translates the leasetime value into a dnsmasq configuration string for
dhcp-range/host */
+static char *
+networkDnsmasqConfLeaseValueToString (int64_t leasetime)
+{
+ char *result = NULL;
+ virBuffer leasebuf = VIR_BUFFER_INITIALIZER;
+
+ /* Leasetime parameter set on the XML */
+ /* Less than -1 means there was no value set */
+ if (leasetime < -1) {
+ virBufferAsprintf(&leasebuf, "%s", "");
+ }
+ /* -1 means no expiration */
+ else if (leasetime == -1)
+ virBufferAsprintf(&leasebuf, ",infinite");
+ /* Minimum expiry value is 120 */
+ /* TODO: Discuss if we should up as we do here or just forward
whatever value to dnsmasq */
+ else if (leasetime < 120)
+ virBufferAsprintf(&leasebuf, ",120");
+ /* DHCP value for lease time is a unsigned four octect integer */
+ else if (leasetime <= UINT32_MAX)
+ virBufferAsprintf(&leasebuf, ",%" PRId64, leasetime);
+ /* TODO: Discuss the use of "deprecated" for ipv6*/
+ /* TODO: Discuss what is the default value that we want as dnsmasq's
is 1 hour */
+ /* TODO: Discuss what to do if value exceeds maximum, use default
value for now */
+ else {
+ virBufferAsprintf(&leasebuf, "%s", "");
+ }
+
+ result = virBufferContentAndReset(&leasebuf);
+ virBufferFreeAndReset (&leasebuf);
+
+ return result;
+}
+
+/* the following does not build a file, it builds a list
+ * which is later saved into a file
+ */
+
+static int
+networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx,
+ virNetworkIPDefPtr ipdef)
+{
+ int ret = -1;
+ size_t i;
+ bool ipv6 = false;
+ char *leasetime = networkDnsmasqConfLeaseValueTo
String(ipdef->leasetime);
+
+ if (!leasetime)
+ goto cleanup;
+
+ if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET6))
+ ipv6 = true;
+ for (i = 0; i < ipdef->nhosts; i++) {
+ virNetworkDHCPHostDefPtr host = &(ipdef->hosts[i]);
+ if (VIR_SOCKET_ADDR_VALID(&host->ip)) {
+ /* If the host has its own leasetime we get its specific
string */
+ if (host->leasetime > -2) {
+ char *hostlease = networkDnsmasqConfLeaseValueTo
String(host->leasetime);
+ if (!hostlease)
+ goto cleanup;
+ if (dnsmasqAddDhcpHost(dctx, host->mac, &host->ip,
+ host->name, host->id, hostlease,
ipv6) < 0) {
+ VIR_FREE(hostlease);
+ goto cleanup;
+ }
+ VIR_FREE(hostlease);
+ } else {
+ /* Otherwise we use the leasetime from dhcp */
+ if (dnsmasqAddDhcpHost(dctx, host->mac, &host->ip,
+ host->name, host->id, leasetime,
ipv6) < 0)
+ goto cleanup;
+ }
+ }
+ }
+
+ ret = 0;
+cleanup:
+ VIR_FREE(leasetime);
+ return ret;
+}
int
networkDnsmasqConfContents(virNetworkObjPtr network,
const char *pidfile,
char **configstr,
+ char **hostsfilestr,
dnsmasqContext *dctx,
dnsmasqCapsPtr caps ATTRIBUTE_UNUSED)
{
@@ -1213,6 +1273,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
}
for (r = 0; r < ipdef->nranges; r++) {
int thisRange;
+ char *leasestr;
if (!(saddr = virSocketAddrFormat(&ipdef->ranges[r].start)) ||
!(eaddr = virSocketAddrFormat(&ipdef->ranges[r].end)))
@@ -1220,12 +1281,22 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
virBufferAsprintf(&configbuf, "dhcp-range=%s,%s",
saddr, eaddr);
- if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET6))
+
+ /* Add ipv6 prefix length parameter if needed */
+ if (ipdef == ipv6def)
virBufferAsprintf(&configbuf, ",%d", prefix);
+
+ leasestr = networkDnsmasqConfLeaseValueToString
(ipdef->leasetime);
+ if (!leasestr)
+ goto cleanup;
+ virBufferAsprintf(&configbuf, "%s", leasestr);
+
+ /* Add the newline */
virBufferAddLit(&configbuf, "\n");
VIR_FREE(saddr);
VIR_FREE(eaddr);
+ VIR_FREE(leasestr);
thisRange = virSocketAddrGetRange(&ipdef->ranges[r].start,
&ipdef->ranges[r].end,
&ipdef->address,
@@ -1256,6 +1327,15 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (networkBuildDnsmasqDhcpHostsList(dctx, ipdef) < 0)
goto cleanup;
+ /* Return the contents of the hostsfile if requested */
+ if (hostsfilestr) {
+ *hostsfilestr = dnsmasqDhcpHostsToString
(dctx->hostsfile->hosts,
+
dctx->hostsfile->nhosts);
+
+ if (!hostsfilestr)
+ goto cleanup;
+ }
+
/* Note: the following is IPv4 only */
if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) {
if (ipdef->nranges || ipdef->nhosts)
@@ -1355,7 +1435,7 @@
networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr
driver,
network->dnsmasqPid = -1;
- if (networkDnsmasqConfContents(network, pidfile, &configstr,
+ if (networkDnsmasqConfContents(network, pidfile, &configstr, NULL,
dctx, dnsmasq_caps) < 0)
goto cleanup;
if (!configstr)
diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index ff7f921..c653c50 100644
--- a/src/network/bridge_driver.h
+++ b/src/network/bridge_driver.h
@@ -53,6 +53,7 @@ int networkGetActualType(virDomainNetDefPtr iface)
int networkDnsmasqConfContents(virNetworkObjPtr network,
const char *pidfile,
char **configstr,
+ char **hostsfilestr,
dnsmasqContext *dctx,
dnsmasqCapsPtr caps);
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index 1b78c1f..94c9a3b 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -308,52 +308,47 @@ hostsfileAdd(dnsmasqHostsfile *hostsfile,
virSocketAddr *ip,
const char *name,
const char *id,
+ const char *leasetime,
bool ipv6)
{
+ int ret = -1;
char *ipstr = NULL;
+ virBuffer hostbuf = VIR_BUFFER_INITIALIZER;
+
if (VIR_REALLOC_N(hostsfile->hosts, hostsfile->nhosts + 1) < 0)
goto error;
if (!(ipstr = virSocketAddrFormat(ip)))
- return -1;
+ goto error;
/* the first test determines if it is a dhcpv6 host */
if (ipv6) {
- if (name && id) {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host,
- "id:%s,%s,[%s]", id, name, ipstr) < 0)
- goto error;
- } else if (name && !id) {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host,
- "%s,[%s]", name, ipstr) < 0)
- goto error;
- } else if (!name && id) {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host,
- "id:%s,[%s]", id, ipstr) < 0)
- goto error;
- }
+ if (name && id)
+ virBufferAsprintf(&hostbuf, "id:%s,%s,[%s]", id, name, ipstr);
+ else if (name && !id)
+ virBufferAsprintf(&hostbuf, "%s,[%s]", name, ipstr);
+ else if (!name && id)
+ virBufferAsprintf(&hostbuf, "id:%s,[%s]", id, ipstr);
} else if (name && mac) {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host,
"%s,%s,%s",
- mac, ipstr, name) < 0)
- goto error;
+ virBufferAsprintf(&hostbuf, "%s,%s,%s", mac, ipstr, name);
} else if (name && !mac) {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s",
- name, ipstr) < 0)
- goto error;
+ virBufferAsprintf(&hostbuf, "%s,%s", name, ipstr);
} else {
- if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s",
- mac, ipstr) < 0)
- goto error;
+ virBufferAsprintf(&hostbuf, "%s,%s", mac, ipstr);
}
- VIR_FREE(ipstr);
- hostsfile->nhosts++;
+ /* The leasetime string already includes comma if there's any value at
all */
+ virBufferAsprintf(&hostbuf, "%s", leasetime);
- return 0;
+ if (!(hostsfile->hosts[hostsfile->nhosts].host =
virBufferContentAndReset (&hostbuf)))
+ goto error;
+ hostsfile->nhosts++;
+ ret = 0;
error:
+ virBufferFreeAndReset(&hostbuf);
VIR_FREE(ipstr);
- return -1;
+ return ret;
}
static dnsmasqHostsfile *
@@ -391,10 +386,9 @@ hostsfileWrite(const char *path,
dnsmasqDhcpHost *hosts,
unsigned int nhosts)
{
- char *tmp;
+ char *tmp, *content = NULL;
FILE *f;
bool istmp = true;
- size_t i;
int rc = 0;
/* even if there are 0 hosts, create a 0 length file, to allow
@@ -412,17 +406,21 @@ hostsfileWrite(const char *path,
}
}
- for (i = 0; i < nhosts; i++) {
- if (fputs(hosts[i].host, f) == EOF || fputc('\n', f) == EOF) {
- rc = -errno;
- VIR_FORCE_FCLOSE(f);
+ if (!(content = dnsmasqDhcpHostsToString(hosts, nhosts))) {
+ rc = -ENOMEM;
+ goto cleanup;
+ }
- if (istmp)
- unlink(tmp);
+ if (fputs(content, f) == EOF) {
+ rc = -errno;
+ VIR_FORCE_FCLOSE(f);
+
+ if (istmp)
+ unlink(tmp);
+
+ goto cleanup;
+ }
- goto cleanup;
- }
- }
if (VIR_FCLOSE(f) == EOF) {
rc = -errno;
@@ -436,6 +434,7 @@ hostsfileWrite(const char *path,
}
cleanup:
+ VIR_FREE(content);
VIR_FREE(tmp);
return rc;
@@ -524,9 +523,10 @@ dnsmasqAddDhcpHost(dnsmasqContext *ctx,
virSocketAddr *ip,
const char *name,
const char *id,
+ const char *leasetime,
bool ipv6)
{
- return hostsfileAdd(ctx->hostsfile, mac, ip, name, id, ipv6);
+ return hostsfileAdd(ctx->hostsfile, mac, ip, name, id, leasetime,
ipv6);
}
/*
@@ -892,3 +892,31 @@ dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags
flag)
return caps && virBitmapIsBitSet(caps->flags, flag);
}
+
+/** dnsmasqDhcpHostsToString:
+ *
+ * Turns a vector of dnsmasqDhcpHost into the string that is ought to be
+ * stored in the hostsfile, this functionality is split to make
hostsfiles
+ * testable. Returs NULL if nhosts is 0.
+ */
+char *
+dnsmasqDhcpHostsToString (dnsmasqDhcpHost *hosts,
+ unsigned int nhosts)
+{
+ int i;
+ char *result = NULL;
+ virBuffer hostsfilebuf = VIR_BUFFER_INITIALIZER;
+
+ if (nhosts == 0)
+ goto cleanup;
+
+ for (i = 0; i < nhosts; i++) {
+ virBufferAsprintf(&hostsfilebuf, "%s\n", hosts[i].host);
+ }
+
+ result = virBufferContentAndReset(&hostsfilebuf);
+
+cleanup:
+ virBufferFreeAndReset(&hostsfilebuf);
+ return result;
+}
diff --git a/src/util/virdnsmasq.h b/src/util/virdnsmasq.h
index f47bea3..1795bc8 100644
--- a/src/util/virdnsmasq.h
+++ b/src/util/virdnsmasq.h
@@ -88,6 +88,7 @@ int dnsmasqAddDhcpHost(dnsmasqContext *ctx,
virSocketAddr *ip,
const char *name,
const char *id,
+ const char *leastime,
bool ipv6);
int dnsmasqAddHost(dnsmasqContext *ctx,
virSocketAddr *ip,
@@ -105,6 +106,7 @@ int dnsmasqCapsRefresh(dnsmasqCapsPtr *caps, const char
*binaryPath);
bool dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag);
const char *dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps);
unsigned long dnsmasqCapsGetVersion(dnsmasqCapsPtr caps);
+char *dnsmasqDhcpHostsToString(dnsmasqDhcpHost *hosts, unsigned int
nhosts);
# define DNSMASQ_DHCPv6_MAJOR_REQD 2
# define DNSMASQ_DHCPv6_MINOR_REQD 64
diff --git a/tests/networkxml2confdata/dhcp6-nat-network.hostsfile
b/tests/networkxml2confdata/dhcp6-nat-network.hostsfile
new file mode 100644
index 0000000..de659b9
--- /dev/null
+++ b/tests/networkxml2confdata/dhcp6-nat-network.hostsfile
@@ -0,0 +1,7 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
+id:0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63,[
2001:db8:ac10:fd01::1:20]
+paul,[2001:db8:ac10:fd01::1:21]
+id:0:3:0:1:0:16:3e:11:22:33,peter.xyz,[2001:db8:ac10:fd01::1:22]
+id:0:3:0:1:0:16:3e:44:55:33,[2001:db8:ac10:fd01::1:23]
+id:0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66,badbob,[2001:db8:ac10:fd01::1:24]
diff --git a/tests/networkxml2confdata/dhcp6-network.hostsfile
b/tests/networkxml2confdata/dhcp6-network.hostsfile
new file mode 100644
index 0000000..9dfb172
--- /dev/null
+++ b/tests/networkxml2confdata/dhcp6-network.hostsfile
@@ -0,0 +1,5 @@
+id:0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63,[
2001:db8:ac10:fd01::1:20]
+paul,[2001:db8:ac10:fd01::1:21]
+id:0:3:0:1:0:16:3e:11:22:33,peter.xyz,[2001:db8:ac10:fd01::1:22]
+id:0:3:0:1:0:16:3e:44:55:33,[2001:db8:ac10:fd01::1:23]
+id:0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66,badbob,[2001:db8:ac10:fd01::1:24]
diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.hostsfile
b/tests/networkxml2confdata/dhcp6host-routed-network.hostsfile
new file mode 100644
index 0000000..de659b9
--- /dev/null
+++ b/tests/networkxml2confdata/dhcp6host-routed-network.hostsfile
@@ -0,0 +1,7 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
+id:0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63,[
2001:db8:ac10:fd01::1:20]
+paul,[2001:db8:ac10:fd01::1:21]
+id:0:3:0:1:0:16:3e:11:22:33,peter.xyz,[2001:db8:ac10:fd01::1:22]
+id:0:3:0:1:0:16:3e:44:55:33,[2001:db8:ac10:fd01::1:23]
+id:0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66,badbob,[2001:db8:ac10:fd01::1:24]
diff --git a/tests/networkxml2confdata/leasetime-days.conf
b/tests/networkxml2confdata/leasetime-days.conf
new file mode 100644
index 0000000..9501e2f
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-days.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,86400
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,86400
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime-days.xml
b/tests/networkxml2confdata/leasetime-days.xml
new file mode 100644
index 0000000..1a507d5
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-days.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>1d</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>1d</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime-host.conf
b/tests/networkxml2confdata/leasetime-host.conf
new file mode 100644
index 0000000..7bd2054
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-host.conf
@@ -0,0 +1,16 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+srv-host=_name._tcp
+dhcp-range=192.168.122.2,192.168.122.254
+dhcp-no-override
+dhcp-lease-max=253
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/leasetime-host.hostsfile
b/tests/networkxml2confdata/leasetime-host.hostsfile
new file mode 100644
index 0000000..fd20ca2
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-host.hostsfile
@@ -0,0 +1,6 @@
+00:16:3e:3e:a9:01,192.168.122.11,a.example.com,3600
+00:16:3e:3e:a9:02,192.168.122.12,b.example.com,3600
+00:16:3e:3e:a9:03,192.168.122.13,c.example.com,3600
+00:16:3e:3e:a9:04,192.168.122.14,d.example.com,86400
+00:16:3e:3e:a9:05,192.168.122.15,e.example.com,3600
+00:16:3e:3e:a9:06,192.168.122.16,f.example.com,infinite
diff --git a/tests/networkxml2confdata/leasetime-host.xml
b/tests/networkxml2confdata/leasetime-host.xml
new file mode 100644
index 0000000..276d3e5
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-host.xml
@@ -0,0 +1,22 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'>
+ <interface dev='eth1'/>
+ </forward>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <dns>
+ <srv service='name' protocol='tcp'/>
+ </dns>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ <host mac='00:16:3e:3e:a9:1a' name='a.example.com'
ip='192.168.122.11' leasetime="3600s"/>
+ <host mac='00:16:3e:3e:a9:1b' name='b.example.com'
ip='192.168.122.12' leasetime="60m"/>
+ <host mac='00:16:3e:3e:a9:1c' name='c.example.com'
ip='192.168.122.13' leasetime="1h"/>
+ <host mac='00:16:3e:3e:a9:1d' name='d.example.com'
ip='192.168.122.14' leasetime="1d"/>
+ <host mac='00:16:3e:3e:a9:1e' name='e.example.com'
ip='192.168.122.15' leasetime="3600"/>
+ <host mac='00:16:3e:3e:a9:1f' name='f.example.com'
ip='192.168.122.16' leasetime="-1"/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime-hours.conf
b/tests/networkxml2confdata/leasetime-hours.conf
new file mode 100644
index 0000000..021a769
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-hours.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,3600
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,3600
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime-hours.xml
b/tests/networkxml2confdata/leasetime-hours.xml
new file mode 100644
index 0000000..36dc600
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-hours.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>1h</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>1h</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime-infinite.conf
b/tests/networkxml2confdata/leasetime-infinite.conf
new file mode 100644
index 0000000..cc21135
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-infinite.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,infinite
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,infinite
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime-infinite.xml
b/tests/networkxml2confdata/leasetime-infinite.xml
new file mode 100644
index 0000000..bc8740e
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-infinite.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>-1</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>-1</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime-minutes.conf
b/tests/networkxml2confdata/leasetime-minutes.conf
new file mode 100644
index 0000000..db68895
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-minutes.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,300
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,300
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime-minutes.xml
b/tests/networkxml2confdata/leasetime-minutes.xml
new file mode 100644
index 0000000..7c1df25
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-minutes.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>5m</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>5m</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime-seconds.conf
b/tests/networkxml2confdata/leasetime-seconds.conf
new file mode 100644
index 0000000..635896b
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-seconds.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,125
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,125
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime-seconds.xml
b/tests/networkxml2confdata/leasetime-seconds.xml
new file mode 100644
index 0000000..dcb3f91
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime-seconds.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>125s</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>125s</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/leasetime.conf
b/tests/networkxml2confdata/leasetime.conf
new file mode 100644
index 0000000..72a2f69
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime.conf
@@ -0,0 +1,17 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made
using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+dhcp-range=192.168.122.2,192.168.122.254,122
+dhcp-no-override
+dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64,121
+dhcp-lease-max=493
+dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
+enable-ra
diff --git a/tests/networkxml2confdata/leasetime.xml
b/tests/networkxml2confdata/leasetime.xml
new file mode 100644
index 0000000..fdbb15f
--- /dev/null
+++ b/tests/networkxml2confdata/leasetime.xml
@@ -0,0 +1,18 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <leasetime>122</leasetime>
+ <range start='192.168.122.2' end='192.168.122.254'/>
+ </dhcp>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ <dhcp>
+ <leasetime>121</leasetime>
+ <range start='2001:db8:ac10:fd01::1:10'
end='2001:db8:ac10:fd01::1:ff'/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.hostsfile
b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.hostsfile
new file mode 100644
index 0000000..deb3f00
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.hostsfile
@@ -0,0 +1,2 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.hostsfile
b/tests/networkxml2confdata/nat-network-dns-srv-record.hostsfile
new file mode 100644
index 0000000..deb3f00
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record.hostsfile
@@ -0,0 +1,2 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.hostsfile
b/tests/networkxml2confdata/nat-network-dns-txt-record.hostsfile
new file mode 100644
index 0000000..deb3f00
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-txt-record.hostsfile
@@ -0,0 +1,2 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.hostsfile
b/tests/networkxml2confdata/nat-network-name-with-quotes.hostsfile
new file mode 100644
index 0000000..deb3f00
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-name-with-quotes.hostsfile
@@ -0,0 +1,2 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
diff --git a/tests/networkxml2confdata/nat-network.hostsfile
b/tests/networkxml2confdata/nat-network.hostsfile
new file mode 100644
index 0000000..deb3f00
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network.hostsfile
@@ -0,0 +1,2 @@
+00:16:3e:77:e2:ed,192.168.122.10,a.example.com
+00:16:3e:3e:a9:1a,192.168.122.11,b.example.com
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index 65a0e32..8e1f8be 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -19,9 +19,13 @@
#define VIR_FROM_THIS VIR_FROM_NONE
static int
-testCompareXMLToConfFiles(const char *inxml, const char *outconf,
dnsmasqCapsPtr caps)
+testCompareXMLToConfFiles(const char *inxml,
+ const char *outconf,
+ const char *outhostsfile,
+ dnsmasqCapsPtr caps)
{
- char *actual = NULL;
+ char *actualconf = NULL;
+ char *actualhosts = NULL;
int ret = -1;
virNetworkDefPtr dev = NULL;
virNetworkObjPtr obj = NULL;
@@ -41,17 +45,30 @@ testCompareXMLToConfFiles(const char *inxml, const char
*outconf, dnsmasqCapsPtr
if (dctx == NULL)
goto fail;
- if (networkDnsmasqConfContents(obj, pidfile, &actual,
+ if (networkDnsmasqConfContents(obj, pidfile, &actualconf, &actualhosts,
dctx, caps) < 0)
goto fail;
- if (virTestCompareToFile(actual, outconf) < 0)
+ if (virTestCompareToFile(actualconf, outconf) < 0)
goto fail;
+ if (virFileExists(outhostsfile)) {
+ if (!actualhosts) {
+ fprintf(stderr, "%s: hostsfile exists but the configuration
did not specify any host", outhostsfile);
+ goto fail;
+ } else if (virTestCompareToFile(actualhosts, outhostsfile) < 0) {
+ goto fail;
+ }
+ } else if (actualhosts) {
+ fprintf(stderr, "%s: file does not exist but actual data was
expected", outhostsfile);
+ goto fail;
+ }
+
ret = 0;
fail:
- VIR_FREE(actual);
+ VIR_FREE(actualconf);
+ VIR_FREE(actualhosts);
VIR_FREE(pidfile);
virCommandFree(cmd);
virObjectUnref(obj);
@@ -70,20 +87,24 @@ testCompareXMLToConfHelper(const void *data)
int result = -1;
const testInfo *info = data;
char *inxml = NULL;
- char *outxml = NULL;
+ char *outconf = NULL;
+ char *outhostsfile = NULL;
if (virAsprintf(&inxml, "%s/networkxml2confdata/%s.xml",
abs_srcdir, info->name) < 0 ||
- virAsprintf(&outxml, "%s/networkxml2confdata/%s.conf",
+ virAsprintf(&outconf, "%s/networkxml2confdata/%s.conf",
+ abs_srcdir, info->name) < 0 ||
+ virAsprintf(&outhostsfile, "%s/networkxml2confdata/%s.hostsfile",
abs_srcdir, info->name) < 0) {
goto cleanup;
}
- result = testCompareXMLToConfFiles(inxml, outxml, info->caps);
+ result = testCompareXMLToConfFiles(inxml, outconf, outhostsfile,
info->caps);
cleanup:
VIR_FREE(inxml);
- VIR_FREE(outxml);
+ VIR_FREE(outconf);
+ VIR_FREE(outhostsfile);
return result;
}
@@ -129,6 +150,14 @@ mymain(void)
DO_TEST("dhcp6-network", dhcpv6);
DO_TEST("dhcp6-nat-network", dhcpv6);
DO_TEST("dhcp6host-routed-network", dhcpv6);
+ DO_TEST("leasetime", dhcpv6);
+ DO_TEST("leasetime-seconds", dhcpv6);
+ DO_TEST("leasetime-hours", dhcpv6);
+ DO_TEST("leasetime-minutes", dhcpv6);
+ DO_TEST("leasetime-hours", dhcpv6);
+ DO_TEST("leasetime-days", dhcpv6);
+ DO_TEST("leasetime-infinite", dhcpv6);
+ DO_TEST("leasetime-host", dhcpv6);
virObjectUnref(dhcpv6);
virObjectUnref(full);
--
2.9.3
--
Alberto Ruiz
Associate Engineering Manager - Desktop Management Tools
Red Hat
7 years, 7 months
[libvirt] [PATCH v2 0/5] qemu: ACPI and UEFI fixes
by Andrea Bolognani
Changes from [v1]:
* use a dedicated function for setting basic arch-dependent
capabilities instead of having two copies of the same
code that will have to be kept in sync;
* enforce requirements at guest validation time rather than
at command line creation time;
* shuffle patches around so that the order has more sense;
* make test files slightly smaller and nicer.
[v1] https://www.redhat.com/archives/libvir-list/2017-March/msg00429.html
Andrea Bolognani (5):
qemu: Split virQEMUCapsInitArchQMPBasic()
tests: Initialize basic capabilities properly
qemu: Advertise ACPI support for aarch64 guests
qemu: Enforce ACPI, UEFI requirements
tests: Test ACPI, UEFI requirements
src/qemu/qemu_capabilities.c | 68 ++++++++++++++++------
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 20 ++-----
src/qemu/qemu_domain.c | 20 +++++++
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
.../qemuxml2argv-aarch64-aavmf-virtio-mmio.args | 1 +
.../qemuxml2argv-aarch64-aavmf-virtio-mmio.xml | 1 -
....args => qemuxml2argv-aarch64-acpi-nouefi.args} | 9 +--
.../qemuxml2argv-aarch64-acpi-nouefi.xml | 22 +++++++
.../qemuxml2argv-aarch64-acpi-uefi.args | 22 +++++++
.../qemuxml2argv-aarch64-acpi-uefi.xml | 21 +++++++
.../qemuxml2argv-aarch64-cpu-passthrough.args | 1 +
.../qemuxml2argv-aarch64-cpu-passthrough.xml | 1 -
...rgs => qemuxml2argv-aarch64-noacpi-nouefi.args} | 13 +++--
.../qemuxml2argv-aarch64-noacpi-nouefi.xml | 19 ++++++
.../qemuxml2argv-aarch64-noacpi-uefi.args | 23 ++++++++
.../qemuxml2argv-aarch64-noacpi-uefi.xml | 18 ++++++
.../qemuxml2argv-aarch64-video-virtio-gpu-pci.args | 1 +
.../qemuxml2argv-aarch64-video-virtio-gpu-pci.xml | 3 -
...l2argv-aarch64-virt-2.6-virtio-pci-default.args | 1 +
...ml2argv-aarch64-virt-2.6-virtio-pci-default.xml | 1 -
.../qemuxml2argv-aarch64-virt-default-nic.args | 1 +
.../qemuxml2argv-aarch64-virt-default-nic.xml | 3 -
.../qemuxml2argv-aarch64-virt-virtio.args | 1 +
.../qemuxml2argv-aarch64-virt-virtio.xml | 1 -
.../qemuxml2argv-aarch64-virtio-pci-default.args | 1 +
.../qemuxml2argv-aarch64-virtio-pci-default.xml | 1 -
...l2argv-aarch64-virtio-pci-manual-addresses.args | 1 +
...ml2argv-aarch64-virtio-pci-manual-addresses.xml | 1 -
.../qemuxml2argv-balloon-ccw-deflate.args | 1 -
.../qemuxml2argv-balloon-mmio-deflate.args | 1 +
.../qemuxml2argv-balloon-mmio-deflate.xml | 1 -
.../qemuxml2argv-console-sclp.args | 1 -
.../qemuxml2argv-console-virtio-ccw.args | 1 -
.../qemuxml2argv-console-virtio-s390.args | 1 -
.../qemuxml2argv-cpu-s390-features.args | 1 -
.../qemuxml2argv-cpu-s390-zEC12.args | 1 -
.../qemuxml2argv-disk-virtio-ccw-many.args | 1 -
.../qemuxml2argv-disk-virtio-ccw.args | 1 -
.../qemuxml2argv-disk-virtio-s390.args | 1 -
.../qemuxml2argv-disk-virtio-scsi-ccw.args | 1 -
tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 1 -
.../qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args | 1 -
.../qemuxml2argv-hugepages-numa.args | 1 +
.../qemuxml2argv-iothreads-disk-virtio-ccw.args | 1 -
.../qemuxml2argv-iothreads-virtio-scsi-ccw.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-off-cap.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-off-caps.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-on-cap.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-on-caps.args | 1 -
.../qemuxml2argv-machine-deakeywrap-off-cap.args | 1 -
.../qemuxml2argv-machine-deakeywrap-off-caps.args | 1 -
.../qemuxml2argv-machine-deakeywrap-on-cap.args | 1 -
.../qemuxml2argv-machine-deakeywrap-on-caps.args | 1 -
.../qemuxml2argv-machine-keywrap-none-caps.args | 1 -
.../qemuxml2argv-machine-keywrap-none.args | 1 -
.../qemuxml2argv-memory-hotplug-ppc64-nonuma.args | 1 -
.../qemuxml2argv-net-virtio-ccw.args | 1 -
.../qemuxml2argv-net-virtio-s390.args | 1 -
tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 1 -
.../qemuxml2argv-ppce500-serial.args | 1 -
.../qemuxml2argv-pseries-basic.args | 1 -
.../qemuxml2argv-pseries-cpu-compat.args | 1 -
.../qemuxml2argv-pseries-cpu-exact.args | 1 -
.../qemuxml2argv-pseries-cpu-le.args | 1 -
.../qemuxml2argv-pseries-nvram.args | 1 -
.../qemuxml2argv-pseries-panic-missing.args | 1 -
.../qemuxml2argv-pseries-panic-no-address.args | 1 -
.../qemuxml2argv-pseries-usb-default.args | 1 -
.../qemuxml2argv-pseries-usb-kbd.args | 1 -
.../qemuxml2argv-pseries-usb-multi.args | 1 -
.../qemuxml2argv-pseries-vio-user-assigned.args | 1 -
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 1 -
.../qemuxml2argv-q35-acpi-nouefi.args | 21 +++++++
.../qemuxml2argv-q35-acpi-nouefi.xml | 22 +++++++
.../qemuxml2argv-q35-acpi-uefi.args | 22 +++++++
.../qemuxml2argv-q35-acpi-uefi.xml | 21 +++++++
.../qemuxml2argv-q35-noacpi-nouefi.args | 22 +++++++
.../qemuxml2argv-q35-noacpi-nouefi.xml | 19 ++++++
.../qemuxml2argv-q35-noacpi-uefi.xml | 18 ++++++
.../qemuxml2argv-q35-virt-manager-basic.args | 1 +
...muxml2argv-s390-allow-bogus-usb-controller.args | 1 -
.../qemuxml2argv-s390-allow-bogus-usb-none.args | 1 -
.../qemuxml2argv-s390-panic-missing.args | 1 -
.../qemuxml2argv-s390-panic-no-address.args | 1 -
.../qemuxml2argv-virtio-rng-ccw.args | 1 -
.../qemuxml2argv-watchdog-diag288.args | 1 -
tests/qemuxml2argvtest.c | 18 +++++-
.../qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml | 1 -
...qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml | 1 -
.../qemuxml2xmlout-aarch64-virtio-pci-default.xml | 1 -
...2xmlout-aarch64-virtio-pci-manual-addresses.xml | 1 -
93 files changed, 388 insertions(+), 109 deletions(-)
copy tests/qemuxml2argvdata/{qemuxml2argv-aarch64-cpu-passthrough.args => qemuxml2argv-aarch64-acpi-nouefi.args} (55%)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml
copy tests/qemuxml2argvdata/{qemuxml2argv-aarch64-cpu-passthrough.args => qemuxml2argv-aarch64-noacpi-nouefi.args} (50%)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml
--
2.7.4
7 years, 7 months
[libvirt] [PATCH 00/14] Add tests for virCPUUpdateLive API
by Jiri Denemark
Jiri Denemark (14):
cpu_conf: Introduce virCPUDefFreeFeatures
cpu: Introduce virCPUExpandFeatures
cpu: Drop unused flags from cpuArchDecode
cpu: Move feature expansion out of cpuBaseline
cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline
cputest: Move instantiation of JSONDecoder in cpu-convert.py
cputest: Rename cpu-convert.py script as cpu-cpuid.py
cputest: Add cpuidIsSet helper to cpu-cpuid.py
cputest: Add cpuidLeaf helper to cpu-cpuid.py
cputest: Add "diff" command to cpu-cpuid.py
cputest: Generate data for virCPUUpdateLive
cputest: Disable TSX on broken models
cputest: Disable "cmt" feature unknown to QEMU
cputest: Add tests for virCPUUpdateLive API
src/conf/cpu_conf.c | 21 ++-
src/conf/cpu_conf.h | 3 +
src/cpu/cpu.c | 74 +++++++--
src/cpu/cpu.h | 15 +-
src/cpu/cpu_arm.c | 5 +-
src/cpu/cpu_ppc64.c | 12 +-
src/cpu/cpu_x86.c | 109 ++++++++------
src/libvirt_private.syms | 2 +
tests/cputest.c | 160 +++++++++++++++++++-
tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} | 165 +++++++++++++++++----
tests/cputestdata/cpu-parse.sh | 3 +-
tests/cputestdata/x86_64-baseline-3-expanded.xml | 48 +++---
tests/cputestdata/x86_64-baseline-4-expanded.xml | 68 ++++-----
tests/cputestdata/x86_64-baseline-5-expanded.xml | 70 ++++-----
.../x86_64-cpuid-A10-5800K-disabled.xml | 7 +
.../cputestdata/x86_64-cpuid-A10-5800K-enabled.xml | 8 +
.../x86_64-cpuid-Core-i5-2500-disabled.xml | 5 +
.../x86_64-cpuid-Core-i5-2500-enabled.xml | 9 ++
.../x86_64-cpuid-Core-i5-2540M-disabled.xml | 5 +
.../x86_64-cpuid-Core-i5-2540M-enabled.xml | 9 ++
.../x86_64-cpuid-Core-i5-4670T-disabled.xml | 7 +
.../x86_64-cpuid-Core-i5-4670T-enabled.xml | 8 +
tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json | 4 +-
.../x86_64-cpuid-Core-i5-6600-disabled.xml | 5 +
.../x86_64-cpuid-Core-i5-6600-enabled.xml | 9 ++
.../x86_64-cpuid-Core-i7-2600-disabled.xml | 6 +
.../x86_64-cpuid-Core-i7-2600-enabled.xml | 8 +
.../x86_64-cpuid-Core-i7-3740QM-disabled.xml | 6 +
.../x86_64-cpuid-Core-i7-3740QM-enabled.xml | 8 +
.../x86_64-cpuid-Core-i7-3770-disabled.xml | 6 +
.../x86_64-cpuid-Core-i7-3770-enabled.xml | 8 +
.../x86_64-cpuid-Core-i7-4510U-disabled.xml | 5 +
.../x86_64-cpuid-Core-i7-4510U-enabled.xml | 9 ++
.../x86_64-cpuid-Core-i7-4600U-disabled.xml | 5 +
.../x86_64-cpuid-Core-i7-4600U-enabled.xml | 9 ++
.../x86_64-cpuid-Core-i7-5600U-disabled.xml | 5 +
.../x86_64-cpuid-Core-i7-5600U-enabled.xml | 9 ++
.../x86_64-cpuid-Core2-E6850-disabled.xml | 4 +
.../x86_64-cpuid-Core2-E6850-enabled.xml | 7 +
.../x86_64-cpuid-Opteron-2350-disabled.xml | 7 +
.../x86_64-cpuid-Opteron-2350-enabled.xml | 7 +
.../x86_64-cpuid-Opteron-6234-disabled.xml | 7 +
.../x86_64-cpuid-Opteron-6234-enabled.xml | 9 ++
.../x86_64-cpuid-Phenom-B95-disabled.xml | 7 +
.../x86_64-cpuid-Phenom-B95-enabled.xml | 7 +
.../x86_64-cpuid-Xeon-E3-1245-disabled.xml | 6 +
.../x86_64-cpuid-Xeon-E3-1245-enabled.xml | 9 ++
.../x86_64-cpuid-Xeon-E5-2630-disabled.xml | 7 +
.../x86_64-cpuid-Xeon-E5-2630-enabled.xml | 8 +
.../x86_64-cpuid-Xeon-E5-2650-disabled.xml | 8 +
.../x86_64-cpuid-Xeon-E5-2650-enabled.xml | 7 +
.../x86_64-cpuid-Xeon-E7-4820-disabled.xml | 6 +
.../x86_64-cpuid-Xeon-E7-4820-enabled.xml | 7 +
.../x86_64-cpuid-Xeon-W3520-disabled.xml | 5 +
.../x86_64-cpuid-Xeon-W3520-enabled.xml | 7 +
55 files changed, 834 insertions(+), 206 deletions(-)
rename tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} (83%)
create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml
--
2.12.0
7 years, 7 months
[libvirt] [PATCH] storage: gluster: Implement 'checkPool' method so that state is restored
by Peter Krempa
After restart of libvirtd the 'checkPool' method is supposed to validate
that the pool is online. Since libvirt then refreshes the pool contents
anyways just return whether the pool was supposed to be online so that
the code can be reached. This is necessary since if a pool does not
implement the method it's automatically considered as inactive.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1436065
---
src/storage/storage_backend_gluster.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index 52c9ee372..83da47347 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -537,9 +537,22 @@ virStorageBackendGlusterFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
}
+static int
+virStorageBackendGlusterCheckPool(virStoragePoolObjPtr pool,
+ bool *active)
+{
+ /* Return previous state remembered by the status XML. If the pool is not
+ * available we will fail to refresh it and end up in the same situation.
+ * This will save one attempt to open the connection to the remote server */
+ *active = pool->active;
+ return 0;
+}
+
+
virStorageBackend virStorageBackendGluster = {
.type = VIR_STORAGE_POOL_GLUSTER,
+ .checkPool = virStorageBackendGlusterCheckPool,
.refreshPool = virStorageBackendGlusterRefreshPool,
.findPoolSources = virStorageBackendGlusterFindPoolSources,
--
2.12.1
7 years, 7 months
[libvirt] [PATCH v2 0/2] libvirt-python: libvirtaio
by Wojtek Porczyk
Hello, libvirt-list,
This is second attempt at merging libvirtaio, an event loop implementation
which dispatches the callbacks via asyncio's event loop.
The first patch fixes the bug around freeing opaque objects [1][2], and the
second one is the actual implementation.
Since v1 series, as per Daniel Berrange's notes, the second patch has licence
comment changed to LGPL-2.1+ and there is no import into main libvirt module.
The first patch is unchanged.
[1] https://www.redhat.com/archives/libvir-list/2017-January/msg00863.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1433028
Wojtek Porczyk (2):
Allow for ff callbacks to be called by custom event implementations
Add asyncio event loop implementation
libvirt-override.c | 36 ++---
libvirt-override.py | 39 +++++
libvirt-python.spec.in | 1 +
libvirtaio.py | 401 +++++++++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 5 +-
setup.py | 12 ++
6 files changed, 468 insertions(+), 26 deletions(-)
create mode 100644 libvirtaio.py
--
pozdrawiam / best regards _.-._
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>
7 years, 7 months