[libvirt] [PATCH] phyp: Fix memory leak in phypUUIDTable_Push
by ZhiPeng Lu
@remote_file, allocated by virAsprintf, was not freed and leaked.
Signed-off-by: Zhipeng Lu <lu.zhipeng(a)zte.com.cn>
---
src/phyp/phyp_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 9121581..662e2f7 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -568,6 +568,7 @@ phypUUIDTable_Push(virConnectPtr conn)
ret = 0;
cleanup:
+ VIR_FREE(remote_file);
if (channel) {
libssh2_channel_send_eof(channel);
libssh2_channel_wait_eof(channel);
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH 0/3] exposing busy polling support for vhost-net
by sferdjao@redhat.com
From: Sahid Orentino Ferdjaoui <sahid.ferdjaoui(a)redhat.com>
In version 2.7.0, QEMU introduced support of busy polling for
vhost-net [0]. To avoid paraphrasing original authors of that feature
and the purpose it I prefer to share a pointer [1].
This patch serie exposes throught the NIC driver-specific element a
new option 'poll_us'. That option is only available with the backend
driver 'vhost'.
The option 'poll_us' takes a positive number. 0 means that the option
is not going to be exposed.
[0] 69e87b32680a41d9761191443587c595b6f5fc3f
[1] https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg04595.html
Sahid Orentino Ferdjaoui (3):
qemu: add capability for vhost-net busy polling
conf: introduce 'poll_us' attribute for domain interface
qemu: add busy polling support
docs/formatdomain.html.in | 12 ++++++++++-
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 16 +++++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 6 ++++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 22 +++++++++++++++++++++
src/qemu/qemu_hotplug.c | 12 +++++++++++
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../qemuxml2argv-net-virtio-netdev-pollus-fail.xml | 23 ++++++++++++++++++++++
...xml2argv-net-virtio-netdev-pollus-qemu-fail.xml | 23 ++++++++++++++++++++++
.../qemuxml2argv-net-virtio-netdev-pollus.args | 23 ++++++++++++++++++++++
.../qemuxml2argv-net-virtio-netdev-pollus.xml | 23 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 9 +++++++++
18 files changed, 180 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-fail.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-qemu-fail.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.xml
--
2.9.4
7 years, 5 months
[libvirt] [PATCH v4 00/14] Make virNodeDeviceObj and virNodeDeviceObjList private
by John Ferlan
v3 here:
https://www.redhat.com/archives/libvir-list/2017-June/msg00155.html
Most patches were ACK'd in v3 (some with conditions). Changes this time
around are:
-> Patch1:
Make the call to virNodeDeviceObjFree in dev_refresh() prior to dev_create
Move the virNodeDeviceObjFree in device_removed() to after the Unlock as
it avoids the need for { } else { } (besides the *ObjFree checks for !dev
anyway).
-> Patch2:
Change as requested to remove the unnecessary obj = NULL in testDestroyVport
Change as requested to goto cleanup in testStoragePoolDestroy
-> Patch3:
Fixed the comments to have the right variable name
-> Patch4:
Use "if ((obj = ...))) {" type syntax as suggested.
-> Patch5-9:
No change
-> Patch10:
Fix commit description
-> Patch11:
No change
-> Patch 12:
Fix the testNodeDeviceDestroy logic
-> Patch 13-14
New patches that take the next two logical steps - objectifying the
virNodeDeviceObjList and using a HashTable for access (along with all
those bells and whistles). Finally remove the need for driver level
locks when accessing the @devs ObjList.
John Ferlan (14):
nodedev: Alter virNodeDeviceObjRemove
test: Adjust cleanup/error paths for nodedev test APIs
nodedev: Use common naming for virnodedeviceobj
nodedev: Use consistent names for driver variables
nodedev: Introduce virNodeDeviceObjNew
nodedev: Introduce virNodeDeviceObjListNew
nodedev: Alter node device obj list function names
nodedev: Dereference the obj/def in virNodeDeviceObjListFind* APIs
nodedev: Introduce virNodeDeviceGetSCSIHostCaps
nodedev: Introduce virNodeDeviceObjListFindSCSIHostByWWNs
nodedev: Privatize _virNodeDeviceObj and _virNodeDeviceObjList
nodedev: Convert virNodeDeviceObj to use virObjectLockable
nodedev: Convert virNodeDeviceObjListPtr to use hash tables
nodedev: Remove driver locks around object list mgmt code
src/conf/node_device_conf.c | 82 +++
src/conf/node_device_conf.h | 20 +-
src/conf/virnodedeviceobj.c | 846 ++++++++++++++++++++----------
src/conf/virnodedeviceobj.h | 67 +--
src/libvirt_private.syms | 20 +-
src/node_device/node_device_driver.c | 201 +++----
src/node_device/node_device_hal.c | 51 +-
src/node_device/node_device_linux_sysfs.c | 77 +--
src/node_device/node_device_udev.c | 63 +--
src/test/test_driver.c | 133 +++--
10 files changed, 895 insertions(+), 665 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH RESEND] virpcimock: Fix memory leak in pci_driver_new
by ZhiPeng Lu
@driverpath, allocated by virAsprintfQuiet, was not freed and leaked.
Signed-off-by: Zhipeng Lu <lu.zhipeng(a)zte.com.cn>
---
tests/virpcimock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index e9408aa..dec9e01 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -480,6 +480,7 @@ pci_driver_new(const char *name, int fail, ...)
if (VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver) < 0)
ABORT_OOM();
+ VIR_FREE(driverpath);
}
static struct pciDriver *
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH] util: increase libnl buffer size to 1M
by ZhiPeng Lu
nl_recv() returns the error "No buffer space available"
when using virsh destroy domain with 240 or more
passhthrough network interfaces.
The patch increases libnl sock receive buffer size to 1M,
and nl_recv() doesn't return error when destroying domain
with 512 network interfaces.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
---
src/util/virnetlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 92ecf77..bb56c54 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -189,10 +189,10 @@ virNetlinkCreateSocket(int protocol)
goto error;
}
- if (virNetlinkSetBufferSize(nlhandle, 131702, 0) < 0) {
+ if (virNetlinkSetBufferSize(nlhandle, 1048576, 0) < 0) {
virReportSystemError(errno, "%s",
_("cannot set netlink socket buffer "
- "size to 128k"));
+ "size to 1M"));
goto error;
}
nl_socket_enable_msg_peek(nlhandle);
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH 00/17] nwfilter adjustments for common object
by John Ferlan
As noted in the recently posted virObject changes:
https://www.redhat.com/archives/libvir-list/2017-June/msg00070.html
I believe I've found a way to handle the recursive lock situation that
made it "difficult" (at best) to convert the nwfilter to the common
object model. It does involve a bit of a circuitous route to "temporarily
implement" the refcnt in nwfilter, but that gets removed rather quickly.
Beyond that there's a bit of setup, the first few patches deal with
issues seen while working through this code and then more setup for
getting things to be more common with other drivers (so when they
disappear a bit further into the future) into some new object it'll
be obvious where/why they're there.
The middle few patches deal with an insane naming scheme for a single
function that seemed to keep prefixing "_" as a new function was created.
So it's a bit of name change, but makes it easier to think about.
The last 4 patches deal with the conversion to use a @ref, a change
to a list locking hash table model, the modificiation of the recursive
instantiation to use @refs rather than @locks, and finally the change
to use the existing lockable object.
I have run these through the various avacodo nwfilter tests that I could
find, but perhaps if someone that had a more "robust configuration" and
wants to be a bit adventurous and also give the patches a whirl - that
would be appreciated.
John Ferlan (17):
nwfilter: Fix return value comparison for
virNWFilterTriggerVMFilterRebuild
nwfilter: Fix possible corruption on failure path during LoadConfig
nwfilter: Fix possible locking problem in LoadConfig error path
nwfilter: Remove need for virNWFilterSaveXML
nwfilter: Move virNWFilterSaveConfig virnwfilterobj
nwfilter: Add configFile into virNWFilterObj
nwfilter: Add @def into virNWFilterObjNew
nwfilter: Clean up a couple nwfilter_driver error paths
nwfilter: Consistently name virNWFilterPtr in driver
nwfilter: Rename virNWFilterInstantiate
nwfilter: Rename __virNWFilterInstantiateFilter
nwfilter: Rename _virNWFilterInstantiateFilter
nwfilter: Introduce virNWFilterObjListFindInstantiateFilter
nwfilter: Add @refs logic to __virNWFilterObj
nwfilter: Convert _virNWFilterObjList to be a virObjectLockable
nwfilter: Remove recursive locking for nwfilter instantiation
nwfilter: Convert virNWFilterObj to use virObjectLockable
src/conf/nwfilter_conf.c | 43 ---
src/conf/nwfilter_conf.h | 9 -
src/conf/virnwfilterobj.c | 550 +++++++++++++++++++++++----------
src/conf/virnwfilterobj.h | 19 +-
src/libvirt_private.syms | 6 +-
src/nwfilter/nwfilter_driver.c | 51 ++-
src/nwfilter/nwfilter_gentech_driver.c | 276 +++++++----------
7 files changed, 542 insertions(+), 412 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH] docs: formatdomain: Tweak disk discard= docs
by Cole Robinson
Change from
'controls whether to discard ... requests are ignored'
to
'controls whether discard requests ... are ignored'
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
Pushed as trivial
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 01c6fce23..c12efcf78 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3002,7 +3002,7 @@
</li>
<li>
The optional <code>discard</code> attribute controls whether
- to discard (also known as "trim" or "unmap") requests are
+ discard requests (also known as "trim" or "unmap") are
ignored or passed to the filesystem. The value can be either
"unmap" (allow the discard request to be passed) or "ignore"
(ignore the discard request).
--
2.13.0
7 years, 5 months
[libvirt] [PATCH v2] qemu: Default hwclock source for sPAPR to RTC
by Kothapally Madhu Pavan
QEMU fails to launch a sPAPR guest with clock sources other that RTC.
Internally qemu only uses RTC timer for hwclock. This patch reports
the right error message instead of qemu erroring out when any other
timer other than RTC is used.
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8e7404d..b74800d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3025,6 +3025,7 @@ qemuDomainDefValidate(const virDomainDef *def,
virQEMUCapsPtr qemuCaps = NULL;
unsigned int topologycpus;
int ret = -1;
+ size_t i;
if (!(qemuCaps = virQEMUCapsCacheLookup(caps,
driver->qemuCapsCache,
@@ -3037,6 +3038,18 @@ qemuDomainDefValidate(const virDomainDef *def,
goto cleanup;
}
+ /* Only RTC timer is supported as hwclock for sPAPR machines */
+ for (i = 0; i < def->clock.ntimers; i++) {
+ virDomainTimerDefPtr timer = def->clock.timers[i];
+ if (ARCH_IS_PPC64(def->os.arch) && timer->name != VIR_DOMAIN_TIMER_NAME_RTC) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported clock timer '%s' for %s architecture"),
+ virDomainTimerNameTypeToString(def->clock.timers[i]->name),
+ virArchToString(def->os.arch));
+ goto cleanup;
+ }
+ }
+
/* On x86, UEFI requires ACPI */
if (def->os.loader &&
def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
--
1.8.3.1
7 years, 5 months
[libvirt] qemu: hotplug virtio_scsi over lsilogic when sicsi controller is not present?
by Liang Yan
Hi,
We hit some problems when we attached some lun devices in our vm, turns
out that libvirt created lsilogic scsi controller automatically for
these scsi devices, however these device works well under virtio_scsi
controller.
the current code logic is check lsilogic first, if qemu could not
support it, then check virtio_scsi, however is it better to check
virtio_scsi earlier? since it is supported better in qemu level?
I am wondering which solution is better?
1. simple switch sequence and check virtio_scsi first
2. add extra option for "virsh attach-disk" to choose specific
controller type
Thanks,
Liang
====================================
Code part is like below
qemu_hotplug.c qemuDomainFindOrCreateSCSIDiskController
/* No SCSI controller present, for backward compatibility we
* now hotplug a controller */
if (VIR_ALLOC(cont) < 0)
return NULL;
cont->type = VIR_DOMAIN_CONTROLLER_TYPE_SCSI;
cont->idx = controller;
cont->model = -1;
VIR_INFO("No SCSI controller present, hotplugging one");
if (qemuDomainAttachControllerDevice(driver,
qemu_domain_address.c qemuDomainSetSCSIControllerModel
if (qemuDomainIsPSeries(def)) {
*model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) {
*model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC;
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI)) {
*model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to determine model for scsi
controller"));
return -1;
7 years, 5 months
[libvirt] [PATCH 0/8] More virsecretobj changes to prepare for common object
by John Ferlan
A couple I forgot from earlier series, but a few things found since then
along with some clarifications to make the ObjAdd processing a bit more
like I've found for nwfilter, nodedev, and interface as well as making
the ObjListRemove processing a bit clearer and more consistent.
Along with the other series and the virObject v2 adjustments - this brings
everything close enough to start sending the patches that will tie all this
stuff together to create/use a common object model.
John Ferlan (8):
secret: Whitespace modification for secret_driver
secret: Alter FindByUUID to expect the formatted uuidstr
secret: Rename variable in virSecretObjListAdd
secret: Clean up virSecretObjListAdd processing
secret: Remove need for local configFile and base64File in ObjectAdd
secret: Have virSecretObjNew consume newdef
secret: Properly handle @def after virSecretObjAdd in driver
secret: Handle object list removal and deletion properly
src/conf/virsecretobj.c | 125 +++++++++++++++++++++------------------------
src/conf/virsecretobj.h | 2 +-
src/secret/secret_driver.c | 50 ++++++++++++------
3 files changed, 94 insertions(+), 83 deletions(-)
--
2.9.4
7 years, 5 months