[libvirt] [PATCH] build: fix cygwin build in virnetdev
by Eric Blake
On cygwin, compilation failed because SIOCSIFHWADDR is undefined.
* src/util/virnetdev.c (virNetDevSetMAC): Cygwin can query but not
set mac address.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/util/virnetdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 0a3e17d..8013f23 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -132,7 +132,8 @@ int virNetDevExists(const char *ifname)
#endif
-#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFHWADDR) && defined(SIOCSIFHWADDR) && \
+ defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSetMAC:
* @ifname: interface name to set MTU for
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] libvirt-guests: status: return non-zero when stopped
by Ján Tomko
Return 3 when the service is stopped, whether there
are saved guests or not.
---
tools/libvirt-guests.sh.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 4f2e203..261c488 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -524,10 +524,11 @@ rh_status() {
else
if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
gettext "started"; echo
+ RETVAL=0
else
gettext "stopped, with no saved guests"; echo
+ RETVAL=3
fi
- RETVAL=0
fi
}
--
1.8.1.5
11 years, 6 months
[libvirt] Location of 64 bit libvirt dlls (Windows)?
by george john
Thank you for your email. I had tried compiling myself
following the instructions at http://libvirt.org/windows.html (Matthias Bolte's
msys_setup) but it failed on 2 different machines with an
error.
I get the below error when I try to run compile_libxml2.sh
as per instructions https://github.com/photron/msys_setup/blob/master/readme_libvirt.txt
Last few lines before the error is :
>>>>>>>>>>>>>>>>>
make[5]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python'
make[4]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python'
Making install in tests
make[4]: Entering directory
`/src/libxml2/libxml2-2.9.0-0/python/tests'
make[5]: Entering directory
`/src/libxml2/libxml2-2.9.0-0/python/tests'
make[5]: Nothing to be done for `install-exec-am'.
test -z "/share/doc/libxml2-python-2.9.0/examples" ||
/bin/mkdir -p "/share/doc/
libxml2-python-2.9.0/examples"
/bin/install -c -m 644 build.py attribs.py tst.py
tstxpath.py xpathext.py push.
py pushSAX.py pushSAXhtml.py error.py serialize.py
validate.py tstURI.py cutnpas
te.py xpathret.py xpath.py outbuf.py inbuf.py resolver.py
regexp.py reader.py re
ader2.py reader3.py reader4.py reader5.py reader6.py
reader7.py reader8.py reade
rnext.py walker.py nsdel.py ctxterror.py readererr.py
relaxng.py schema.py threa
d2.py sync.py tstLastError.py indexes.py dtdvalid.py
tstmem.py '/share/doc/libxm
l2-python-2.9.0/examples'
/bin/install -c -m 644 validDTD.py validSchemas.py
validRNG.py compareNodes.py
xpathns.py xpathleak.py tst.xml valid.xml invalid.xml
test.dtd '/share/doc/libxm
l2-python-2.9.0/examples'
make[5]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python/tests'
make[4]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python/tests'
make[3]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python'
make[2]: Leaving directory
`/src/libxml2/libxml2-2.9.0-0/python'
make[1]: Leaving directory `/src/libxml2/libxml2-2.9.0-0'
+ cp /python/Lib/site-packages/libxml2mod.dll
/python/DLLs/libxml2mod.pyd
cp: cannot stat `/python/Lib/site-packages/libxml2mod.dll':
No such file or directory
>>>>>>>>>>>>>>>>>>
Do you know how this error could be resolved? Or are there a
different set of instructions I could follow to create the a
64 bit libvirt dll (I am not a C/C++ guy and so have to ask
for the instructions). I had posted another question to this
forum earlier today(04/30/2013) with the subject "Java
client error on Windows 7 64 bit for Libvirt on KVM" on this
error.
Thank you once again for your help.
- George
>
> --- On Tue, 4/30/13, Eric Blake <eblake(a)redhat.com>
> wrote:
>
> > From: Eric Blake <eblake(a)redhat.com>
> > Subject: Re: [libvirt] Location of 64 bit libvirt dlls
> (Windows)?
> > To: "george john" <simplyjoe13(a)yahoo.com>
> > Cc: libvir-list(a)redhat.com
> > Date: Tuesday, April 30, 2013, 8:14 AM
> > On 04/30/2013 08:49 AM, george john
> > wrote:
> > > I have written a Java client (64 bit JVM) that
> uses
> > libvirt APIs on a remote KVM for KVM management. Since
> the
> > JVM is 64 bit, the client needs 64 bit libvirt dlls and
> I
> > could not find them (I found 32 bit libvirt dlls on http://libvirt.org/windows.html).
> > >
> > > Could someone point to where I could find 64 bit
> > libvirt dlls?
> >
> > I don't know if anyone is providing pre-compiled
> versions of
> > 64-bit
> > dlls; you may have to compile it yourself using a
> mingw64
> > (cross-)compiler.
> >
> > --
> > Eric Blake eblake redhat com
> > +1-919-301-3266
> > Libvirt virtualization library http://libvirt.org
> >
> >
>
11 years, 6 months
[libvirt] [PATCH 0/2] fix cgroup setup for vfio hostdevs
by Laine Stump
The first patch is required for vfio hostdev to work. The 2nd is just
a refactor to eliminate duplicated code for usb hostdev cgroup setup.
Laine Stump (2):
qemu: add vfio devices to cgroup ACL when appropriate
qemu: put usb cgroup setup in common function
src/qemu/qemu.conf | 2 +-
src/qemu/qemu_cgroup.c | 182 ++++++++++++++++++++++++++++++++-----
src/qemu/qemu_cgroup.h | 9 +-
src/qemu/qemu_hotplug.c | 26 ++----
src/qemu/test_libvirtd_qemu.aug.in | 1 +
5 files changed, 174 insertions(+), 46 deletions(-)
--
1.7.11.7
11 years, 6 months
[libvirt] [PATCH] libxl: Fix double-dispose of libxl domain config
by Jim Fehlig
libxlBuildDomainConfig() was disposing the libxl_domain_config object
on error, only to have it disposed again by libxlBuildDomainConfig()'s
caller, which resulted in a segfault. Leave disposing of the config
object to it's owner.
---
src/libxl/libxl_conf.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 7e0753a..3de642b 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -796,19 +796,19 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
return -1;
if (libxlMakeDomBuildInfo(def, d_config) < 0) {
- goto error;
+ return -1;
}
if (libxlMakeDiskList(def, d_config) < 0) {
- goto error;
+ return -1;
}
if (libxlMakeNicList(def, d_config) < 0) {
- goto error;
+ return -1;
}
if (libxlMakeVfbList(driver, def, d_config) < 0) {
- goto error;
+ return -1;
}
d_config->on_reboot = def->onReboot;
@@ -816,8 +816,4 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
d_config->on_crash = def->onCrash;
return 0;
-
-error:
- libxl_domain_config_dispose(d_config);
- return -1;
}
--
1.8.0.1
11 years, 6 months
[libvirt] [PATCH v2 00/37] Change OOM reporting
by Michal Privoznik
Previously, the first version dropped virReportOOMError from
almost everywhere. This series don't set such high goal yet. It
just prepares ground for doing so. The worst case scenario is the
OOM error is reported twice. Once in VIR_ALLOC, VIR_STRDUP,
virAsprintf (or similar), then in virReportOOMError itself.
However, once this is pushed, it's easy to get rid of the latter
one.
Patches available at:
git://gitorious.org/~zippy2/libvirt/michal-staging.git
branch oom3
Remember, this will not be pushed until we are after the freeze.
But the freeze creates a nice steady HEAD which is needed in such
a giant change like this one.
Michal Privoznik (37):
virutil: Move string related functions to virstring.c
virstring: Introduce VIR_STRUP and VIR_STRNDUP
Adapt to VIR_STRDUP in daemon/*
Adapt to VIR_STRDUP in src/conf/*
Adapt to VIR_STRDUP in src/cpu/*
Adapt to VIR_STRDUP in src/esx/*
Adapt to VIR_STRDUP in src/hyperv/*
Adapt to VIR_STRDUP in src/libxl/*
Adapt to VIR_STRDUP in src/locking/*
Adapt to VIR_STRDUP in src/lxc/*
Adapt to VIR_STRDUP in src/network/*
Adapt to VIR_STRDUP in src/node_device/*
Adapt to VIR_STRDUP in src/interface/
Adapt to VIR_STRDUP in src/nwfilter/*
Adapt to VIR_STRDUP in src/openvz/*
Adapt to VIR_STRDUP in src/parallels/*
Adapt to VIR_STRDUP in src/phyp/*
Adapt to VIR_STRDUP in src/qemu/*
Adapt to VIR_STRDUP in src/remote/*
Adapt to VIR_STRDUP in src/rpc/*
Adapt to VIR_STRDUP in src/secret/*
Adapt to VIR_STRDUP in src/security/*
Adapt to VIR_STRDUP in src/storage/*
Adapt to VIR_STRDUP in src/test/*
Adapt to VIR_STRDUP in src/uml/*
Adapt to VIR_STRDUP in src/util/*
Adapt to VIR_STRDUP in src/vbox/*
Adapt to VIR_STRDUP in src/vmware/*
Adapt to VIR_STRDUP in src/vmx/*
Adapt to VIR_STRDUP in src/xen/*
Adapt to VIR_STRDUP in src/xenapi/*
Adapt to VIR_STRDUP in src/xenxs/*
Adapt to VIR_STRDUP in tests/*
Adapt to VIR_STRDUP in src/*
Introduce syntax-check rule to prefer VIR_STRDUP over strdup
virstring: Introduce virAsprintfQuiet and virVasprintfQuiet
viralloc.c: Do report OOM error in VIR_ALLOC and friends
HACKING | 19 ++
cfg.mk | 12 +-
daemon/libvirtd-config.c | 39 +--
daemon/libvirtd.c | 19 +-
daemon/remote.c | 97 +++----
docs/hacking.html.in | 26 ++
include/libvirt/libvirt.h.in | 10 +-
po/POTFILES.in | 1 +
python/libvirt-override.c | 103 +++----
src/conf/capabilities.c | 27 +-
src/conf/cpu_conf.c | 14 +-
src/conf/device_conf.c | 2 +-
src/conf/domain_audit.c | 1 +
src/conf/domain_conf.c | 66 ++---
src/conf/domain_conf.h | 1 -
src/conf/domain_event.c | 31 +-
src/conf/interface_conf.c | 1 -
src/conf/netdev_bandwidth_conf.c | 2 +-
src/conf/netdev_vport_profile_conf.c | 1 +
src/conf/network_conf.c | 2 +-
src/conf/node_device_conf.c | 29 +-
src/conf/nwfilter_conf.c | 20 +-
src/conf/nwfilter_conf.h | 1 -
src/conf/nwfilter_params.c | 23 +-
src/conf/secret_conf.c | 1 -
src/conf/snapshot_conf.c | 8 +-
src/conf/storage_conf.c | 11 +-
src/conf/storage_conf.h | 1 -
src/conf/storage_encryption_conf.c | 1 -
src/conf/virchrdev.c | 7 +-
src/cpu/cpu_generic.c | 6 +-
src/cpu/cpu_map.c | 3 +-
src/cpu/cpu_powerpc.c | 11 +-
src/cpu/cpu_x86.c | 9 +-
src/datatypes.c | 26 +-
src/driver.c | 2 +-
src/esx/esx_device_monitor.c | 1 -
src/esx/esx_driver.c | 35 +--
src/esx/esx_interface_driver.c | 6 +-
src/esx/esx_network_driver.c | 21 +-
src/esx/esx_nwfilter_driver.c | 1 -
src/esx/esx_secret_driver.c | 1 -
src/esx/esx_storage_backend_iscsi.c | 15 +-
src/esx/esx_storage_backend_vmfs.c | 10 +-
src/esx/esx_util.c | 39 +--
src/esx/esx_vi.c | 54 +---
src/esx/esx_vi_types.c | 24 +-
src/fdstream.c | 1 +
src/hyperv/hyperv_device_monitor.c | 1 -
src/hyperv/hyperv_driver.c | 37 +--
src/hyperv/hyperv_interface_driver.c | 1 -
src/hyperv/hyperv_network_driver.c | 1 -
src/hyperv/hyperv_nwfilter_driver.c | 1 -
src/hyperv/hyperv_secret_driver.c | 1 -
src/hyperv/hyperv_storage_driver.c | 1 -
src/hyperv/hyperv_util.c | 16 +-
src/hyperv/hyperv_wmi.c | 2 +-
src/interface/interface_backend_udev.c | 25 +-
src/libvirt.c | 10 +-
src/libvirt_private.syms | 36 +--
src/libxl/libxl_conf.c | 59 ++--
src/libxl/libxl_driver.c | 14 +-
src/locking/lock_daemon.c | 13 +-
src/locking/lock_daemon_config.c | 10 +-
src/locking/lock_daemon_dispatch.c | 4 +-
src/locking/lock_driver_lockd.c | 24 +-
src/locking/lock_driver_sanlock.c | 9 +-
src/locking/lock_manager.c | 4 +-
src/lxc/lxc_cgroup.c | 3 +-
src/lxc/lxc_conf.c | 18 +-
src/lxc/lxc_container.c | 10 +-
src/lxc/lxc_controller.c | 8 +-
src/lxc/lxc_driver.c | 9 +-
src/lxc/lxc_fuse.c | 1 +
src/lxc/lxc_fuse.h | 1 -
src/lxc/lxc_monitor.c | 1 +
src/lxc/lxc_process.c | 5 +-
src/network/bridge_driver.c | 30 +-
src/node_device/node_device_driver.c | 29 +-
src/node_device/node_device_hal.c | 13 +-
src/node_device/node_device_linux_sysfs.c | 1 +
src/node_device/node_device_udev.c | 104 +++----
src/nodeinfo.c | 6 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 16 +-
src/nwfilter/nwfilter_driver.c | 5 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 12 +-
src/nwfilter/nwfilter_gentech_driver.c | 4 +-
src/nwfilter/nwfilter_learnipaddr.c | 4 +-
src/openvz/openvz_conf.c | 33 ++-
src/openvz/openvz_driver.c | 32 +--
src/parallels/parallels_driver.c | 36 +--
src/parallels/parallels_network.c | 14 +-
src/parallels/parallels_storage.c | 40 ++-
src/parallels/parallels_utils.c | 2 +-
src/phyp/phyp_driver.c | 37 +--
src/qemu/qemu_agent.c | 1 +
src/qemu/qemu_bridge_filter.c | 1 -
src/qemu/qemu_capabilities.c | 38 +--
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 282 ++++++++-----------
src/qemu/qemu_conf.c | 33 +--
src/qemu/qemu_domain.c | 17 +-
src/qemu/qemu_driver.c | 93 +++---
src/qemu/qemu_hotplug.c | 9 +-
src/qemu/qemu_migration.c | 17 +-
src/qemu/qemu_monitor.c | 1 +
src/qemu/qemu_monitor_json.c | 40 ++-
src/qemu/qemu_monitor_text.c | 10 +-
src/qemu/qemu_process.c | 58 ++--
src/remote/remote_driver.c | 83 +++---
src/rpc/gendispatch.pl | 13 +-
src/rpc/virkeepalive.c | 1 -
src/rpc/virnetclient.c | 8 +-
src/rpc/virnetmessage.c | 11 +-
src/rpc/virnetsaslcontext.c | 3 +-
src/rpc/virnetserver.c | 4 +-
src/rpc/virnetserverclient.c | 8 +-
src/rpc/virnetservermdns.c | 4 +-
src/rpc/virnetsocket.c | 8 +-
src/rpc/virnetsshsession.c | 23 +-
src/rpc/virnettlscontext.c | 14 +-
src/secret/secret_driver.c | 5 +-
src/security/security_apparmor.c | 13 +-
src/security/security_dac.c | 8 +-
src/security/security_nop.c | 4 +-
src/security/security_selinux.c | 51 ++--
src/security/virt-aa-helper.c | 6 +-
src/storage/parthelper.c | 7 +-
src/storage/storage_backend.c | 18 +-
src/storage/storage_backend_disk.c | 16 +-
src/storage/storage_backend_fs.c | 18 +-
src/storage/storage_backend_iscsi.c | 16 +-
src/storage/storage_backend_logical.c | 25 +-
src/storage/storage_backend_mpath.c | 4 +-
src/storage/storage_backend_rbd.c | 4 +-
src/storage/storage_backend_scsi.c | 17 +-
src/storage/storage_backend_sheepdog.c | 1 -
src/storage/storage_driver.c | 13 +-
src/test/test_driver.c | 84 +++---
src/uml/uml_conf.c | 7 +-
src/uml/uml_driver.c | 8 +-
src/util/iohelper.c | 1 +
src/util/viralloc.c | 95 ++++++-
src/util/viralloc.h | 54 +++-
src/util/viraudit.c | 6 +-
src/util/virauth.c | 9 +-
src/util/virauthconfig.c | 7 +-
src/util/virbitmap.c | 10 +-
src/util/virbuffer.c | 8 +-
src/util/vircgroup.c | 31 +-
src/util/vircommand.c | 34 ++-
src/util/vircommand.h | 1 -
src/util/virconf.c | 21 +-
src/util/virdnsmasq.c | 5 +-
src/util/virebtables.c | 36 +--
src/util/virerror.c | 25 +-
src/util/virfile.c | 1 +
src/util/virhash.c | 5 +-
src/util/virhook.h | 1 -
src/util/viridentity.c | 9 +-
src/util/virinitctl.c | 3 +-
src/util/viriptables.c | 6 +-
src/util/virjson.c | 18 +-
src/util/virkeyfile.c | 7 +-
src/util/virlockspace.c | 14 +-
src/util/virlog.c | 21 +-
src/util/virnetdev.c | 2 +
src/util/virnetdevbandwidth.c | 1 +
src/util/virnetdevbridge.c | 1 +
src/util/virnetdevmacvlan.c | 10 +-
src/util/virnetdevopenvswitch.c | 1 +
src/util/virnetdevopenvswitch.h | 1 -
src/util/virnetdevtap.c | 7 +-
src/util/virnetdevveth.c | 2 +
src/util/virnetdevvportprofile.c | 4 +-
src/util/virobject.c | 5 +-
src/util/virpci.c | 7 +-
src/util/virpidfile.c | 1 +
src/util/virprocess.c | 1 +
src/util/virrandom.c | 1 +
src/util/virsexpr.c | 27 +-
src/util/virsocketaddr.c | 6 +-
src/util/virstatslinux.c | 1 -
src/util/virstoragefile.c | 13 +-
src/util/virstring.c | 451 +++++++++++++++++++++++++++++-
src/util/virstring.h | 74 +++++
src/util/virsysinfo.c | 170 +++++------
src/util/virthreadpthread.c | 2 +-
src/util/virtime.c | 1 -
src/util/virtpm.c | 2 +-
src/util/virtypedparam.c | 9 +-
src/util/viruri.c | 20 +-
src/util/virusb.c | 1 +
src/util/virutil.c | 393 ++------------------------
src/util/virutil.h | 49 ----
src/util/virxml.c | 7 +-
src/vbox/vbox_MSCOMGlue.c | 1 -
src/vbox/vbox_XPCOMCGlue.c | 5 +-
src/vbox/vbox_driver.c | 1 -
src/vbox/vbox_tmpl.c | 191 +++++++------
src/vmware/vmware_conf.c | 15 +-
src/vmware/vmware_driver.c | 13 +-
src/vmx/vmx.c | 26 +-
src/xen/block_stats.c | 2 +-
src/xen/xen_driver.c | 4 +-
src/xen/xen_hypervisor.c | 17 +-
src/xen/xen_inotify.c | 11 +-
src/xen/xend_internal.c | 55 ++--
src/xen/xm_internal.c | 8 +-
src/xen/xs_internal.c | 22 +-
src/xenapi/xenapi_driver.c | 34 ++-
src/xenapi/xenapi_utils.c | 22 +-
src/xenxs/xen_sxpr.c | 108 +++----
src/xenxs/xen_xm.c | 44 +--
tests/commandhelper.c | 14 +-
tests/commandtest.c | 4 +-
tests/cputest.c | 1 +
tests/domainsnapshotxml2xmltest.c | 1 +
tests/esxutilstest.c | 1 -
tests/interfacexml2xmltest.c | 2 +-
tests/libvirtdconftest.c | 1 +
tests/lxcxml2xmltest.c | 1 +
tests/networkxml2conftest.c | 3 +
tests/networkxml2xmltest.c | 1 +
tests/nodedevxml2xmltest.c | 1 +
tests/nodeinfotest.c | 2 +-
tests/nwfilterxml2xmltest.c | 1 +
tests/openvzutilstest.c | 8 +-
tests/qemuargv2xmltest.c | 2 +-
tests/qemuhelptest.c | 1 +
tests/qemumonitortest.c | 1 -
tests/qemumonitortestutils.c | 10 +-
tests/qemuxml2argvtest.c | 28 +-
tests/qemuxml2xmltest.c | 1 +
tests/qemuxmlnstest.c | 6 +-
tests/securityselinuxhelper.c | 7 +-
tests/securityselinuxlabeltest.c | 5 +-
tests/securityselinuxtest.c | 9 +-
tests/sexpr2xmltest.c | 1 +
tests/storagebackendsheepdogtest.c | 6 +-
tests/storagepoolxml2xmltest.c | 1 +
tests/storagevolxml2argvtest.c | 1 +
tests/storagevolxml2xmltest.c | 1 +
tests/sysinfotest.c | 2 +-
tests/test_conf.c | 2 +-
tests/testutils.c | 5 +-
tests/testutilsqemu.c | 5 +-
tests/virauthconfigtest.c | 1 -
tests/virbuftest.c | 2 +-
tests/vircgrouptest.c | 4 +-
tests/virdrivermoduletest.c | 1 -
tests/virhashtest.c | 3 +-
tests/viridentitytest.c | 1 -
tests/virkeyfiletest.c | 1 -
tests/virnetmessagetest.c | 22 +-
tests/virnetsockettest.c | 1 +
tests/virportallocatortest.c | 2 +-
tests/virshtest.c | 2 +-
tests/virstoragetest.c | 1 +
tests/virstringtest.c | 1 -
tests/virtimetest.c | 1 -
tests/viruritest.c | 1 -
tests/vmx2xmltest.c | 11 +-
tests/xencapstest.c | 1 +
tests/xmconfigtest.c | 3 +
tests/xml2sexprtest.c | 1 +
tests/xml2vmxtest.c | 11 +-
tools/console.c | 1 -
tools/virsh-domain-monitor.c | 1 +
tools/virsh-domain.c | 1 -
tools/virsh-host.c | 2 +-
tools/virsh-interface.c | 1 +
tools/virsh-network.c | 1 -
tools/virsh-nodedev.c | 1 -
tools/virsh-pool.c | 2 +-
tools/virsh-snapshot.c | 1 -
tools/virsh-volume.c | 1 +
tools/virsh.c | 8 +-
tools/virt-host-validate-common.c | 1 +
279 files changed, 2544 insertions(+), 2653 deletions(-)
--
1.8.1.5
11 years, 6 months
[libvirt] [PATCH] security driver: eliminate memory leaks in failure paths
by Laine Stump
If virPCIDeviceGetVFIOGroupDev() failed,
virSecurity*(Set|Restore)HostdevLabel() would fail to free a
virPCIDevice that had been allocated.
These leaks were all introduced (by me) very recently, in commit
f0bd70a.
---
src/security/security_apparmor.c | 4 +++-
src/security/security_dac.c | 10 ++++++----
src/security/security_selinux.c | 10 ++++++----
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 4fa0384..5be5ff0 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -835,8 +835,10 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
- if (!vfioGroupDev)
+ if (!vfioGroupDev) {
+ virPCIDeviceFree(pci);
goto done;
+ }
ret = AppArmorSetSecurityPCILabel(pci, vfioGroupDev, ptr);
VIR_FREE(vfioGroupDev);
} else {
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 0366c17..e197eff 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -520,8 +520,10 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
- if (!vfioGroupDev)
+ if (!vfioGroupDev) {
+ virPCIDeviceFree(pci);
goto done;
+ }
ret = virSecurityDACSetSecurityPCILabel(pci, vfioGroupDev, params);
VIR_FREE(vfioGroupDev);
} else {
@@ -530,7 +532,6 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
}
virPCIDeviceFree(pci);
-
break;
}
@@ -611,15 +612,16 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr,
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
- if (!vfioGroupDev)
+ if (!vfioGroupDev) {
+ virPCIDeviceFree(pci);
goto done;
+ }
ret = virSecurityDACRestoreSecurityPCILabel(pci, vfioGroupDev, mgr);
VIR_FREE(vfioGroupDev);
} else {
ret = virPCIDeviceFileIterate(pci, virSecurityDACRestoreSecurityPCILabel, mgr);
}
virPCIDeviceFree(pci);
-
break;
}
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 87a09c7..0cf4009 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1346,15 +1346,16 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def,
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
- if (!vfioGroupDev)
+ if (!vfioGroupDev) {
+ virPCIDeviceFree(pci);
goto done;
+ }
ret = virSecuritySELinuxSetSecurityPCILabel(pci, vfioGroupDev, def);
VIR_FREE(vfioGroupDev);
} else {
ret = virPCIDeviceFileIterate(pci, virSecuritySELinuxSetSecurityPCILabel, def);
}
virPCIDeviceFree(pci);
-
break;
}
@@ -1518,15 +1519,16 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virSecurityManagerPtr mgr,
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
- if (!vfioGroupDev)
+ if (!vfioGroupDev) {
+ virPCIDeviceFree(pci);
goto done;
+ }
ret = virSecuritySELinuxRestoreSecurityPCILabel(pci, vfioGroupDev, mgr);
VIR_FREE(vfioGroupDev);
} else {
ret = virPCIDeviceFileIterate(pci, virSecuritySELinuxRestoreSecurityPCILabel, mgr);
}
virPCIDeviceFree(pci);
-
break;
}
--
1.7.11.7
11 years, 6 months
[libvirt] [PATCH] esx: Support virtualHW version 9
by Martin Kletzander
We already support ESX 5.1, but virtualHW version used by such
hypervisor [1] wasn't taken into account.
[1] http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&exter...
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/vmx/vmx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index f520a85..87bec5b 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1,8 +1,7 @@
-
/*
* vmx.c: VMware VMX parsing/formatting functions
*
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
* Copyright (C) 2009-2010 Matthias Bolte <matthias.bolte(a)googlemail.com>
*
* This library is free software; you can redistribute it and/or
@@ -45,6 +44,7 @@ domain-xml <=> vmx
virtualHW.version = "4" # essential for ESX 3.5
virtualHW.version = "7" # essential for ESX 4.0
virtualHW.version = "8" # essential for ESX 5.0
+ virtualHW.version = "9" # essential for ESX 5.1
??? <=> guestOS = "<value>" # essential, FIXME: not representable
@@ -1320,10 +1320,10 @@ virVMXParseConfig(virVMXContext *ctx,
}
if (virtualHW_version != 4 && virtualHW_version != 7 &&
- virtualHW_version != 8) {
+ virtualHW_version != 8 && virtualHW_version != 9) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'virtualHW.version' to be 4, 7 or 8 "
- "but found %lld"),
+ _("Expecting VMX entry 'virtualHW.version' to be "
+ "4, 7, 8 or 9 but found %lld"),
virtualHW_version);
goto cleanup;
}
--
1.8.2.1
11 years, 6 months
[libvirt] libxl: expose and control xen device model versions
by David Scott
Hi,
These patches expose multiple xen device model options in the
capabilities XML and allow the user to select a specific device
model via the domain XML's <emulator> tag.
It is important to control the device model per VM, since the
default is changing from xen-4.2 "qemu traditional" to xen-4.3
"qemu upstream".
In this proposal, the capabilities XML now has multiple <domain>
elements per <arch> as follows:
<arch name='i686'>
<wordsize>32</wordsize>
<machine>xenfv</machine>
<domain type='xen'>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</domain>
<domain type='xen'>
<emulator>/usr/lib64/xen/bin/qemu-system-i386</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</domain>
</arch>
-- is it valid/ sensible to have multiple <domain>'s with the same
'type'? Let me know if you can think of a better mapping.
Comments, criticism welcome.
Cheers,
Dave
11 years, 6 months