'const fooPtr' is the same as 'foo * const' (the pointer won't change, but it's contents can). But in general, if an interface is trying to be const-correct, it should be using 'const foo *' (the pointer is to data that can't be changed). Fix up offenders in src/qemu. * src/qemu/qemu_bridge_filter.h (networkAllowMacOnPort) (networkDisallowMacOnPort): Use intended type. * src/qemu/qemu_bridge_filter.c (networkAllowMacOnPort) (networkDisallowMacOnPort): Likewise. * src/qemu/qemu_command.c (qemuBuildTPMBackendStr) (qemuBuildTPMDevStr, qemuBuildCpuArgStr) (qemuBuildObsoleteAccelArg, qemuBuildMachineArgStr) (qemuBuildSmpArgStr, qemuBuildNumaArgStr): Likewise. * src/qemu/qemu_conf.c (qemuSharedDeviceEntryCopy): Likewise. * src/qemu/qemu_driver.c (qemuDomainSaveImageStartVM): Likewise. * src/qemu/qemu_hostdev.c (qemuDomainHostdevNetConfigVirtPortProfile): Likewise. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONAttachCharDevCommand): Likewise. Signed-off-by: Eric Blake <eblake@xxxxxxxxxx> --- src/qemu/qemu_bridge_filter.c | 10 +++++----- src/qemu/qemu_bridge_filter.h | 10 +++++----- src/qemu/qemu_command.c | 20 ++++++++++---------- src/qemu/qemu_conf.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_hostdev.c | 2 +- src/qemu/qemu_monitor_json.c | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c index ab4db9a..49954c6 100644 --- a/src/qemu/qemu_bridge_filter.c +++ b/src/qemu/qemu_bridge_filter.c @@ -1,6 +1,6 @@ /* + * Copyright (C) 2007-2009, 2013 Red Hat, Inc. * Copyright (C) 2009 IBM Corp. - * Copyright (C) 2007-2009 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -65,8 +65,8 @@ networkDisableAllFrames(virQEMUDriverPtr driver) { int networkAllowMacOnPort(virQEMUDriverPtr driver, const char * ifname, - const virMacAddrPtr mac) { - + const virMacAddr *mac) +{ int err; /* allow this combination of macaddr and ifname */ @@ -86,8 +86,8 @@ networkAllowMacOnPort(virQEMUDriverPtr driver, int networkDisallowMacOnPort(virQEMUDriverPtr driver, const char * ifname, - const virMacAddrPtr mac) { - + const virMacAddr *mac) +{ int err; /* disallow this combination of macaddr and ifname */ diff --git a/src/qemu/qemu_bridge_filter.h b/src/qemu/qemu_bridge_filter.h index ea8e0fa..bacced8 100644 --- a/src/qemu/qemu_bridge_filter.h +++ b/src/qemu/qemu_bridge_filter.h @@ -1,6 +1,6 @@ /* + * Copyright (C) 2007-2009, 2013 Red Hat, Inc. * Copyright (C) 2009 IBM Corp. - * Copyright (C) 2007-2009 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,11 @@ int networkAllowMacOnPort(virQEMUDriverPtr driver, - const char * ifname, - const virMacAddrPtr mac); + const char *ifname, + const virMacAddr *mac); int networkDisallowMacOnPort(virQEMUDriverPtr driver, - const char * ifname, - const virMacAddrPtr mac); + const char *ifname, + const virMacAddr *mac); int networkDisableAllFrames(virQEMUDriverPtr driver); int networkAddEbtablesRules(virQEMUDriverPtr driver); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index adb065e..246c11d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6262,11 +6262,11 @@ cleanup: } -static char *qemuBuildTPMBackendStr(const virDomainDefPtr def, +static char *qemuBuildTPMBackendStr(const virDomainDef *def, virQEMUCapsPtr qemuCaps, const char *emulator) { - const virDomainTPMDefPtr tpm = def->tpm; + const virDomainTPMDef *tpm = def->tpm; virBuffer buf = VIR_BUFFER_INITIALIZER; const char *type = virDomainTPMBackendTypeToString(tpm->type); char *cancel_path; @@ -6314,12 +6314,12 @@ static char *qemuBuildTPMBackendStr(const virDomainDefPtr def, } -static char *qemuBuildTPMDevStr(const virDomainDefPtr def, +static char *qemuBuildTPMDevStr(const virDomainDef *def, virQEMUCapsPtr qemuCaps, const char *emulator) { virBuffer buf = VIR_BUFFER_INITIALIZER; - const virDomainTPMDefPtr tpm = def->tpm; + const virDomainTPMDef *tpm = def->tpm; const char *model = virDomainTPMModelTypeToString(tpm->model); if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_TIS)) { @@ -6530,8 +6530,8 @@ error: static int -qemuBuildCpuArgStr(const virQEMUDriverPtr driver, - const virDomainDefPtr def, +qemuBuildCpuArgStr(virQEMUDriverPtr driver, + const virDomainDef *def, const char *emulator, virQEMUCapsPtr qemuCaps, virArch hostarch, @@ -6761,7 +6761,7 @@ cleanup: static int qemuBuildObsoleteAccelArg(virCommandPtr cmd, - const virDomainDefPtr def, + const virDomainDef *def, virQEMUCapsPtr qemuCaps) { bool disableKQEMU = false; @@ -6828,7 +6828,7 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd, static int qemuBuildMachineArgStr(virCommandPtr cmd, - const virDomainDefPtr def, + const virDomainDef *def, virQEMUCapsPtr qemuCaps) { bool obsoleteAccel = false; @@ -6915,7 +6915,7 @@ qemuBuildMachineArgStr(virCommandPtr cmd, } static char * -qemuBuildSmpArgStr(const virDomainDefPtr def, +qemuBuildSmpArgStr(const virDomainDef *def, virQEMUCapsPtr qemuCaps) { virBuffer buf = VIR_BUFFER_INITIALIZER; @@ -6956,7 +6956,7 @@ qemuBuildSmpArgStr(const virDomainDefPtr def, } static int -qemuBuildNumaArgStr(const virDomainDefPtr def, virCommandPtr cmd) +qemuBuildNumaArgStr(const virDomainDef *def, virCommandPtr cmd) { size_t i; virBuffer buf = VIR_BUFFER_INITIALIZER; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 1a41caf..a91cac4 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -833,7 +833,7 @@ qemuSharedDeviceEntryFree(void *payload, const void *name ATTRIBUTE_UNUSED) } static qemuSharedDeviceEntryPtr -qemuSharedDeviceEntryCopy(const qemuSharedDeviceEntryPtr entry) +qemuSharedDeviceEntryCopy(const qemuSharedDeviceEntry *entry) { qemuSharedDeviceEntryPtr ret = NULL; size_t i; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c71aecc..b9bceba 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5306,7 +5306,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, virQEMUDriverPtr driver, virDomainObjPtr vm, int *fd, - const virQEMUSaveHeaderPtr header, + const virQEMUSaveHeader *header, const char *path, bool start_paused) { diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 21fe47f..f2d99e3 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -334,7 +334,7 @@ cleanup: static int qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf, virNetDevVPortProfilePtr virtPort, - const virMacAddrPtr macaddr, + const virMacAddr *macaddr, const unsigned char *uuid, bool associate) { diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index cd6cb72..05f8aa6 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5237,7 +5237,7 @@ int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon, static virJSONValuePtr qemuMonitorJSONAttachCharDevCommand(const char *chrID, - const virDomainChrSourceDefPtr chr) + const virDomainChrSourceDef *chr) { virJSONValuePtr ret; virJSONValuePtr backend; -- 1.8.3.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list