[libvirt] [PATCH] virhostdev: Fix PCI devices are still attatched to stub driver bug
by Wu Zongyong
Currently, PCI devices will not be rebound to host drivers but
attached to the stub driver when:
1) use libvirt to start a virtual machine with PCI devices assigned,
then stop libvirtd process and shutdown the virtual machine. Finally,
PCI devices are still bound to the stub driver instead of host drivers
after libvirt start again.
2) use libvirt to shutdown a virtual machine wtih PCI devices assigned,
then stop libvirtd process before libvirt try to rebind PCI devices to
host drivers. Finally, PCI devices are still bound to the stub driver
after libvirt start again.
Notice that the comment on the top of virPCIDeviceDetach as follows:
activeDevs should be a list of all PCI devices currently in use by a
domain.inactiveDevs is a list of all PCI devices that libvirt has
detached from the host driver + attached to the stub driver, but
hasn't yet assigned to a domain.
It's not reasonable that libvirt filter out devices that are either not
active or not used by the current domain and driver. For devices belong
to domains that has been shutdown before libvirt start, we should put
them into inactiveDevs if then meet the condition that PCI devices have
been detached from the host driver + attached to the stub driver.
Moreover, we set orignal states of PCI devices when build PCI devices
list in virHostdevGetPCIHostDeviceList if states has been set in struct
virDomainHostdevDefPtr.
Signed-off-by: Wu Zongyong <cordius.wu(a)huawei.com>
---
src/util/virhostdev.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index ca79c37..ecf95e3 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -235,6 +235,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci;
+ virDomainHostdevOrigStatesPtr origstates = &hostdev->origstates;
virPCIDevicePtr pci;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
@@ -262,6 +263,10 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_XEN);
else
virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_KVM);
+
+ virPCIDeviceSetUnbindFromStub(pci, origstates->states.pci.unbind_from_stub);
+ virPCIDeviceSetRemoveSlot(pci, origstates->states.pci.remove_slot);
+ virPCIDeviceSetReprobe(pci, origstates->states.pci.reprobe);
}
return pcidevs;
@@ -1008,8 +1013,19 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
continue;
}
} else {
- virPCIDeviceListDel(pcidevs, pci);
- continue;
+ int stub = virPCIDeviceGetStubDriver(pci);
+ if (stub > VIR_PCI_STUB_DRIVER_NONE &&
+ stub < VIR_PCI_STUB_DRIVER_LAST) {
+ /* The device is bound to a known stub driver: add a copy
+ * to the inactive list */
+ VIR_DEBUG("Adding PCI device %s to inactive list",
+ virPCIDeviceGetName(pci));
+ if (virPCIDeviceListAddCopy(mgr->inactivePCIHostdevs, pci) < 0) {
+ VIR_ERROR(_("Failed to add PCI device %s to the inactive list"),
+ virGetLastErrorMessage());
+ virResetLastError();
+ }
+ }
}
i++;
--
1.9.1
6 years, 1 month
[libvirt] [jenkins-ci PATCH] Forcefully remove build/ directory for autotools builds
by Andrea Bolognani
Normally this shouldn't be needed, because 'git clean -xdf' is
executed after updating the git repository and before starting
the build; however, some RPM builds (notably libvirt's)
internally use git to apply patches, and if one of those fails
it will leave a git repository inside of build/ behind, which
'git clean' dutifully refuses to remove and whose presence
will in turn cause 'mkdir build', and thus the entire build,
to fail.
Solve the issue by forcefully removing build/ ourselves before
starting an autotools build.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/build/jobs/autotools-build-job.yml | 1 +
jobs/autotools.yaml | 1 +
2 files changed, 2 insertions(+)
diff --git a/guests/playbooks/build/jobs/autotools-build-job.yml b/guests/playbooks/build/jobs/autotools-build-job.yml
index bf7a616..01b6ff5 100644
--- a/guests/playbooks/build/jobs/autotools-build-job.yml
+++ b/guests/playbooks/build/jobs/autotools-build-job.yml
@@ -6,6 +6,7 @@
{{ global_env }}
{{ local_env }}
+ rm -rf build
mkdir build
cd build
../autogen.sh --prefix=$VIRT_PREFIX {{ autogen_args }}
diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml
index 8956855..9349b8c 100644
--- a/jobs/autotools.yaml
+++ b/jobs/autotools.yaml
@@ -41,6 +41,7 @@
- shell: |
{global_env}
{local_env}
+ rm -rf build
mkdir build
cd build
../autogen.sh --prefix=$VIRT_PREFIX {autogen_args}
--
2.17.1
6 years, 1 month
[libvirt] [PATCH] Remove ignore_value or void from unlink calls
by John Ferlan
There seems to be no need to add the ignore_value wrapper or
caste with (void) to the unlink() calls, so let's just remove
them. I assume at one point in time Coverity complained. So,
let's just be consistent - those that care to check the return
status can and those that don't can just have the naked unlink.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
As a result of Michal's review comment on my recent storage driver
error path series...
src/conf/virsecretobj.c | 2 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +-
src/storage/storage_driver.c | 4 ++--
src/util/virfilecache.c | 2 +-
src/util/virnetdev.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 2ff2998c15..78911c0908 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -666,7 +666,7 @@ virSecretObjDeleteData(virSecretObjPtr obj)
{
/* The configFile will already be removed, so secret won't be
* loaded again if this fails */
- (void)unlink(obj->base64File);
+ unlink(obj->base64File);
}
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 2330ba0479..6d114557c7 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -1923,7 +1923,7 @@ virNWFilterSnoopLeaseFileRefresh(void)
if (rename(TMPLEASEFILE, LEASEFILE) < 0) {
virReportSystemError(errno, _("rename(\"%s\", \"%s\")"),
TMPLEASEFILE, LEASEFILE);
- ignore_value(unlink(TMPLEASEFILE));
+ unlink(TMPLEASEFILE);
}
virAtomicIntSet(&virNWFilterSnoopState.wLeases, 0);
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 04c2adcfb5..394202942f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4304,7 +4304,7 @@ virQEMUCapsInitQMPCommandAbort(virQEMUCapsInitQMPCommandPtr cmd)
cmd->cmd = NULL;
if (cmd->monpath)
- ignore_value(unlink(cmd->monpath));
+ unlink(cmd->monpath);
virDomainObjEndAPI(&cmd->vm);
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index bf43d77c8b..7c22c43584 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -84,7 +84,7 @@ storagePoolRefreshFailCleanup(virStorageBackendPtr backend,
virErrorPtr orig_err = virSaveLastError();
if (stateFile)
- ignore_value(unlink(stateFile));
+ unlink(stateFile);
if (backend->stopPool)
backend->stopPool(obj);
if (orig_err) {
@@ -142,7 +142,7 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to initialize storage pool '%s': %s"),
def->name, virGetLastErrorMessage());
- ignore_value(unlink(stateFile));
+ unlink(stateFile);
active = false;
}
diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c
index 2927c68358..15c0d99fd9 100644
--- a/src/util/virfilecache.c
+++ b/src/util/virfilecache.c
@@ -161,7 +161,7 @@ virFileCacheLoad(virFileCachePtr cache,
if (!cache->handlers.isValid(loadData, cache->priv)) {
VIR_DEBUG("Outdated cached capabilities '%s' for '%s'", file, name);
- ignore_value(unlink(file));
+ unlink(file);
ret = 0;
goto cleanup;
}
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 39c91313de..e94960c9da 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2161,7 +2161,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
}
/* we won't need the file again */
- ignore_value(unlink(filePath));
+ unlink(filePath);
ret = 0;
cleanup:
--
2.17.1
6 years, 1 month
[libvirt] [PATCH 0/5] Cleanup some storage driver paths
by John Ferlan
See the patches for details - everything leads to the last one.
John Ferlan (5):
storage: Clean up stateFile if refreshPool fails
storage: Clean up storagePoolUpdateStateCallback processing
storage: Create error label path for storagePoolCreateXML
storage: Introduce storagePoolRefreshFailCleanup
storage: Save error during refresh failure processing
src/storage/storage_driver.c | 73 ++++++++++++++++++++----------------
1 file changed, 40 insertions(+), 33 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [libvirt PATCH v6 00/15] Finish the conversion to virConfGetValue* functions libvirt
by Fabiano Fidêncio
This patchset finishes the conversion to virConfGetValue* functions,
started by Daniel Berrange a few months ago.
Please, mind that although we could make virConfGetValue* functions more
generic in order to support numbers and booleans as strings, that
doesn't seem the safest path to take. The side-effect of this is that we
will have to live with some specific code doing that as part of vmx and
xen_common.
Once this patchset gets merged,
https://wiki.libvirt.org/page/BiteSizedTasks#Finish_conversion_to_virConf...
can be removed.
- Changes since v1:
All the "values" from virConfGetValueString() are freed
- Changes since v2:
All comments from Ján Tomko have been addressed;
A few leaks were (possibly) found and they're addressed in the last
patch of the series;
- Changes since v3:
All comments from Ján Tomko have been addressed in order to lower the
non-whitespace changes in the first patch;
- Changes since v4:
All comments from Ján Tomko have been addressed (hopefully, they
actually were this time :-));
- Changes since v5:
All comments from John Ferlan have been addressed, including splitting
the patches per "function" touched. Some new patches were also needed
due to a behaviour change introduced by the "xen_common: Change
xenParsePCIList to using virConfGetValueStringList" patch.
Fabiano Fidêncio (15):
xen_common: Change xenConfigCopyStringInternal to using
virConfGetValueString
xen_common: Change xenConfigGetUUID to using virConfGetValueString
xen_common: Change xenConfigGetString to using virConfGetValueString
xen_xl: Adapt xenParseCmdline due to changes in xenConfigGetString
xen_xl: Adapt xenParseXLOS due to changes in xenConfigGetString
xen_xl: adapt xenParseXLCPUID due to changes in xenConfigGetString
xen_common: Adapt xenParseEventsActions due to changes in
xenConfigGetString
xen_common: Adapt xenParseCPUFeatures due to changes in
xenConfigGetString
xen_common: Adapt xenParseEmulatedDevices due to changes in
xenConfigGetString
xen_common: Adapt xenParseGeneralMeta due to changes in
xenConfigGetString
xen_xm: Adapt xenParseXMOS due to changes in xenConfigGetString
xen_xm: Adapt xenParseXMInputDevs due to changes in xenConfigGetString
xen_common: Change xenParsePCIList to using virConfGetValueStringList
xen_common: Change xenParseVfbs to using virConfGetValueStringList
xen_common: Change xenParseCharDev to using virConfGetValueStringList
src/xenconfig/xen_common.c | 223 +++++++++++++++++++------------------
src/xenconfig/xen_xl.c | 71 +++++++-----
src/xenconfig/xen_xm.c | 48 ++++----
3 files changed, 186 insertions(+), 156 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH 0/2] Tiny system header cleanup
by Erik Skultety
Cleanup of the headers already pulled in by internal.h header. Examples are
of course excluded from this change. Some more serious cleanup might come in a
while.
Erik Skultety (2):
internal: Move <stdio.h> include to internal.h
src: More cleanup of some system headers already contained in
internal.h
src/bhyve/bhyve_capabilities.c | 1 -
src/conf/capabilities.c | 4 ----
src/conf/network_conf.c | 1 -
src/conf/node_device_conf.c | 1 -
src/conf/storage_conf.c | 4 ----
src/cpu/cpu_ppc64.c | 1 -
src/cpu/cpu_ppc64_data.h | 1 -
src/cpu/cpu_x86.c | 1 -
src/cpu/cpu_x86_data.h | 1 -
src/esx/esx_storage_backend_iscsi.c | 2 --
src/esx/esx_storage_backend_vmfs.c | 2 --
src/esx/esx_vi_types.c | 1 -
src/interface/interface_backend_udev.c | 1 -
src/internal.h | 1 +
src/libvirt.c | 3 ---
src/libxl/libxl_logger.c | 1 -
src/locking/lock_daemon.c | 1 -
src/locking/lock_driver_sanlock.c | 4 ----
src/locking/lock_manager.c | 1 -
src/locking/sanlock_helper.c | 2 --
src/logging/log_daemon.c | 1 -
src/lxc/lxc_container.c | 3 ---
src/lxc/lxc_controller.c | 1 -
src/lxc/lxc_driver.c | 1 -
src/lxc/lxc_fuse.c | 3 ---
src/lxc/lxc_native.c | 1 -
src/network/bridge_driver.c | 5 -----
src/network/leaseshelper.c | 2 --
src/node_device/node_device_driver.c | 1 -
src/node_device/node_device_hal.c | 2 --
src/node_device/node_device_udev.h | 1 -
src/nwfilter/nwfilter_ebiptables_driver.c | 1 -
src/openvz/openvz_conf.c | 5 -----
src/openvz/openvz_driver.c | 5 -----
src/phyp/phyp_driver.c | 5 -----
src/qemu/qemu_agent.c | 1 -
src/qemu/qemu_conf.c | 4 ----
src/qemu/qemu_driver.c | 5 -----
src/qemu/qemu_hostdev.c | 1 -
src/qemu/qemu_monitor_json.c | 1 -
src/qemu/qemu_monitor_text.c | 1 -
src/qemu/qemu_security.h | 1 -
src/remote/remote_daemon.c | 1 -
src/rpc/virnetdaemon.c | 1 -
src/rpc/virnetmessage.c | 1 -
src/rpc/virnetservermdns.c | 2 --
src/rpc/virnettlscontext.c | 1 -
src/secret/secret_driver.c | 1 -
src/security/security_apparmor.c | 1 -
src/security/security_driver.c | 1 -
src/security/virt-aa-helper.c | 4 ----
src/storage/parthelper.c | 2 --
src/storage/storage_backend.c | 1 -
src/storage/storage_backend_disk.c | 2 --
src/storage/storage_backend_fs.c | 3 ---
src/storage/storage_backend_iscsi.c | 1 -
src/storage/storage_backend_logical.c | 2 --
src/storage/storage_backend_mpath.c | 1 -
src/storage/storage_backend_scsi.c | 1 -
src/storage/storage_driver.c | 3 ---
src/storage/storage_file_fs.c | 1 -
src/storage/storage_util.c | 2 --
src/test/test_driver.c | 2 --
src/uml/uml_conf.c | 4 ----
src/uml/uml_driver.c | 5 -----
src/util/iohelper.c | 2 --
src/util/viralloc.c | 1 -
src/util/virarptable.c | 2 --
src/util/viraudit.c | 1 -
src/util/virauth.c | 1 -
src/util/virbitmap.c | 5 -----
src/util/virbuffer.c | 3 ---
src/util/vircgroup.c | 4 ----
src/util/vircommand.c | 1 -
src/util/virconf.c | 2 --
src/util/virdnsmasq.c | 5 -----
src/util/virerror.c | 3 ---
src/util/virevent.c | 1 -
src/util/vireventpoll.c | 3 ---
src/util/virfile.c | 1 -
src/util/virfile.h | 1 -
src/util/virgettext.c | 1 -
src/util/virhash.c | 2 --
src/util/virhash.h | 2 --
src/util/virhook.c | 2 --
src/util/virhostcpu.c | 5 -----
src/util/virhostdev.c | 2 --
src/util/virhostmem.c | 5 -----
src/util/viriptables.c | 5 -----
src/util/viriscsi.c | 1 -
src/util/virkeycode.c | 1 -
src/util/virkeyfile.c | 1 -
src/util/virlog.c | 2 --
src/util/virmacaddr.c | 2 --
src/util/virnetdevmacvlan.c | 3 ---
src/util/virnetdevopenvswitch.c | 1 -
src/util/virnetdevtap.c | 3 ---
src/util/virnetdevvportprofile.c | 3 ---
src/util/virnetlink.c | 1 -
src/util/virpci.c | 4 ----
src/util/virprocess.c | 2 --
src/util/virrandom.c | 1 -
src/util/virscsi.c | 3 ---
src/util/virsexpr.c | 4 ----
src/util/virstoragefile.c | 1 -
src/util/virstoragefilebackend.c | 1 -
src/util/virstring.c | 2 --
src/util/virsysinfo.c | 2 --
src/util/virtime.c | 1 -
src/util/virusb.c | 3 ---
src/util/virutil.c | 4 ----
src/util/viruuid.c | 4 ----
src/util/virxml.c | 4 ----
src/vbox/vbox_XPCOMCGlue.c | 1 -
src/vmware/vmware_conf.c | 1 -
src/vz/vz_driver.c | 5 -----
src/xenapi/xenapi_driver.c | 2 --
src/xenapi/xenapi_utils.c | 2 --
tests/commandhelper.c | 3 ---
tests/commandtest.c | 3 ---
tests/cputest.c | 3 ---
tests/domaincapsmock.c | 1 -
tests/domaincapstest.c | 1 -
tests/domainsnapshotxml2xmltest.c | 3 ---
tests/esxutilstest.c | 2 --
tests/eventtest.c | 1 -
tests/fdstreamtest.c | 1 -
tests/genericxml2xmltest.c | 3 ---
tests/interfacexml2xmltest.c | 3 ---
tests/libxlxml2domconfigtest.c | 3 ---
tests/lxcxml2xmltest.c | 3 ---
tests/networkxml2conftest.c | 3 ---
tests/networkxml2xmltest.c | 3 ---
tests/networkxml2xmlupdatetest.c | 3 ---
tests/nodedevxml2xmltest.c | 3 ---
tests/nsstest.c | 1 -
tests/nwfilterxml2xmltest.c | 3 ---
tests/openvzutilstest.c | 2 --
tests/qemuargv2xmltest.c | 3 ---
tests/qemublocktest.c | 1 -
tests/qemucapsprobemock.c | 1 -
tests/qemucpumock.c | 1 -
tests/qemumemlocktest.c | 3 ---
tests/qemumonitortestutils.c | 3 ---
tests/qemuxml2argvtest.c | 3 ---
tests/qemuxml2xmltest.c | 3 ---
tests/seclabeltest.c | 4 ----
tests/secretxml2xmltest.c | 1 -
tests/securityselinuxhelper.c | 2 --
tests/securityselinuxlabeltest.c | 3 ---
tests/securityselinuxtest.c | 3 ---
tests/sexpr2xmltest.c | 2 --
tests/shunloadhelper.c | 1 -
tests/shunloadtest.c | 2 --
tests/sockettest.c | 3 ---
tests/ssh.c | 1 -
tests/storagebackendsheepdogtest.c | 3 ---
tests/storagepoolxml2xmltest.c | 3 ---
tests/storagevolxml2xmltest.c | 3 ---
tests/sysinfotest.c | 3 ---
tests/testutils.c | 4 ----
tests/testutils.h | 1 -
tests/testutilslxc.c | 1 -
tests/testutilsqemu.c | 1 -
tests/testutilsxen.c | 1 -
tests/utiltest.c | 3 ---
tests/vboxsnapshotxmltest.c | 2 --
tests/virauthconfigtest.c | 1 -
tests/virbuftest.c | 3 ---
tests/vircaps2xmltest.c | 1 -
tests/vircapstest.c | 1 -
tests/vircgroupmock.c | 2 --
tests/vircgrouptest.c | 1 -
tests/virconftest.c | 4 ----
tests/virdbustest.c | 1 -
tests/virfiletest.c | 1 -
tests/virfilewrapper.c | 2 --
tests/virhashtest.c | 3 ---
tests/virhostcputest.c | 3 ---
tests/virhostdevtest.c | 2 --
tests/viridentitytest.c | 1 -
tests/virjsontest.c | 3 ---
tests/virkeycodetest.c | 1 -
tests/virkeyfiletest.c | 1 -
tests/virkmodtest.c | 1 -
tests/virlockspacetest.c | 1 -
tests/virmock.h | 2 --
tests/virnetdevmock.c | 2 --
tests/virnetmessagetest.c | 1 -
tests/virnetsockettest.c | 1 -
tests/virnettlscontexttest.c | 1 -
tests/virnettlshelpers.c | 1 -
tests/virnettlssessiontest.c | 1 -
tests/virnwfilterbindingxml2xmltest.c | 3 ---
tests/virpcimock.c | 2 --
tests/virpcitest.c | 2 --
tests/virpolkittest.c | 1 -
tests/virportallocatormock.c | 3 ---
tests/virportallocatortest.c | 1 -
tests/virrandommock.c | 1 -
tests/virresctrltest.c | 1 -
tests/virrotatingfiletest.c | 1 -
tests/virschematest.c | 1 -
tests/virscsitest.c | 1 -
tests/virshtest.c | 2 --
tests/virstoragetest.c | 1 -
tests/virstorageutiltest.c | 1 -
tests/virstringtest.c | 1 -
tests/virsystemdtest.c | 1 -
tests/virtimetest.c | 1 -
tests/virtypedparamtest.c | 1 -
tests/viruritest.c | 1 -
tests/virusbmock.c | 1 -
tests/virusbtest.c | 1 -
tests/vmwarevertest.c | 2 --
tests/vmx2xmltest.c | 2 --
tests/vshtabletest.c | 2 --
tests/xlconfigtest.c | 2 --
tests/xmconfigtest.c | 2 --
tests/xml2sexprtest.c | 3 ---
tests/xml2vmxtest.c | 2 --
tools/virsh-console.c | 3 ---
tools/virsh.c | 5 -----
tools/virsh.h | 3 ---
tools/virt-admin.c | 1 -
tools/virt-host-validate-bhyve.c | 1 -
tools/virt-host-validate-common.c | 2 --
tools/virt-host-validate.c | 2 --
tools/virt-login-shell.c | 3 ---
tools/vsh-table.c | 1 -
tools/vsh.c | 5 -----
tools/vsh.h | 3 ---
tools/wireshark/src/packet-libvirt.c | 1 -
233 files changed, 1 insertion(+), 480 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH v3] qemu: Ignore nwfilter binding instantiation issues during reconnect
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1607202
It's essentially stated in the nwfilterBindingDelete that we
will allow the admin to shoot themselves in the foot by deleting
the nwfilter binding which then allows them to undefine the
nwfilter that is in use for the running guest...
However, by allowing this we cause a problem for libvirtd
restart reconnect processing which would then try to recreate
the missing binding attempting to use the deleted filter
resulting in an error and thus shutting the guest down.
So rather than keep adding virDomainConfNWFilterInstantiate
flags to "ignore" specific error conditions, modify the logic
to ignore, but VIR_WARN errors other than ignoreExists. This
will at least allow the guest to not shutdown for only nwfilter
binding errors that we can now perhaps recover from since we
have the binding create/delete capability.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
v2: https://www.redhat.com/archives/libvir-list/2018-August/msg01567.html
Differences to v2. Leave the ignoreExists bool, but just allow and
VIR_WARN other errors from virDomainConfNWFilterInstantiate. Continue
processing all filters from error point too.
src/qemu/qemu_process.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ab749389ee..61a277f468 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3160,20 +3160,29 @@ qemuProcessNotifyNets(virDomainDefPtr def)
}
}
-static int
-qemuProcessFiltersInstantiate(virDomainDefPtr def, bool ignoreExists)
+/* Attempt to instantiate the filters. Ignore failures because it's
+ * possible that someone deleted a filter binding and the associated
+ * filter while the guest was running and we don't want that action
+ * to cause failure to keep the guest running during the reconnection
+ * processing. Nor do we necessarily want other failures to do the
+ * same. We'll just log the error conditions other than of course
+ * ignoreExists possibility (e.g. the true flag) */
+static void
+qemuProcessFiltersInstantiate(virDomainDefPtr def)
{
size_t i;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
if ((net->filter) && (net->ifname)) {
- if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net, ignoreExists) < 0)
- return 1;
+ if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net,
+ true) < 0) {
+ VIR_WARN("filter '%s' instantiation for '%s' failed '%s'",
+ net->filter, net->ifname, virGetLastErrorMessage());
+ virResetLastError();
+ }
}
}
-
- return 0;
}
static int
@@ -7892,8 +7901,7 @@ qemuProcessReconnect(void *opaque)
qemuProcessNotifyNets(obj->def);
- if (qemuProcessFiltersInstantiate(obj->def, true))
- goto error;
+ qemuProcessFiltersInstantiate(obj->def);
if (qemuProcessRefreshDisks(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
goto error;
--
2.17.1
6 years, 1 month
[libvirt] [PATCH V3 0/2] libxl: drop support for Xen 4.4 and 4.5
by Jim Fehlig
V2: https://www.redhat.com/archives/libvir-list/2018-September/msg00383.html
New in V3:
- Change definition of LIBXL_API_VERSION to 0x040500, the API
version set when Xen 4.6 was released
- Drop the 'true' parameter to LIBVIRT_CHECK_PKG macro so
configure fails if libxl is requested but the devel packages
are not installed
- Remove a now unused variable and a redundant 'if test with_libxl'
check
- Moved the news file addition to 'Removed features' section
Jim Fehlig (2):
libxl: drop support for Xen < 4.6
news: Announce dropping support for Xen 4.4 and 4.5
docs/drvxen.html.in | 2 +-
docs/news.xml | 11 +++++++++++
m4/virt-driver-libxl.m4 | 27 ++-------------------------
src/libxl/libxl_domain.c | 2 +-
src/libxl/libxl_driver.c | 2 +-
5 files changed, 16 insertions(+), 28 deletions(-)
--
2.18.0
6 years, 1 month
[libvirt] [PATCH] secret: Makefile: Fix an EXTRA_DIST typo
by Erik Skultety
So, when trying to add some secret util sources, we referenced them with
a non-existent symbol.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/secret/Makefile.inc.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am
index 305c4a1ead..79c2b2d74a 100644
--- a/src/secret/Makefile.inc.am
+++ b/src/secret/Makefile.inc.am
@@ -13,7 +13,7 @@ DRIVER_SOURCE_FILES += $(SECRET_DRIVER_SOURCES)
STATEFUL_DRIVER_SOURCE_FILES += $(SECRET_DRIVER_SOURCES)
EXTRA_DIST += \
$(SECRET_DRIVER_SOURCES) \
- $(SECRET_UTIL_SOURCESQ) \
+ $(SECRET_UTIL_SOURCES) \
$(NULL)
noinst_LTLIBRARIES += libvirt_secret.la
--
2.17.1
6 years, 1 month
[libvirt] [PATCH 0/9] cgroup cleanups and preparation for v2
by Pavel Hrdina
Pavel Hrdina (9):
vircgroup: cleanup controllers not managed by systemd on error
vircgroup: fix bug in virCgroupEnableMissingControllers
vircgroup: rename virCgroupAdd.*Task to virCgroupAdd.*Process
vircgroup: introduce virCgroupTaskFlags
vircgroup: introduce virCgroupAddThread
vircgroupmock: cleanup unused cgroup files
vircgroupmock: rewrite cgroup fopen mocking
vircgrouptest: call virCgroupDetectMounts directly
vircgrouptest: call virCgroupNewSelf instead virCgroupDetectMounts
src/libvirt-lxc.c | 2 +-
src/libvirt_private.syms | 6 +-
src/lxc/lxc_controller.c | 4 +-
src/qemu/qemu_process.c | 4 +-
src/qemu/qemu_tpm.c | 2 +-
src/util/vircgroup.c | 135 +++++++-----
src/util/vircgroup.h | 5 +-
src/util/vircgrouppriv.h | 4 -
tests/vircgroupdata/all-in-one.cgroups | 7 +
tests/vircgroupdata/all-in-one.mounts | 2 +-
tests/vircgroupdata/all-in-one.parsed | 12 +-
tests/vircgroupdata/all-in-one.self.cgroup | 1 +
tests/vircgroupdata/cgroups1.cgroups | 11 +
tests/vircgroupdata/cgroups1.self.cgroup | 11 +
tests/vircgroupdata/cgroups2.cgroups | 10 +
tests/vircgroupdata/cgroups2.self.cgroup | 10 +
tests/vircgroupdata/cgroups3.cgroups | 12 +
tests/vircgroupdata/cgroups3.self.cgroup | 12 +
tests/vircgroupdata/fedora-18.cgroups | 10 +
tests/vircgroupdata/fedora-18.self.cgroup | 9 +
tests/vircgroupdata/fedora-21.cgroups | 12 +
tests/vircgroupdata/fedora-21.self.cgroup | 10 +
tests/vircgroupdata/kubevirt.cgroups | 10 +
tests/vircgroupdata/kubevirt.self.cgroup | 10 +
tests/vircgroupdata/logind.cgroups | 10 +
tests/vircgroupdata/logind.mounts | 2 +
tests/vircgroupdata/logind.self.cgroup | 1 +
tests/vircgroupdata/ovirt-node-6.6.cgroups | 9 +
.../vircgroupdata/ovirt-node-6.6.self.cgroup | 8 +
tests/vircgroupdata/ovirt-node-7.1.cgroups | 11 +
.../vircgroupdata/ovirt-node-7.1.self.cgroup | 10 +
tests/vircgroupdata/rhel-7.1.cgroups | 11 +
tests/vircgroupdata/rhel-7.1.self.cgroup | 10 +
tests/vircgroupdata/systemd.cgroups | 8 +
tests/vircgroupdata/systemd.mounts | 11 +
tests/vircgroupdata/systemd.self.cgroup | 6 +
tests/vircgroupmock.c | 206 ++----------------
tests/vircgrouptest.c | 24 +-
38 files changed, 362 insertions(+), 276 deletions(-)
create mode 100644 tests/vircgroupdata/all-in-one.cgroups
create mode 100644 tests/vircgroupdata/all-in-one.self.cgroup
create mode 100644 tests/vircgroupdata/cgroups1.cgroups
create mode 100644 tests/vircgroupdata/cgroups1.self.cgroup
create mode 100644 tests/vircgroupdata/cgroups2.cgroups
create mode 100644 tests/vircgroupdata/cgroups2.self.cgroup
create mode 100644 tests/vircgroupdata/cgroups3.cgroups
create mode 100644 tests/vircgroupdata/cgroups3.self.cgroup
create mode 100644 tests/vircgroupdata/fedora-18.cgroups
create mode 100644 tests/vircgroupdata/fedora-18.self.cgroup
create mode 100644 tests/vircgroupdata/fedora-21.cgroups
create mode 100644 tests/vircgroupdata/fedora-21.self.cgroup
create mode 100644 tests/vircgroupdata/kubevirt.cgroups
create mode 100644 tests/vircgroupdata/kubevirt.self.cgroup
create mode 100644 tests/vircgroupdata/logind.cgroups
create mode 100644 tests/vircgroupdata/logind.mounts
create mode 100644 tests/vircgroupdata/logind.self.cgroup
create mode 100644 tests/vircgroupdata/ovirt-node-6.6.cgroups
create mode 100644 tests/vircgroupdata/ovirt-node-6.6.self.cgroup
create mode 100644 tests/vircgroupdata/ovirt-node-7.1.cgroups
create mode 100644 tests/vircgroupdata/ovirt-node-7.1.self.cgroup
create mode 100644 tests/vircgroupdata/rhel-7.1.cgroups
create mode 100644 tests/vircgroupdata/rhel-7.1.self.cgroup
create mode 100644 tests/vircgroupdata/systemd.cgroups
create mode 100644 tests/vircgroupdata/systemd.mounts
create mode 100644 tests/vircgroupdata/systemd.self.cgroup
--
2.17.1
6 years, 1 month