[libvirt] [PATCH v2 0/3] Add keepalive support in virsh
by Martin Kletzander
This series adds client keepalive support into virsh. This was
previously almost done by Guannan around 2 years ago, but not
finished.
Martin Kletzander (3):
virsh: Add keepalive in new vshConnect function
virsh: Prohibit virConnectOpen* functions in virsh
[DO_NOT_APPLY_UPSTREAM] virsh: add connection monitoring into
vshWatchJob
cfg.mk | 8 ++++-
tests/virsh-optparse | 4 +--
tools/virsh-domain.c | 21 +++++++++----
tools/virsh.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++-----
tools/virsh.h | 7 +++++
tools/virsh.pod | 12 ++++++++
6 files changed, 118 insertions(+), 17 deletions(-)
--
1.9.0
10 years, 8 months
[libvirt] [PATCH v2] Fix memory leak in virDomainSnapshotDiskDefClear()
by Nehal J Wani
While running domainsnapshotxml2xmltest, it was found that valgrind pointed out
the following memory leak:
==32176== 42 (32 direct, 10 indirect) bytes in 1 blocks are definitely lost in loss record 42 of 66
==32176== at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==32176== by 0x4A06B62: realloc (vg_replace_malloc.c:662)
==32176== by 0x4C65A07: virReallocN (viralloc.c:243)
==32176== by 0x4C65B2E: virExpandN (viralloc.c:292)
==32176== by 0x4C65E30: virInsertElementsN (viralloc.c:434)
==32176== by 0x4CD71F3: virDomainDiskSourceDefParse (domain_conf.c:5078)
==32176== by 0x4CF6EF4: virDomainSnapshotDefParseNode (snapshot_conf.c:151)
==32176== by 0x4CF7314: virDomainSnapshotDefParseString (snapshot_conf.c:410)
==32176== by 0x41FB8D: testCompareXMLToXMLHelper (domainsnapshotxml2xmltest.c:100)
==32176== by 0x420FD1: virtTestRun (testutils.c:199)
==32176== by 0x41F859: mymain (domainsnapshotxml2xmltest.c:222)
==32176== by 0x42174D: virtTestMain (testutils.c:782)
==32176==
... and one more.
---
v2: Updated based on Ján Tomko's and Peter Krempa's comments.
v1: https://www.redhat.com/archives/libvir-list/2014-February/msg01409.html
src/conf/snapshot_conf.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index d70d176..546e5b3 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -82,6 +82,9 @@ virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDefPtr disk)
{
VIR_FREE(disk->name);
VIR_FREE(disk->file);
+ while (disk->nhosts)
+ virDomainDiskHostDefClear(&disk->hosts[--disk->nhosts]);
+ VIR_FREE(disk->hosts);
}
void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def)
--
1.7.1
10 years, 8 months
[libvirt] [PATCH 0/7] POC: Saner firewall integration
by Daniel P. Berrange
We currently have three areas of code which deal with firewall
changes. The bridge driver's iptables usage, the QEMU driver's
ebtables usage for mac filters and the nwfilter code.
These all directly invoke the iptables/ebtables commands or
in the case of nwfilter invoke horrible generated shell scripts.
The latter in particular has always been an unpleasant design
choice, but it has been made much worse by support for firewalld.
We are now invoking firewall-cmd just in order to make a DBus
method call to firewalld which then invokes the real *tables
commands. This has a notable performance impact.
This proof of concept series introduces a new virFirewallPtr
object for encapsulating all firewall changes. It provides
a transactional API for making firewall changes, so the caller
can define a set of rules which must either all succeed or all
fail, along with a set of rules to perform rollback upon fail.
It will either execute *tables commands directly or will call
the DBus method for firewalld directly.
The upshot is that it will become possible to unit test all
the firewall code much more easily, instead of having to rely
on integration testing that we currently have for nwfilter.
We will also have much improved performance by avoiding the
firewall-cmd tool and easier to understand code too.
In this series I've only done the core infrastructure and the
conversion of viriptables + virebtables source files. The work
on nwfilter is a bigger job that I'm still working on.
Daniel P. Berrange (7):
Introduce a new set of helper macros for mocking symbols
Create a re-usable DBus LD_PRELOAD mock library
Switch systemd test to use generic dbus mock
Add ability to register callback for virCommand dry run
Introduce an object for managing firewall rulesets
Convert bridge driver over to use new firewall APIs
Convert ebtables code over to use firewall APIs
include/libvirt/virterror.h | 1 +
po/POTFILES.in | 1 +
src/Makefile.am | 2 +
src/libvirt_private.syms | 13 +
src/network/bridge_driver_linux.c | 669 ++++++++++++++++----------------------
src/util/vircommand.c | 47 ++-
src/util/vircommand.h | 12 +-
src/util/virebtables.c | 187 +++--------
src/util/virerror.c | 1 +
src/util/virfirewall.c | 653 +++++++++++++++++++++++++++++++++++++
src/util/virfirewall.h | 93 ++++++
src/util/virfirewallpriv.h | 45 +++
src/util/viriptables.c | 634 ++++++++++++++++--------------------
src/util/viriptables.h | 114 ++++---
tests/Makefile.am | 30 +-
tests/testutils.c | 18 +-
tests/virfirewalltest.c | 619 +++++++++++++++++++++++++++++++++++
tests/virkmodtest.c | 8 +-
tests/virmock.h | 298 +++++++++++++++++
tests/virmockdbus.c | 64 ++++
tests/virnetdevbandwidthtest.c | 3 +-
tests/virsystemdmock.c | 139 --------
tests/virsystemdtest.c | 89 ++++-
23 files changed, 2626 insertions(+), 1114 deletions(-)
create mode 100644 src/util/virfirewall.c
create mode 100644 src/util/virfirewall.h
create mode 100644 src/util/virfirewallpriv.h
create mode 100644 tests/virfirewalltest.c
create mode 100644 tests/virmock.h
create mode 100644 tests/virmockdbus.c
delete mode 100644 tests/virsystemdmock.c
--
1.8.5.3
10 years, 8 months
[libvirt] [PATCH] bhyve: allow to destroy only active domains
by Roman Bogorodskiy
Add a check that domain is active before attempting to destroy it.
---
src/bhyve/bhyve_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 9dbb299..60d49de 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -567,6 +567,12 @@ bhyveDomainDestroy(virDomainPtr dom)
if (virDomainDestroyEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
+ goto cleanup;
+ }
+
ret = virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
cleanup:
--
1.8.4.2
10 years, 8 months
[libvirt] [PATCH 0/7 v2] Remove overhead of disabled logging calls
by Daniel P. Berrange
A v2 of
https://www.redhat.com/archives/libvir-list/2014-March/msg00124.html
Looking at the performance of the libvirtd event loop when used
with libvirt sandbox and apps which do lots of I/O I discovered
that a huge amount of time was being spent in our logging APIs
making the event loop quite poor at dealing with frequently
firing poll events for small data sizes.
To track this down I created the following short demo program
which simulates a libvirtd event loop thread, watching 500
FDs (eg 500 QEMU or LXC console or monitor FDs). In the test no
logging outputs are enabled, so ideally the log overhead would
be near zero. Running the demo for 51200 iterations initially
took 1 minute 40 seconds. oprofile traces show that in this test
run the logging APIs were totally dominant in CPU time, over the
work done in the event loop. Note the demo program's FD handler
doesn't actually do any work, so this is showing the worst case
behaviour, but it is none-the-less a good illustration of the
loggin overhead.
After refactoring the logging code, the overhead of logging calls
when no outputs are enabled is reduced to a single function call
which does 2 integer comparisons without any mutex locks. The
demo program now completes in 3.3 seconds. IOW, 97% of the original
CPU time for the demo was consumed by the logging APIs !
The main feature we loose in this series is the global logging
buffer. This ring buffer currently collects all log mesages
regardless of log filter settings, and dumps them to stderr upon
crash of libvirtd. As the amount of logging code in libvirt has
grown, the signal/noise ratio of data in the global log buffer
has gone down significantly. Whenever libvirtd crashes, my first
reaction to ask the reporter to reproduce with a specifically
tailored set of log filters set. Thus, IMHO, the global log buffer
is no longer a compelling enough feature to justify its significant
performance overhead.
Rather than remove it entirely though, I've changed it in two
parts. The first patch removes the overhead of it, but leaves a
more tailored verson of it still present. This removes the
contribution it makes to performance overheads. The last patch,
which is not performance relevant, simply deletes the rest of
the global log buffer entirely.
I'm mostly ambivalent on whether to apply patch 7 or not. IMHO the
global log buffer is mostly useless once patch 1 is applied, but if
people think it is worth keeping it, patch 7 can be dropped and I
won't mind.
The demo program used is
$ cat demo.c
#include <libvirt/libvirt.h>
#include <unistd.h>
#include <stdio.h>
static void ignore(int handle, int fd, int events, void *opaque)
{
// nada
}
#define STEPS (1024 * 5)
#define ITERATIONS (STEPS * 10)
#define NFILES 500
int main(int argc, char **argv)
{
int fds[NFILES][2];
int i;
virEventRegisterDefaultImpl();
for (i = 0 ; i < NFILES ; i++) {
char c = '0';
if (pipe(fds[i]) < 0) {
perror("pipe");
return -1;
}
if (write(fds[i][1], &c, 1) < 0)
return -1;
virEventAddHandle(fds[i][0], VIR_EVENT_HANDLE_READABLE,
ignore, NULL, NULL);
}
for (i = 0 ; i < ITERATIONS ; i++) {
if (!(i % STEPS))
fprintf(stderr, ".");
virEventRunDefaultImpl();
}
return 0;
}
Simply compile & run it with no args
$ gcc -Wall `pkg-config --cflags --libs libvirt` -o demo demo.c
$ time ./demo
..........
real 1m39.981s
user 1m34.894s
sys 0m4.851s
Now make it use the newly compiled libvirt version
$ export LD_LIBRARY_PATH=`pwd`/src/.libs
$ time ./demo
..........
real 0m3.316s
user 0m2.896s
sys 0m0.412s
97% execution time removed !
Daniel P. Berrange (7):
Reduce performance overhead of the global log buffer
Refactor code that skips logging of error messages
Move dtrace probe macros into separate header file
Turn virLogSource into a struct instead of an enum
Add virLogSource variables to all source files
Switch to filtering based on log source name instead of filename
Remove global log buffer feature entirely
cfg.mk | 3 +
daemon/libvirtd-config.c | 5 +-
daemon/libvirtd-config.h | 1 -
daemon/libvirtd.c | 5 +-
daemon/libvirtd.conf | 10 +-
daemon/libvirtd.h | 1 -
daemon/remote.c | 3 +
daemon/stream.c | 2 +
docs/apibuild.py | 30 +++
docs/logging.html.in | 10 -
src/access/viraccessdriverpolkit.c | 3 +
src/access/viraccessmanager.c | 3 +
src/bhyve/bhyve_command.c | 2 +
src/bhyve/bhyve_driver.c | 2 +
src/bhyve/bhyve_process.c | 2 +
src/conf/domain_audit.c | 2 +
src/conf/domain_conf.c | 2 +
src/conf/domain_event.c | 1 +
src/conf/network_event.c | 2 +
src/conf/nwfilter_params.c | 2 +
src/conf/object_event.c | 2 +
src/conf/secret_conf.c | 2 +
src/conf/snapshot_conf.c | 2 +
src/conf/storage_conf.c | 1 -
src/conf/virchrdev.c | 2 +
src/cpu/cpu.c | 2 +
src/cpu/cpu_powerpc.c | 2 +
src/cpu/cpu_x86.c | 2 +
src/datatypes.c | 2 +
src/driver.c | 2 +
src/esx/esx_device_monitor.c | 1 -
src/esx/esx_driver.c | 2 +
src/esx/esx_interface_driver.c | 2 -
src/esx/esx_network_driver.c | 2 -
src/esx/esx_nwfilter_driver.c | 2 -
src/esx/esx_secret_driver.c | 2 -
src/esx/esx_storage_backend_iscsi.c | 2 -
src/esx/esx_storage_backend_vmfs.c | 2 +
src/esx/esx_util.c | 2 +-
src/esx/esx_vi.c | 2 +-
src/esx/esx_vi_methods.c | 1 -
src/esx/esx_vi_types.c | 2 +-
src/fdstream.c | 2 +
src/hyperv/hyperv_device_monitor.c | 2 -
src/hyperv/hyperv_driver.c | 3 +-
src/hyperv/hyperv_interface_driver.c | 2 -
src/hyperv/hyperv_network_driver.c | 2 -
src/hyperv/hyperv_nwfilter_driver.c | 2 -
src/hyperv/hyperv_secret_driver.c | 2 -
src/hyperv/hyperv_storage_driver.c | 2 -
src/hyperv/hyperv_util.c | 2 +-
src/hyperv/hyperv_wmi.c | 2 -
src/interface/interface_backend_netcf.c | 2 +
src/internal.h | 72 ------
src/libvirt-lxc.c | 2 +
src/libvirt-qemu.c | 2 +
src/libvirt.c | 2 +
src/libvirt_private.syms | 2 -
src/libxl/libxl_conf.c | 2 +
src/libxl/libxl_domain.c | 1 +
src/libxl/libxl_driver.c | 2 +
src/locking/domain_lock.c | 2 +
src/locking/lock_daemon.c | 4 +-
src/locking/lock_daemon_config.c | 4 +-
src/locking/lock_daemon_config.h | 1 -
src/locking/lock_daemon_dispatch.c | 5 +-
src/locking/lock_driver_lockd.c | 2 +
src/locking/lock_driver_nop.c | 2 +
src/locking/lock_driver_sanlock.c | 2 +
src/locking/lock_manager.c | 2 +
src/locking/virtlockd.conf | 10 +-
src/lxc/lxc_cgroup.c | 2 +
src/lxc/lxc_conf.c | 2 +
src/lxc/lxc_container.c | 2 +
src/lxc/lxc_controller.c | 2 +
src/lxc/lxc_domain.c | 2 +
src/lxc/lxc_driver.c | 1 +
src/lxc/lxc_fuse.c | 1 -
src/lxc/lxc_hostdev.c | 2 +
src/lxc/lxc_monitor.c | 2 +
src/lxc/lxc_native.c | 1 +
src/lxc/lxc_process.c | 2 +
src/network/bridge_driver.c | 2 +
src/network/bridge_driver_linux.c | 3 +
src/network/bridge_driver_platform.h | 1 -
src/node_device/node_device_driver.c | 2 -
src/node_device/node_device_hal.c | 2 +
src/node_device/node_device_linux_sysfs.c | 2 +
src/node_device/node_device_udev.c | 4 +-
src/nodeinfo.c | 1 -
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +
src/nwfilter/nwfilter_driver.c | 2 +
src/nwfilter/nwfilter_ebiptables_driver.c | 2 +
src/nwfilter/nwfilter_gentech_driver.c | 1 +
src/nwfilter/nwfilter_learnipaddr.c | 2 +
src/openvz/openvz_driver.c | 2 +
src/parallels/parallels_driver.c | 2 +
src/phyp/phyp_driver.c | 3 +
src/qemu/qemu_agent.c | 2 +
src/qemu/qemu_bridge_filter.c | 1 -
src/qemu/qemu_capabilities.c | 4 +-
src/qemu/qemu_cgroup.c | 2 +
src/qemu/qemu_command.c | 2 +
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_domain.c | 2 +
src/qemu/qemu_driver.c | 2 +
src/qemu/qemu_hostdev.c | 2 +
src/qemu/qemu_hotplug.c | 3 +
src/qemu/qemu_migration.c | 2 +
src/qemu/qemu_monitor.c | 3 +
src/qemu/qemu_monitor_json.c | 3 +
src/qemu/qemu_monitor_text.c | 3 +
src/qemu/qemu_process.c | 2 +
src/remote/remote_driver.c | 2 +
src/rpc/virkeepalive.c | 3 +
src/rpc/virnetclient.c | 3 +
src/rpc/virnetclientprogram.c | 2 +
src/rpc/virnetclientstream.c | 2 +
src/rpc/virnetmessage.c | 2 +
src/rpc/virnetsaslcontext.c | 2 +
src/rpc/virnetserver.c | 47 +---
src/rpc/virnetserverclient.c | 3 +
src/rpc/virnetservermdns.c | 2 +
src/rpc/virnetserverprogram.c | 2 +
src/rpc/virnetsocket.c | 2 +
src/rpc/virnetsshsession.c | 2 +
src/rpc/virnettlscontext.c | 3 +
src/secret/secret_driver.c | 2 +
src/security/security_apparmor.c | 3 +
src/security/security_dac.c | 3 +
src/security/security_driver.c | 2 +
src/security/security_manager.c | 1 +
src/security/security_selinux.c | 2 +
src/storage/storage_backend.c | 2 +
src/storage/storage_backend_disk.c | 2 +
src/storage/storage_backend_fs.c | 2 +
src/storage/storage_backend_gluster.c | 2 +
src/storage/storage_backend_iscsi.c | 2 +
src/storage/storage_backend_logical.c | 2 +
src/storage/storage_backend_mpath.c | 2 +
src/storage/storage_backend_rbd.c | 2 +
src/storage/storage_backend_scsi.c | 2 +
src/storage/storage_backend_sheepdog.c | 1 -
src/storage/storage_driver.c | 2 +
src/test/test_driver.c | 2 +
src/uml/uml_conf.c | 1 +
src/uml/uml_driver.c | 2 +
src/util/viralloc.c | 2 +
src/util/virarch.c | 2 +
src/util/viraudit.c | 9 +-
src/util/viraudit.h | 10 +-
src/util/virauth.c | 2 +
src/util/virauthconfig.c | 1 +
src/util/vircgroup.c | 2 +
src/util/virclosecallbacks.c | 2 +
src/util/vircommand.c | 2 +
src/util/virconf.c | 2 +
src/util/virdbus.c | 2 +
src/util/virdnsmasq.c | 3 +
src/util/virebtables.c | 2 +
src/util/virerror.c | 19 +-
src/util/virevent.c | 2 +
src/util/vireventpoll.c | 3 +
src/util/virfile.c | 2 +
src/util/virhash.c | 2 +
src/util/virhook.c | 2 +
src/util/viridentity.c | 1 +
src/util/viriptables.c | 2 +
src/util/virjson.c | 1 +
src/util/virkeyfile.c | 2 +
src/util/virlockspace.c | 2 +
src/util/virlog.c | 381 +++++-------------------------
src/util/virlog.h | 49 ++--
src/util/virnetdev.c | 2 +
src/util/virnetdevmacvlan.c | 1 +
src/util/virnetdevtap.c | 2 +
src/util/virnetdevveth.c | 2 +
src/util/virnetdevvportprofile.c | 2 +
src/util/virnetlink.c | 2 +
src/util/virnodesuspend.c | 2 +
src/util/virnuma.c | 2 +
src/util/virobject.c | 3 +
src/util/virpci.c | 2 +
src/util/virpidfile.c | 2 +
src/util/virprobe.h | 100 ++++++++
src/util/virprocess.c | 2 +
src/util/virrandom.c | 2 +
src/util/virscsi.c | 1 -
src/util/virstoragefile.c | 2 +
src/util/virstring.c | 2 +
src/util/virsysinfo.c | 1 -
src/util/virsystemd.c | 1 +
src/util/virusb.c | 2 +
src/util/virutil.c | 2 +
src/util/viruuid.c | 2 +
src/vbox/vbox_MSCOMGlue.c | 2 +
src/vbox/vbox_XPCOMCGlue.c | 1 +
src/vbox/vbox_driver.c | 1 +
src/vbox/vbox_tmpl.c | 3 +
src/vmx/vmx.c | 2 +
src/xen/xen_driver.c | 3 +
src/xen/xen_hypervisor.c | 2 +
src/xen/xen_inotify.c | 2 +
src/xen/xend_internal.c | 2 +
src/xen/xm_internal.c | 2 +
src/xen/xs_internal.c | 2 +
src/xenapi/xenapi_utils.c | 2 +
src/xenxs/xen_sxpr.c | 2 +
tests/domainconftest.c | 2 +
tests/eventtest.c | 2 +
tests/fdstreamtest.c | 2 +
tests/libvirtdconftest.c | 2 +
tests/qemumonitortestutils.c | 2 +
tests/securityselinuxlabeltest.c | 2 +
tests/securityselinuxtest.c | 2 +
tests/sockettest.c | 2 +
tests/testutils.c | 4 +-
tests/virauthconfigtest.c | 2 +
tests/vircgrouptest.c | 2 +
tests/virdbustest.c | 2 +
tests/virdrivermoduletest.c | 2 +
tests/virhashtest.c | 2 +
tests/viridentitytest.c | 1 +
tests/virkeycodetest.c | 1 +
tests/virkeyfiletest.c | 1 +
tests/virlockspacetest.c | 2 +
tests/virnetmessagetest.c | 2 +
tests/virnetsockettest.c | 2 +
tests/virnettlscontexttest.c | 2 +
tests/virnettlshelpers.c | 2 +
tests/virnettlssessiontest.c | 2 +
tests/virportallocatortest.c | 1 +
tests/virstoragetest.c | 2 +
tests/virstringtest.c | 2 +
tests/virsystemdtest.c | 2 +
tests/virtimetest.c | 2 +
tests/viruritest.c | 2 +
tools/virsh-console.c | 2 +
238 files changed, 655 insertions(+), 554 deletions(-)
create mode 100644 src/util/virprobe.h
--
1.8.5.3
10 years, 8 months
[libvirt] [PATCH] bhyve: add console support through nmdm device
by Roman Bogorodskiy
Some additional info on nmdm devices that probably doesn't fit commit message.
Man page:
http://www.freebsd.org/cgi/man.cgi?query=nmdm&sektion=4
To use this device, we pass device name like '/dev/nmdmNA' to bhyve. Device
is created automatically when bhyve accesses it. The pair device name is
always '/dev/nmdmNB' which is used to provide console support.
Even though this patch doesn't directly depend on virFDStreamOpenPTY()
addition patch:
https://www.redhat.com/archives/libvir-list/2014-March/msg00582.html
it's not much useful without it because of mangled console output.
Roman Bogorodskiy (1):
bhyve: add console support through nmdm device
src/bhyve/bhyve_command.c | 34 ++++++++++++++++++++++
src/bhyve/bhyve_driver.c | 69 ++++++++++++++++++++++++++++++++++++++++++++
src/conf/domain_audit.c | 1 +
src/conf/domain_conf.c | 12 +++++++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_monitor_json.c | 1 +
6 files changed, 117 insertions(+), 1 deletion(-)
--
1.8.4.2
10 years, 8 months
[libvirt] [PATCH 1/2] bhyve: add support for virtio block devices
by Roman Bogorodskiy
---
src/bhyve/bhyve_command.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index b9df6d0..2ec97fc 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -216,6 +216,7 @@ static int
bhyveBuildDiskArgStr(const virDomainDef *def, virCommandPtr cmd)
{
virDomainDiskDefPtr disk;
+ const char *bus_type;
if (def->ndisks != 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -225,7 +226,14 @@ bhyveBuildDiskArgStr(const virDomainDef *def, virCommandPtr cmd)
disk = def->disks[0];
- if (disk->bus != VIR_DOMAIN_DISK_BUS_SATA) {
+ switch (disk->bus) {
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ bus_type = "ahci-hd";
+ break;
+ case VIR_DOMAIN_DISK_BUS_VIRTIO:
+ bus_type = "virtio-blk";
+ break;
+ default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported disk bus type"));
return -1;
@@ -244,7 +252,7 @@ bhyveBuildDiskArgStr(const virDomainDef *def, virCommandPtr cmd)
}
virCommandAddArg(cmd, "-s");
- virCommandAddArgFormat(cmd, "2:0,ahci-hd,%s", disk->src);
+ virCommandAddArgFormat(cmd, "2:0,%s,%s", bus_type, disk->src);
return 0;
}
--
1.8.4.2
10 years, 8 months
[libvirt] [PATCH] Enforce attribute check of the virRegister functions
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/driver.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/driver.h b/src/driver.h
index fbfaac4..d106d59 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -2132,15 +2132,15 @@ struct _virNWFilterDriver {
* TODO: also need ways to (des)activate a given driver
* lookup based on the URI given in a virConnectOpen(ReadOnly)
*/
-int virRegisterDriver(virDriverPtr);
-int virRegisterNetworkDriver(virNetworkDriverPtr);
-int virRegisterInterfaceDriver(virInterfaceDriverPtr);
-int virRegisterStorageDriver(virStorageDriverPtr);
-int virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr);
-int virRegisterSecretDriver(virSecretDriverPtr);
-int virRegisterNWFilterDriver(virNWFilterDriverPtr);
+int virRegisterDriver(virDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterInterfaceDriver(virInterfaceDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterStorageDriver(virStorageDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterSecretDriver(virSecretDriverPtr) ATTRIBUTE_RETURN_CHECK;
+int virRegisterNWFilterDriver(virNWFilterDriverPtr) ATTRIBUTE_RETURN_CHECK;
# ifdef WITH_LIBVIRTD
-int virRegisterStateDriver(virStateDriverPtr);
+int virRegisterStateDriver(virStateDriverPtr) ATTRIBUTE_RETURN_CHECK;
# endif
void virDriverModuleInitialize(const char *defmoddir);
void *virDriverLoadModule(const char *name);
--
1.8.3.1
10 years, 8 months
[libvirt] [PATCH v3 0/2] Introduce max_anonymous_clients
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=981729
So far we can limit how many clients are connected,
how many are waiting in accept() line but we could
not control the count of accepted but not
authenticated yet.
diff to v2:
-Dan's suggestions worked in
Michal Privoznik (2):
virNetServer: Introduce unauth clients counter
daemon: Introduce max_anonymous_clients
daemon/libvirtd-config.c | 4 +-
daemon/libvirtd-config.h | 1 +
daemon/libvirtd.aug | 1 +
daemon/libvirtd.c | 1 +
daemon/libvirtd.conf | 6 ++-
daemon/remote.c | 21 +++++----
daemon/test_libvirtd.aug.in | 3 +-
src/locking/lock_daemon.c | 2 +-
src/lxc/lxc_controller.c | 2 +-
src/rpc/virnetserver.c | 108 ++++++++++++++++++++++++++++++++++++++++----
src/rpc/virnetserver.h | 4 ++
11 files changed, 130 insertions(+), 23 deletions(-)
--
1.9.0
10 years, 8 months
[libvirt] [PATCH] bhyve: implement nodeGetInfo()
by Roman Bogorodskiy
Add bhyveNodeGetInfo() which is a simple wrapper around nodeGetInfo()
from src/nodeinfo.c.
---
src/bhyve/bhyve_driver.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 9dbb299..cb790de 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -601,6 +601,16 @@ bhyveNodeGetMemoryStats(virConnectPtr conn,
}
static int
+bhyveNodeGetInfo(virConnectPtr conn,
+ virNodeInfoPtr nodeinfo)
+{
+ if (virNodeGetInfoEnsureACL(conn) < 0)
+ return -1;
+
+ return nodeGetInfo(nodeinfo);
+}
+
+static int
bhyveStateCleanup(void)
{
VIR_DEBUG("bhyve state cleanup");
@@ -703,6 +713,7 @@ static virDriver bhyveDriver = {
.domainIsPersistent = bhyveDomainIsPersistent, /* 1.2.2 */
.nodeGetCPUStats = bhyveNodeGetCPUStats, /* 1.2.2 */
.nodeGetMemoryStats = bhyveNodeGetMemoryStats, /* 1.2.2 */
+ .nodeGetInfo = bhyveNodeGetInfo, /* 1.2.3 */
};
--
1.8.4.2
10 years, 8 months