[libvirt] [PATCH v2 0/1] vz: assign static IPs and default gateways for network adapter
by Mikhail Feoktistov
fix "avoid_if_before_free" warnings for VIR_FREE calls
fix "found diagnostic without %" warnings for virReportError calls
use virAsprintf instead of virBufferAsprintf
set default gateway only if static ip is present
write inet family to log in case of unsupported gateway
Mikhail Feoktistov (1):
vz: assign static IPs and default gateways for network adapter
9 years, 4 months
[libvirt] [PATCH RESEND] Added support for portable-rpcgen from portablexdr library
by Pavel Fedin
This patch allows to build libvirt natively under MinGW/MSYS using portablexdr library.
An updated version of portablexdr with fixed bugs is available as part of MSYS2 project.
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
configure.ac | 2 +-
src/lxc/lxc_monitor_protocol.x | 2 +-
src/rpc/genprotocol.pl | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index aed0934..547a405 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,7 +397,7 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"])
AC_CHECK_LIB([intl],[gettext],[])
dnl Do we have rpcgen?
-AC_PATH_PROG([RPCGEN], [rpcgen], [no])
+AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no])
AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
dnl Is this GLIBC's buggy rpcgen?
AM_CONDITIONAL([HAVE_GLIBC_RPCGEN],
diff --git a/src/lxc/lxc_monitor_protocol.x b/src/lxc/lxc_monitor_protocol.x
index 3b66af5..205d7c2 100644
--- a/src/lxc/lxc_monitor_protocol.x
+++ b/src/lxc/lxc_monitor_protocol.x
@@ -30,7 +30,7 @@ enum virLXCMonitorExitStatus {
};
struct virLXCMonitorExitEventMsg {
- enum virLXCMonitorExitStatus status;
+ virLXCMonitorExitStatus status;
};
struct virLXCMonitorInitEventMsg {
diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index 6e6d6d4..1ac2507 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -38,7 +38,10 @@ my $target = shift;
unlink $target;
-open RPCGEN, "-|", $rpcgen, $mode, $xdrdef
+if ($rpcgen =~ /portable-rpcgen/) {
+ $rpcgen = "$rpcgen -o -";
+}
+open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
or die "cannot run $rpcgen $mode $xdrdef: $!";
open TARGET, ">$target"
or die "cannot create $target: $!";
--
1.9.5.msysgit.0
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
9 years, 4 months
[libvirt] [PATCH] vz: assign static IPs and default gateways for network adapter
by Mikhail Feoktistov
We support only one IPv4 and one IPv6 default gateway.
If static IPs are not present in instance config,
then we switch on DHCP for this adapter.
PrlVmDevNet_SetAutoApply to makes necessary settings within guest OS
In linux case it creates network startup scripts
/etc/sysconfig/network-scripts/ifcfg-ethN and fills it with necessary
parameters.
---
src/vz/vz_sdk.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 120 insertions(+), 0 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index f27098c..7d318f8 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2788,8 +2788,13 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
PRL_HANDLE sdknet = PRL_INVALID_HANDLE;
PRL_HANDLE vnet = PRL_INVALID_HANDLE;
PRL_HANDLE job = PRL_INVALID_HANDLE;
+ PRL_HANDLE addrlist = PRL_INVALID_HANDLE;
+ size_t i;
int ret = -1;
char macstr[PRL_MAC_STRING_BUFNAME];
+ char *addrstr = NULL;
+ bool ipv6present = false;
+ bool ipv4present = false;
if (prlsdkCheckNetUnsupportedParams(net) < 0)
return -1;
@@ -2814,6 +2819,118 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
pret = PrlVmDevNet_SetMacAddress(sdknet, macstr);
prlsdkCheckRetGoto(pret, cleanup);
+ pret = PrlApi_CreateStringsList(&addrlist);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ for (i = 0; i < net->nips; i++) {
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ char *tmpstr;
+
+ if (AF_INET == VIR_SOCKET_ADDR_FAMILY(&net->ips[i]->address))
+ ipv4present = true;
+ else if (AF_INET6 == VIR_SOCKET_ADDR_FAMILY(&net->ips[i]->address))
+ ipv6present = true;
+ else
+ continue;
+
+ if (!(tmpstr = virSocketAddrFormat(&net->ips[i]->address)))
+ goto cleanup;
+
+ virBufferAsprintf(&buf, "%s/%d", tmpstr, net->ips[i]->prefix);
+ VIR_FREE(tmpstr);
+ if (!(addrstr = virBufferContentAndReset(&buf)))
+ goto cleanup;
+
+ pret = PrlStrList_AddItem(addrlist, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ VIR_FREE(addrstr);
+ addrstr = NULL;
+ }
+
+ if (ipv4present || ipv6present) {
+ pret = PrlVmDevNet_SetNetAddresses(sdknet, addrlist);
+ prlsdkCheckRetGoto(pret, cleanup);
+ }
+
+ pret = PrlVmDevNet_SetConfigureWithDhcp(sdknet, !ipv4present);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ pret = PrlVmDevNet_SetConfigureWithDhcpIPv6(sdknet, !ipv6present);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ pret = PrlVmDevNet_SetAutoApply(sdknet, true);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ if (net->nroutes) {
+ bool alreadySetIPv4Gateway = false;
+ bool alreadySetIPv6Gateway = false;
+
+ for (i = 0; i < net->nroutes; i++) {
+ virSocketAddrPtr addrdst, gateway;
+ virSocketAddr zero;
+
+ addrdst = virNetworkRouteDefGetAddress(net->routes[i]);
+ gateway = virNetworkRouteDefGetGateway(net->routes[i]);
+
+ ignore_value(virSocketAddrParse(&zero,
+ (VIR_SOCKET_ADDR_IS_FAMILY(addrdst, AF_INET)
+ ? VIR_SOCKET_ADDR_IPV4_ALL
+ : VIR_SOCKET_ADDR_IPV6_ALL),
+ VIR_SOCKET_ADDR_FAMILY(addrdst)));
+
+ if (!virSocketAddrEqual(addrdst, &zero)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only default gateway"));
+ goto cleanup;
+ }
+
+ switch (VIR_SOCKET_ADDR_FAMILY(gateway)) {
+ case AF_INET:
+ if (alreadySetIPv4Gateway) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only one IPv4 default gateway"));
+ goto cleanup;
+ }
+
+ if (!(addrstr = virSocketAddrFormat(gateway)))
+ goto cleanup;
+
+ pret = PrlVmDevNet_SetDefaultGateway(sdknet, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ alreadySetIPv4Gateway = true;
+ break;
+
+ case AF_INET6:
+ if (alreadySetIPv6Gateway) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only one IPv6 default gateway"));
+ goto cleanup;
+ }
+
+ if (!(addrstr = virSocketAddrFormat(gateway)))
+ goto cleanup;
+
+ pret = PrlVmDevNet_SetDefaultGatewayIPv6(sdknet, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ alreadySetIPv6Gateway = true;
+ break;
+
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only IPv4 and IPv6 default gateways"));
+ goto cleanup;
+ }
+
+ if (addrstr) {
+ VIR_FREE(addrstr);
+ addrstr = NULL;
+ }
+ }
+ }
+
if (isCt) {
if (net->model)
VIR_WARN("Setting network adapter for containers is not "
@@ -2879,6 +2996,9 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
ret = 0;
cleanup:
+ if (addrstr)
+ VIR_FREE(addrstr);
+ PrlHandle_Free(addrlist);
PrlHandle_Free(vnet);
PrlHandle_Free(sdknet);
return ret;
--
1.7.1
9 years, 4 months
[libvirt] [PATCH v2] vz: fix building capabilities
by Dmitry Guryanov
There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
VIR_ARCH_X86_64,
"vz",
NULL, 0, NULL)) == NULL)
Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.
Signed-off-by: Dmitry Guryanov <dguryanov(a)parallels.com>
---
src/vz/vz_driver.c | 92 ++++++++++++++++++++++--------------------------------
1 file changed, 38 insertions(+), 54 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 47c5023..8c3c818 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -78,14 +78,45 @@ vzDriverUnlock(vzConnPtr driver)
virMutexUnlock(&driver->lock);
}
+static int
+vzCapsAddGuestDomain(virCapsPtr caps,
+ virDomainOSType ostype,
+ virArch arch,
+ const char * emulator,
+ virDomainVirtType virt_type)
+{
+ virCapsGuestPtr guest;
+
+ if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator,
+ NULL, 0, NULL)) == NULL)
+ return -1;
+
+
+ if (virCapabilitiesAddGuestDomain(guest, virt_type,
+ NULL, NULL, 0, NULL) == NULL)
+ return -1;
+
+ return 0;
+}
+
static virCapsPtr
vzBuildCapabilities(void)
{
virCapsPtr caps = NULL;
virCPUDefPtr cpu = NULL;
virCPUDataPtr data = NULL;
- virCapsGuestPtr guest;
virNodeInfo nodeinfo;
+ virDomainOSType ostypes[] = {
+ VIR_DOMAIN_OSTYPE_HVM,
+ VIR_DOMAIN_OSTYPE_EXE
+ };
+ virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 };
+ const char *const emulators[] = { "parallels", "vz" };
+ virDomainVirtType virt_types[] = {
+ VIR_DOMAIN_VIRT_PARALLELS,
+ VIR_DOMAIN_VIRT_VZ
+ };
+ size_t i, j, k;
if ((caps = virCapabilitiesNew(virArchFromHost(),
false, false)) == NULL)
@@ -94,59 +125,12 @@ vzBuildCapabilities(void)
if (nodeCapsInitNUMA(caps) < 0)
goto error;
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ for (k = 0; k < 2; k++)
+ if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j],
+ emulators[k], virt_types[k]) < 0)
+ goto error;
if (nodeGetInfo(&nodeinfo))
goto error;
--
2.4.3
9 years, 4 months
[libvirt] [PATCH v2 0/2] Allow PCI virtio on ARM "virt" machine
by Pavel Fedin
Virt machine in qemu since v2.3.0 has PCI generic host controller, and can use
PCI devices. This provides performance improvement as well as vhost-net with
irqfd support for virtio-net. However libvirt still insists on virtio devices
attached to virt machine to have MMIO bindings. This patch allows to use both.
If the user doesn't specify <address type='virtio-mmio'>, PCI will be used by
default.
Changes since v1:
- Added capability based on qemu version number
- Recognize also "virt-" prefix
Pavel Fedin (2):
Introduce QEMU_CAPS_ARM_VIRT_PCI
Allow PCI virtio on ARM "virt" machine
src/qemu/qemu_capabilities.c | 5 +++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 15 ++++++++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
--
1.9.5.msysgit.0
9 years, 4 months
[libvirt] [PATCH] vz: fix building capabilities
by Dmitry Guryanov
There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
VIR_ARCH_X86_64,
"vz",
NULL, 0, NULL)) == NULL)
Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.
---
src/vz/vz_driver.c | 92 +++++++++++++++++++++------------------------------
1 files changed, 38 insertions(+), 54 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 47c5023..a86ae28 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -78,14 +78,45 @@ vzDriverUnlock(vzConnPtr driver)
virMutexUnlock(&driver->lock);
}
+static int
+vzCapsAddGuestDomain(virCapsPtr caps,
+ virDomainOSType ostype,
+ virArch arch,
+ const char * emulator,
+ virDomainVirtType virt_type)
+{
+ virCapsGuestPtr guest;
+
+ if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator,
+ NULL, 0, NULL)) == NULL)
+ return -1;
+
+
+ if (virCapabilitiesAddGuestDomain(guest, virt_type,
+ NULL, NULL, 0, NULL) == NULL)
+ return -1;
+
+ return 0;
+}
+
static virCapsPtr
vzBuildCapabilities(void)
{
virCapsPtr caps = NULL;
virCPUDefPtr cpu = NULL;
virCPUDataPtr data = NULL;
- virCapsGuestPtr guest;
virNodeInfo nodeinfo;
+ virDomainOSType ostypes[] = {
+ VIR_DOMAIN_OSTYPE_HVM,
+ VIR_DOMAIN_OSTYPE_EXE
+ };
+ virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 };
+ const char *const emulators[] = { "parallels", "vz" };
+ virDomainVirtType virt_types[] = {
+ VIR_DOMAIN_VIRT_PARALLELS,
+ VIR_DOMAIN_VIRT_VZ
+ };
+ size_t i, j, k;
if ((caps = virCapabilitiesNew(virArchFromHost(),
false, false)) == NULL)
@@ -94,59 +125,12 @@ vzBuildCapabilities(void)
if (nodeCapsInitNUMA(caps) < 0)
goto error;
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
+ for (i = 0; i < 1; i++)
+ for (j = 0; j < 1; j++)
+ for (k = 0; k < 1; k++)
+ if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j],
+ emulators[k], virt_types[k]) < 0)
+ goto error;
if (nodeGetInfo(&nodeinfo))
goto error;
--
1.7.1
9 years, 4 months
[libvirt] [libvirt-glib] gobject: Remove redundant virtual functions
by Zeeshan Ali (Khattak)
These virtual functions were most likely a result of copy&paste error.
---
libvirt-gobject/libvirt-gobject-network.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-network.h b/libvirt-gobject/libvirt-gobject-network.h
index 5617ed6..8c31af4 100644
--- a/libvirt-gobject/libvirt-gobject-network.h
+++ b/libvirt-gobject/libvirt-gobject-network.h
@@ -55,10 +55,7 @@ struct _GVirNetworkClass
{
GObjectClass parent_class;
- void (*started)(GVirNetwork *net);
- void (*stopped)(GVirNetwork *net);
-
- gpointer padding[20];
+ gpointer padding[22];
};
--
2.4.3
9 years, 4 months
[libvirt] [PATCH 0/2] [V3] Libvirt : Storage fixes
by Prerna Saxena
Here is V3 of storage fixes, which addresses review comments of v2.
Summary:
Prerna Saxena (2):
Storage: Introduce shadow vol for refresh while the main vol builds.
Storage : Fix cloning of raw, sparse volumes
src/storage/storage_backend.c | 23 ++++++++++-------------
src/storage/storage_driver.c | 19 ++++++++++++-------
2 files changed, 22 insertions(+), 20 deletions(-)
V2 :
http://www.redhat.com/archives/libvir-list/2015-June/msg01052.html
Changelog:
Modified patches 1,2 per review comments.
--
1.8.3.1
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
9 years, 4 months
[libvirt] [PATCH 0/7] Address some Coverity found issues
by John Ferlan
The following Coverity issues are flagged in Coverity 7.6.1 compared
to not being seen in 7.5.1 - this series just addresses those issues
before 7.6.1 is installed in our upstream Jenkins environment:
http://jenkins-virt.usersys.redhat.com/job/libvirt-coverity/
It seems the bulk are essentially false positives, but we can do something
in order to work around them.
For the first 3 patches, Coverity complains that virVasprintfInternal
can set "*strp = NULL;" on return (in the error path), but the callers
don't associate the error path (< 0) with the 'buffer' and thus believe
there could be some path where a return 0 would occur. This would result
in the callers of the virPCIFile, virPCIDriverFile, and virPCIDriverDir
having an error. Rather than try to add sa_assert()'s for each, adjust
the calls and callers to return the buffer
For the fourth patch, the strtok_r call expects that the first call will
have a non-NULL value for the first parameter and subsequent calls over
the same string would pass a NULL value in the first parameter and a
non-NULL parameter in the third parameter to be used as the "point" in
the string to continue looking for the token. However, Coverity doesn't
realize this and thus flags the strtok_r call with a possible forward
NULL dereference because we initialize the third parameter to NULL.
By adding an 'sa_assert' for what is the first argument lets Coverity
know we know what we're doing. Additionally, VIR_STRDUP could return a
NULL string and a zero return, the assertion in openvz_conf.c is on
the passed value to be scanned.
The fifth patch is perhaps the only one fixing a real issue; however,
it's been around since 1.2.11, so perhaps it's a less traveled path.
The sixth patch seems to be a false positive, but since Coverity doesn't
make the connection between nstack and stack, it's just as safe to
add the protection in the Free routine against a strange path being hit.
For the last patch, this is a false positive, but it also shows up in
the 7.5.1 coverity build:
http://jenkins-virt.usersys.redhat.com/job/libvirt-coverity/128/
Essentially the issue is that virResizeN can "return 0;" prior to
the virExpandN and that causes Coverity some angst since it would
then be possible to not have anything returned in "*ret" which would
cause a NULL dereference. Stepping through the logic has no path
in which that could happen. In order to handle this, rather than
use VIR_RESIZE_N for 'n' times through the loop, let's first count
the matches, use VIR_ALLOC_N, and then rerun the same loop filling
in each address as before. The difference being 'n' VIR_RESIZE_N
versus 2*'n' STREQ calls - perhaps a small wash performance wise.
John Ferlan (7):
util: Resolve Coverity FORWARD_NULL
util: Resolve Coverity FORWARD_NULL
util: Resolve Coverity FORWARD_NULL
Avoid Coverity FORWARD_NULL prior to strtok_r calls
phyp: Resolve Coverity FORWARD_NULL
util: Resolve Coverity FORWARD_NULL
util: Avoid Coverity FORWARD_NULL
src/esx/esx_vi.c | 1 +
src/libxl/libxl_conf.c | 1 +
src/openvz/openvz_conf.c | 2 ++
src/phyp/phyp_driver.c | 3 +--
src/util/virdbus.c | 4 +++
src/util/virpci.c | 67 ++++++++++++++++++++++++-----------------------
src/util/virtypedparam.c | 14 ++++++----
src/xenapi/xenapi_utils.c | 1 +
8 files changed, 53 insertions(+), 40 deletions(-)
--
2.1.0
9 years, 4 months