[libvirt] [PATCH] virSecurityDACSetSecurityImageLabel: Unmark @def as unused
by Michal Privoznik
The @def is clearly used just a few lines below. There's no need to use
ATTRIBUTE_UNUSED for it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/security/security_dac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 09b5e57..85e6eec 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -342,25 +342,25 @@ virSecurityDACSetSecurityFileLabel(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
static int
virSecurityDACSetSecurityImageLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr def ATTRIBUTE_UNUSED,
+ virDomainDefPtr def,
virDomainDiskDefPtr disk)
{
void *params[2];
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
if (!priv->dynamicOwnership)
return 0;
if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0;
params[0] = mgr;
params[1] = def;
return virDomainDiskDefForeachPath(disk,
false,
virSecurityDACSetSecurityFileLabel,
params);
}
--
1.9.0
10 years, 8 months
[libvirt] [PATCH 0/7] Remove overhead of disabled logging calls
by Daniel P. Berrange
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
daemon/libvirtd-config.c | 5 +-
daemon/libvirtd-config.h | 1 -
daemon/libvirtd.aug | 1 -
daemon/libvirtd.c | 5 +-
daemon/libvirtd.conf | 7 -
daemon/libvirtd.h | 1 -
daemon/remote.c | 3 +
daemon/stream.c | 2 +
daemon/test_libvirtd.aug.in | 1 -
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 | 74 ------
src/libvirt-lxc.c | 2 +
src/libvirt-qemu.c | 2 +
src/libvirt.c | 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/test_virtlockd.aug.in | 2 -
src/locking/virtlockd.aug | 1 -
src/locking/virtlockd.conf | 7 -
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 | 16 +-
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 | 379 ++++--------------------------
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 +
240 files changed, 637 insertions(+), 563 deletions(-)
create mode 100644 src/util/virprobe.h
--
1.8.5.3
10 years, 8 months
[libvirt] limit downtime during life migration from xl/virsh
by Olaf Hering
During live migration of VMs from one host to another the VM is
suspended for an unpredictable amount of time. The actual downtime
depends on how many new pages will be dirty and the band width to the
destination host. Since VM memory size grows faster than transfer rates
the currently available tuneables will cause troubles for workloads
within the VM which can not handle large timejumps.
I have already written code to tweak the inner loop doing the actual
migration work in libxc. But the patchset exposes the details of the
loop to the cmdline, as such it is not portable nor is it a friendly UI
for the hostadmin.
Here is my proposal for a new option for virsh and 2 new options for xl:
[xl | virsh --live] --max-suspend-time N --timeout N VM host
--max-suspend-time N: as the name suggests, the VM downtime must not be
longer than specified. The code doing the migration has to estimate the
transfer speed. If the VM is about to be suspended, it has to check if
the remaining dirty pages can be transfered within the required
timeframe. If not, the migration is aborted, the VM continues to run on
the src host, the new VM on the dst host is destroyed and an error is
returned.
--timeout N: if a VM is busy and its workload causes many new dirty
pages the migrate command would take forever. This option is supposed to
stop the migration attempt if the number of new dirty pages is too high.
It would change the semantics of "virsh migrate --timeout n", which
currently forces a suspend (according to the help text).
I'm not sure if its acceptable to add this option just for the libxl
(and maybe xend) target in libvirt, until someone steps up to do also
the kvm part. For Xen it would be added for xl only, obviously.
Olaf
10 years, 8 months
[libvirt] QEMU participating in Outreach Program for Women
by Stefan Hajnoczi
I am delighted to announce that we are participating in Outreach
Program for Women! The same QEMU, KVM, and libvirt project ideas are
shared with Google Summer of Code.
Outreach Program for Women was started by GNOME specifically for women
who want to start contributing to open source. It has since grown to
include other organizations and we are able to take part this summer!
If you would like to apply or know someone who might be interested in
a 12-week, paid, open source gig from May 19 to August 18, take a look
at our wiki:
http://qemu-project.org/Outreach_Program_for_Women_Summer_2014
The application period starts today (March 10th) and the deadline is March 19th.
Join the #qemu-gsoc IRC channel on irc.oftc.net to chat with mentors
or ask questions.
Also see the official OPW page for an overview of how it works:
https://wiki.gnome.org/OutreachProgramForWomen/
Stefan
10 years, 8 months
[libvirt] [PATCH 0/8] Misc ebtables cleanup patches
by Daniel P. Berrange
In doing some work on the firewall code in libvirt I came across
lots of cruft which could usefully be cleaned up..
Daniel P. Berrange (8):
Remove many decls from bridge driver platform header
Remove decl of method which doesn't exist in virebtables.h
Make ebtablesForwardPolicyReject static
Remove unused variables from ebtablesContext
Remove data structure holding list of ebtables rules
Remove worthless ebtRules data structure
Remove unused ebtablesRemoveForwardPolicyReject method
Remove broken error reporting in QEMU mac filtering
src/Makefile.am | 4 +-
src/network/bridge_driver_linux.c | 42 ++++---
src/network/bridge_driver_nop.c | 42 -------
src/network/bridge_driver_platform.h | 22 ----
src/qemu/qemu_bridge_filter.c | 104 ----------------
src/qemu/qemu_bridge_filter.h | 37 ------
src/qemu/qemu_command.c | 11 +-
src/qemu/qemu_conf.c | 1 -
src/qemu/qemu_driver.c | 7 +-
src/qemu/qemu_hotplug.c | 11 +-
src/qemu/qemu_process.c | 10 +-
src/util/virebtables.c | 233 +++--------------------------------
src/util/virebtables.h | 24 ----
13 files changed, 60 insertions(+), 488 deletions(-)
delete mode 100644 src/qemu/qemu_bridge_filter.c
delete mode 100644 src/qemu/qemu_bridge_filter.h
--
1.8.5.3
10 years, 8 months
[libvirt] [PATCH] libvirt-tck: Update hook syntax for libvirt 0.9.0+
by Mike Latimer
Starting with libvirt 0.9.0+, hook scripts can be called from several new
locations. These locations must also be reflected in the expected logs of
the hook tests.
The final test in 052-domain-hook.t intentionally produces a failed start,
which should show the first stage in the startup hook process, followed by
all the stages in the destroy process.
In addition to the above changes, libvirtd init scripts can return daemon
status in several different ways (due to distribution differences,
sysvinit vs. systemd, etc). This patch allows for 'running|active', and
'stopped|unused|inactive' responses which the hook tests rely on.
---
lib/Sys/Virt/TCK/Hooks.pm | 17 ++++++++++++-----
scripts/hooks/051-daemon-hook.t | 2 +-
scripts/hooks/052-domain-hook.t | 6 +++---
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/lib/Sys/Virt/TCK/Hooks.pm b/lib/Sys/Virt/TCK/Hooks.pm
index 75f98e9..2ae2c2a 100644
--- a/lib/Sys/Virt/TCK/Hooks.pm
+++ b/lib/Sys/Virt/TCK/Hooks.pm
@@ -73,10 +73,10 @@ sub libvirtd_status {
my $status = `service libvirtd status`;
my $_ = $status;
- if (/running/) {
- $self->{libvirtd_status} = 'running';
- } elsif (/stopped/) {
+ if (/stopped|unused|inactive/) {
$self->{libvirtd_status} = 'stopped';
+ } elsif (/running|active/) {
+ $self->{libvirtd_status} = 'running';
}
return $self;
@@ -146,13 +146,20 @@ sub expect_log {
} elsif ($self->{type} eq 'qemu' or $self->{type} eq 'lxc') {
if ($domain_state eq &Sys::Virt::Domain::STATE_RUNNING) {
if ($action eq 'destroy') {
- $expect_log = "$hook $domain_name stopped end -";
+ $expect_log = "$hook $domain_name stopped end -\n".
+ "$hook $domain_name release end -";
} else {
die "hooks testing doesn't support $action running domain";
}
} elsif ($domain_state eq &Sys::Virt::Domain::STATE_SHUTOFF) {
if ($action eq 'start') {
- $expect_log = "$hook $domain_name start begin -";
+ $expect_log = "$hook $domain_name prepare begin -\n".
+ "$hook $domain_name start begin -\n".
+ "$hook $domain_name started begin -";
+ } elsif ($action eq 'failstart') {
+ $expect_log = "$hook $domain_name prepare begin -\n".
+ "$hook $domain_name stopped end -\n".
+ "$hook $domain_name release end -";
} else {
die "hooks testing doesn't support $action shutoff domain";
}
diff --git a/scripts/hooks/051-daemon-hook.t b/scripts/hooks/051-daemon-hook.t
index d9cfb3a..165cf4e 100644
--- a/scripts/hooks/051-daemon-hook.t
+++ b/scripts/hooks/051-daemon-hook.t
@@ -85,7 +85,7 @@ SKIP: {
ok($hook->compare_log(), "$hook->{name} is invoked correctly while $hook->{action} libvirtd");
diag "check if libvirtd is stopped";
- ok(`service libvirtd status` =~ /stopped/, "libvirtd is stopped");
+ ok(`service libvirtd status` =~ /stopped|unused|inactive/, "libvirtd is stopped");
# start libvirtd
$hook->action('start');
diff --git a/scripts/hooks/052-domain-hook.t b/scripts/hooks/052-domain-hook.t
index e3b55ec..90b8a48 100644
--- a/scripts/hooks/052-domain-hook.t
+++ b/scripts/hooks/052-domain-hook.t
@@ -90,7 +90,7 @@ SKIP: {
ok(-f "$hook->{name}", "$hook->{name} is invoked");
my $actual_log_data = slurp($hook->{log_name});
- diag "acutal log: $hook->{log_name} '$actual_log_data'";
+ diag "actual log: $hook->{log_name} '$actual_log_data'";
diag "expect log:\n $hook->{expect_log}";
@@ -147,7 +147,7 @@ SKIP: {
$hook->domain_name($domain_name);
$hook->domain_state($domain_state);
- $hook->action('start');
+ $hook->action('failstart');
$hook->expect_log();
diag "start $domain_name";
@@ -170,7 +170,7 @@ SKIP: {
diag "expect log:\n $hook->{expect_log}";
diag "check if the actual log is same with expected log";
- ok($hook->compare_log, "$hook->{name} is invoked correctly while start $domain_name");
+ ok($hook->compare_log, "$hook->{name} is invoked correctly while failing to start $domain_name");
# undefine domain
diag "undefine $domain_name";
--
1.8.4.5
10 years, 8 months
[libvirt] [PATCH v2] qemu: Advertise <drivediscard/> in capabilities if 'discard' is supported.
by Richard W.M. Jones
The capabilities will have a <drivediscard/> feature if you are
allowed to use the qemu attribute:
<driver name='qemu' ... discard='unmap|ignore' />
The new capabilities XML looks like this:
<capabilities>
...
<guest>
<os_type>hvm</os_type>
...
<features>
<drivediscard/>
</features>
</guest>
</capabilities>
---
src/conf/capabilities.c | 3 ++-
src/qemu/qemu_capabilities.c | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index c1c4ab8..ff5912a 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -947,7 +947,8 @@ virCapabilitiesFormatXML(virCapsPtr caps)
STREQ(caps->guests[i]->features[j]->name, "nonpae") ||
STREQ(caps->guests[i]->features[j]->name, "ia64_be") ||
STREQ(caps->guests[i]->features[j]->name, "cpuselection") ||
- STREQ(caps->guests[i]->features[j]->name, "deviceboot")) {
+ STREQ(caps->guests[i]->features[j]->name, "deviceboot") ||
+ STREQ(caps->guests[i]->features[j]->name, "drivediscard")) {
virBufferAsprintf(&xml, " <%s/>\n",
caps->guests[i]->features[j]->name);
} else {
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index cae25e0..b755fb2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -778,6 +778,10 @@ virQEMUCapsInitGuest(virCapsPtr caps,
!virCapabilitiesAddGuestFeature(guest, "deviceboot", 1, 0))
goto error;
+ if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_DRIVE_DISCARD) &&
+ !virCapabilitiesAddGuestFeature(guest, "drivediscard", 0, 0))
+ goto error;
+
if (virCapabilitiesAddGuestDomain(guest,
"qemu",
NULL,
--
1.8.5.3
10 years, 8 months
[libvirt] [PATCH] qemu: Advertise <qcow2discard/> in capabilities if discard works for qcow2 backing files.
by Richard W.M. Jones
Qemu since 1.5 supports discard. However until qemu 1.6 it didn't
work for qcow2 files. Ref:
http://wiki.qemu.org/ChangeLog/1.5
http://wiki.qemu.org/ChangeLog/1.6
If qemu >= 1.6, add this to guest capabilities:
<features>
<drivediscard/>
<qcow2discard/> <---
</features>
---
src/conf/capabilities.c | 3 ++-
src/qemu/qemu_capabilities.c | 13 +++++++++++++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index ff5912a..08c9b73 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -948,7 +948,8 @@ virCapabilitiesFormatXML(virCapsPtr caps)
STREQ(caps->guests[i]->features[j]->name, "ia64_be") ||
STREQ(caps->guests[i]->features[j]->name, "cpuselection") ||
STREQ(caps->guests[i]->features[j]->name, "deviceboot") ||
- STREQ(caps->guests[i]->features[j]->name, "drivediscard")) {
+ STREQ(caps->guests[i]->features[j]->name, "drivediscard") ||
+ STREQ(caps->guests[i]->features[j]->name, "qcow2discard")) {
virBufferAsprintf(&xml, " <%s/>\n",
caps->guests[i]->features[j]->name);
} else {
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b755fb2..b527690 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -251,6 +251,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"spiceport",
"usb-kbd", /* 165 */
+ "qcow2-discard",
);
struct _virQEMUCaps {
@@ -782,6 +783,10 @@ virQEMUCapsInitGuest(virCapsPtr caps,
!virCapabilitiesAddGuestFeature(guest, "drivediscard", 0, 0))
goto error;
+ if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_QCOW2_DISCARD) &&
+ !virCapabilitiesAddGuestFeature(guest, "qcow2discard", 0, 0))
+ goto error;
+
if (virCapabilitiesAddGuestDomain(guest,
"qemu",
NULL,
@@ -1113,6 +1118,10 @@ virQEMUCapsComputeCmdFlags(const char *help,
if (strstr(help, "-machine"))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_OPT);
+ /* discard option works for qcow2 backing files since 1.6 */
+ if (qemuCaps->version >= 1006000)
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_QCOW2_DISCARD);
+
/* USB option is supported v1.3.0 onwards */
if (qemuCaps->version >= 1003000)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_USB_OPT);
@@ -2569,6 +2578,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsInitArchQMPBasic(qemuCaps, mon) < 0)
goto cleanup;
+ /* discard option works for qcow2 backing files since 1.6 */
+ if (qemuCaps->version >= 1006000)
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_QCOW2_DISCARD);
+
/* USB option is supported v1.3.0 onwards */
if (qemuCaps->version >= 1003000)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_USB_OPT);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index b5445e7..a0ce506 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -204,6 +204,7 @@ enum virQEMUCapsFlags {
QEMU_CAPS_SPICE_FILE_XFER_DISABLE = 163, /* -spice disable-agent-file-xfer */
QEMU_CAPS_CHARDEV_SPICEPORT = 164, /* -chardev spiceport */
QEMU_CAPS_DEVICE_USB_KBD = 165, /* -device usb-kbd */
+ QEMU_CAPS_QCOW2_DISCARD = 166, /* discard works for qcow2 backing files */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
index 597f873..0ab5e22 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -142,4 +142,5 @@
<flag name='spice-file-xfer-disable'/>
<flag name='spiceport'/>
<flag name='usb-kbd'/>
+ <flag name='qcow2-discard'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
index 0c1dd87..d5cca41 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -140,4 +140,5 @@
<flag name='spice-file-xfer-disable'/>
<flag name='spiceport'/>
<flag name='usb-kbd'/>
+ <flag name='qcow2-discard'/>
</qemuCaps>
--
1.8.5.3
10 years, 8 months
[libvirt] [PATCH] Change file names in comments to match the files they are in
by Ján Tomko
Some of these are leftovers from renaming the files, others
are just typos.
Also introduce an ugly awk script to enforce this.
---
cfg.mk | 25 +++++++++++++++++++++++++
daemon/libvirtd-config.c | 2 +-
daemon/libvirtd-config.h | 2 +-
src/bhyve/bhyve_command.c | 2 +-
src/bhyve/bhyve_command.h | 2 +-
src/conf/domain_audit.h | 2 +-
src/datatypes.c | 2 +-
src/hyperv/hyperv_wmi.c | 2 +-
src/interface/interface_backend_netcf.c | 4 ++--
src/locking/domain_lock.h | 2 +-
src/locking/lock_daemon_config.c | 2 +-
src/lxc/lxc_hostdev.c | 2 +-
src/lxc/lxc_hostdev.h | 2 +-
src/network/bridge_driver.h | 2 +-
src/network/bridge_driver_platform.h | 2 +-
src/node_device/node_device_driver.c | 2 +-
src/node_device/node_device_driver.h | 2 +-
src/nodeinfo.h | 2 +-
src/openvz/openvz_conf.h | 2 +-
src/openvz/openvz_util.c | 2 +-
src/openvz/openvz_util.h | 2 +-
src/parallels/parallels_driver.h | 2 +-
src/parallels/parallels_network.c | 2 +-
src/qemu/qemu_agent.c | 2 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.h | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/remote/remote_driver.h | 2 +-
src/rpc/virnetservermdns.h | 2 +-
src/storage/storage_backend_mpath.h | 2 +-
src/storage/storage_backend_sheepdog.h | 2 +-
src/test/test_driver.c | 2 +-
src/test/test_driver.h | 2 +-
src/uml/uml_conf.h | 2 +-
src/util/viratomic.c | 2 +-
src/util/virbitmap.c | 2 +-
src/util/virebtables.h | 2 +-
src/util/virerror.h | 2 +-
src/util/vireventpoll.h | 2 +-
src/util/viruuid.c | 2 +-
src/util/virxml.h | 2 +-
src/xen/xen_driver.h | 2 +-
src/xen/xen_hypervisor.c | 2 +-
src/xen/xen_hypervisor.h | 2 +-
src/xen/xen_inotify.c | 2 +-
src/xen/xen_inotify.h | 2 +-
src/xen/xm_internal.c | 2 +-
src/xenapi/xenapi_driver.h | 2 +-
tests/testutils.h | 2 +-
tools/virsh-interface.h | 2 +-
tools/virsh-network.h | 2 +-
tools/virt-host-validate.c | 2 +-
52 files changed, 77 insertions(+), 52 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 2a8957a..c5f99aa 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -863,6 +863,31 @@ sc_prohibit_atoi:
halt='Use virStrToLong* instead of atoi, atol, atof, atoq, atoll' \
$(_sc_search_regexp)
+# Don't
+sc_prohibit_wrong_filename_in_comment:
+ @fail=0; \
+ awk 'BEGIN { \
+ fail=0; \
+ } FNR < 3 { \
+ n=match($$0, /[[:space:]][^[:space:]]*[.][ch][[:space:]:]/); \
+ if (n > 0) { \
+ A=substr($$0, RSTART+1, RLENGTH-2); \
+ n=split(FILENAME, arr, "/"); \
+ if (A != arr[n]) { \
+ print "in " FILENAME ": " A " mentioned in comments "; \
+ fail=1; \
+ } \
+ } \
+ } END { \
+ if (fail == 1) { \
+ exit 1; \
+ } \
+ }' $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$') || fail=1; \
+ if test $$fail -eq 1; then \
+ { echo '$(ME): The file name in comments must match the actual ' \
+ 'file name' 1>&2; exit 1; } \
+ fi;
+
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c
index c816fda..856a038 100644
--- a/daemon/libvirtd-config.c
+++ b/daemon/libvirtd-config.c
@@ -1,5 +1,5 @@
/*
- * libvirtd.c: daemon start of day, guest process & i/o management
+ * libvirtd-config.c: daemon start of day, guest process & i/o management
*
* Copyright (C) 2006-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/daemon/libvirtd-config.h b/daemon/libvirtd-config.h
index a24d5d2..0829273 100644
--- a/daemon/libvirtd-config.h
+++ b/daemon/libvirtd-config.h
@@ -1,5 +1,5 @@
/*
- * libvirtd.c: daemon start of day, guest process & i/o management
+ * libvirtd-config.h: daemon start of day, guest process & i/o management
*
* Copyright (C) 2006-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 1fcc0f2..a19daac 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -1,5 +1,5 @@
/*
- * bhyve_process.c: bhyve command generation
+ * bhyve_command.c: bhyve command generation
*
* Copyright (C) 2014 Roman Bogorodskiy
*
diff --git a/src/bhyve/bhyve_command.h b/src/bhyve/bhyve_command.h
index 8326971..66d934d 100644
--- a/src/bhyve/bhyve_command.h
+++ b/src/bhyve/bhyve_command.h
@@ -1,5 +1,5 @@
/*
- * bhyve_process.c: bhyve command generation
+ * bhyve_command.h: bhyve command generation
*
* Copyright (C) 2014 Roman Bogorodskiy
*
diff --git a/src/conf/domain_audit.h b/src/conf/domain_audit.h
index 9486216..70b09e5 100644
--- a/src/conf/domain_audit.h
+++ b/src/conf/domain_audit.h
@@ -1,5 +1,5 @@
/*
- * domain_audit.c: Domain audit management
+ * domain_audit.h: Domain audit management
*
* Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/datatypes.c b/src/datatypes.c
index 33d941d..20752cd 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -1,5 +1,5 @@
/*
- * datatypes.h: management of structs for public data types
+ * datatypes.c: management of structs for public data types
*
* Copyright (C) 2006-2014 Red Hat, Inc.
*
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 39eed0c..a603bad 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -1,6 +1,6 @@
/*
- * hyperv_wmi.h: general WMI over WSMAN related functions and structures for
+ * hyperv_wmi.c: general WMI over WSMAN related functions and structures for
* managing Microsoft Hyper-V hosts
*
* Copyright (C) 2011 Matthias Bolte <matthias.bolte(a)googlemail.com>
diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c
index c525ca9..b4c1fe9 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -1,6 +1,6 @@
/*
- * interface_driver.c: backend driver methods to handle physical
- * interface configuration using the netcf library.
+ * interface_backend_netcf.c: backend driver methods to handle physical
+ * interface configuration using the netcf library.
*
* Copyright (C) 2006-2013 Red Hat, Inc.
*
diff --git a/src/locking/domain_lock.h b/src/locking/domain_lock.h
index eefe6cd..a9b19c8 100644
--- a/src/locking/domain_lock.h
+++ b/src/locking/domain_lock.h
@@ -1,5 +1,5 @@
/*
- * domain_lock.c: Locking for domain lifecycle operations
+ * domain_lock.h: Locking for domain lifecycle operations
*
* Copyright (C) 2010-2011 Red Hat, Inc.
*
diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_config.c
index 8e632f5..68cd9e9 100644
--- a/src/locking/lock_daemon_config.c
+++ b/src/locking/lock_daemon_config.c
@@ -1,5 +1,5 @@
/*
- * lock_daemon_config.h: virtlockd config file handling
+ * lock_daemon_config.c: virtlockd config file handling
*
* Copyright (C) 2006-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c
index b7248df..c3ecc48 100644
--- a/src/lxc/lxc_hostdev.c
+++ b/src/lxc/lxc_hostdev.c
@@ -1,5 +1,5 @@
/*
- * virLXC_hostdev.c: VIRLXC hostdev management
+ * lxc_hostdev.c: VIRLXC hostdev management
*
* Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/lxc/lxc_hostdev.h b/src/lxc/lxc_hostdev.h
index 41bb178..cf89a99 100644
--- a/src/lxc/lxc_hostdev.h
+++ b/src/lxc/lxc_hostdev.h
@@ -1,5 +1,5 @@
/*
- * virLXC_hostdev.h: VIRLXC hostdev management
+ * lxc_hostdev.h: VIRLXC hostdev management
*
* Copyright (C) 2006-2007, 2009-2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index 1c2a4a7..decc08f 100644
--- a/src/network/bridge_driver.h
+++ b/src/network/bridge_driver.h
@@ -1,5 +1,5 @@
/*
- * network_driver.h: core driver methods for managing networks
+ * bridge_driver.h: core driver methods for managing networks
*
* Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h
index 82d96f6..22f3aae 100644
--- a/src/network/bridge_driver_platform.h
+++ b/src/network/bridge_driver_platform.h
@@ -1,5 +1,5 @@
/*
- * bridge_driver.h: platform specific routines for bridge driver
+ * bridge_driver_platform.h: platform specific routines for bridge driver
*
* Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index d5a92cd..55b3eb3 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1,5 +1,5 @@
/*
- * node_device.c: node device enumeration
+ * node_device_driver.c: node device enumeration
*
* Copyright (C) 2010-2013 Red Hat, Inc.
* Copyright (C) 2008 Virtual Iron Software, Inc.
diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h
index 0f62c83..e238ff8 100644
--- a/src/node_device/node_device_driver.h
+++ b/src/node_device/node_device_driver.h
@@ -1,5 +1,5 @@
/*
- * node_device.h: node device enumeration
+ * node_device_driver.h: node device enumeration
*
* Copyright (C) 2008 Virtual Iron Software, Inc.
* Copyright (C) 2008 David F. Lively
diff --git a/src/nodeinfo.h b/src/nodeinfo.h
index 413fddd..c81fcbb 100644
--- a/src/nodeinfo.h
+++ b/src/nodeinfo.h
@@ -1,5 +1,5 @@
/*
- * nodeinfo.c: Helper routines for OS specific node information
+ * nodeinfo.h: Helper routines for OS specific node information
*
* Copyright (C) 2006-2008, 2011-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h
index 47b5123..a7de7d2 100644
--- a/src/openvz/openvz_conf.h
+++ b/src/openvz/openvz_conf.h
@@ -1,5 +1,5 @@
/*
- * openvz_config.h: config information for OpenVZ VPSs
+ * openvz_conf.h: config information for OpenVZ VPSs
*
* Copyright (C) 2010 Red Hat, Inc.
* Copyright (C) 2006, 2007 Binary Karma.
diff --git a/src/openvz/openvz_util.c b/src/openvz/openvz_util.c
index 8920d14..3113751 100644
--- a/src/openvz/openvz_util.c
+++ b/src/openvz/openvz_util.c
@@ -1,5 +1,5 @@
/*
- * openvz_driver.c: core driver methods for managing OpenVZ VEs
+ * openvz_util.c: core driver methods for managing OpenVZ VEs
*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Guido Günther
diff --git a/src/openvz/openvz_util.h b/src/openvz/openvz_util.h
index 680e507..0c8d55a 100644
--- a/src/openvz/openvz_util.h
+++ b/src/openvz/openvz_util.h
@@ -1,5 +1,5 @@
/*
- * openvz_driver.h: common util functions for managing openvz VPEs
+ * openvz_util.h: common util functions for managing openvz VPEs
*
* Copyright (C) 2012 Guido Günther
*
diff --git a/src/parallels/parallels_driver.h b/src/parallels/parallels_driver.h
index a503abe..babe5c0 100644
--- a/src/parallels/parallels_driver.h
+++ b/src/parallels/parallels_driver.h
@@ -1,5 +1,5 @@
/*
- * parallels_driver.c: core driver functions for managing
+ * parallels_driver.h: core driver functions for managing
* Parallels Cloud Server hosts
*
* Copyright (C) 2012 Parallels, Inc.
diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c
index 63daf53..432f0cc 100644
--- a/src/parallels/parallels_network.c
+++ b/src/parallels/parallels_network.c
@@ -1,5 +1,5 @@
/*
- * parallels_storage.c: core privconn functions for managing
+ * parallels_network.c: core privconn functions for managing
* Parallels Cloud Server hosts
*
* Copyright (C) 2013 Red Hat, Inc.
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 4a3820c..553bff9 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -1,5 +1,5 @@
/*
- * qemu_agent.h: interaction with QEMU guest agent
+ * qemu_agent.c: interaction with QEMU guest agent
*
* Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bad63c5..c321eda 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1,5 +1,5 @@
/*
- * qemu_domain.h: QEMU domain private state
+ * qemu_domain.c: QEMU domain private state
*
* Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/qemu/qemu_driver.h b/src/qemu/qemu_driver.h
index 84f74c4..df7533a 100644
--- a/src/qemu/qemu_driver.h
+++ b/src/qemu/qemu_driver.h
@@ -1,5 +1,5 @@
/*
- * driver.h: core driver methods for managing qemu guests
+ * qemu_driver.h: core driver methods for managing qemu guests
*
* Copyright (C) 2006, 2007 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6703c92..dd72a79 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1,5 +1,5 @@
/*
- * qemu_hotplug.h: QEMU device hotplug management
+ * qemu_hotplug.c: QEMU device hotplug management
*
* Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/remote/remote_driver.h b/src/remote/remote_driver.h
index 912f0f8..4033a3c 100644
--- a/src/remote/remote_driver.h
+++ b/src/remote/remote_driver.h
@@ -1,5 +1,5 @@
/*
- * remote_internal.h: driver to provide access to libvirtd running
+ * remote_driver.h: driver to provide access to libvirtd running
* on a remote machine
*
* Copyright (C) 2006-2007, 2010 Red Hat, Inc.
diff --git a/src/rpc/virnetservermdns.h b/src/rpc/virnetservermdns.h
index a1c19c1..e91b264 100644
--- a/src/rpc/virnetservermdns.h
+++ b/src/rpc/virnetservermdns.h
@@ -1,5 +1,5 @@
/*
- * virnetservermdns.c: advertise server sockets
+ * virnetservermdns.h: advertise server sockets
*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2007 Daniel P. Berrange
diff --git a/src/storage/storage_backend_mpath.h b/src/storage/storage_backend_mpath.h
index d7f20f3..b666645 100644
--- a/src/storage/storage_backend_mpath.h
+++ b/src/storage/storage_backend_mpath.h
@@ -1,5 +1,5 @@
/*
- * storage_backend_scsi.h: storage backend for SCSI handling
+ * storage_backend_mpath.h: storage backend for multipath handling
*
* Copyright (C) 2009-2009 Red Hat, Inc.
* Copyright (C) 2009-2008 Dave Allan
diff --git a/src/storage/storage_backend_sheepdog.h b/src/storage/storage_backend_sheepdog.h
index bc114ff..b0d8440 100644
--- a/src/storage/storage_backend_sheepdog.h
+++ b/src/storage/storage_backend_sheepdog.h
@@ -1,5 +1,5 @@
/*
- * storage_backend_sheepog.h: storage backend for Sheepdog handling
+ * storage_backend_sheepdog.h: storage backend for Sheepdog handling
*
* Copyright (C) 2012 Wido den Hollander
* Copyright (C) 2012 Frank Spijkerman
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 6806ffd..27295db 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1,5 +1,5 @@
/*
- * test.c: A "mock" hypervisor for use by application unit tests
+ * test_driver.c: A "mock" hypervisor for use by application unit tests
*
* Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/test/test_driver.h b/src/test/test_driver.h
index b9bf566..df74433 100644
--- a/src/test/test_driver.h
+++ b/src/test/test_driver.h
@@ -1,5 +1,5 @@
/*
- * test.h: A "mock" hypervisor for use by application unit tests
+ * test_driver.h: A "mock" hypervisor for use by application unit tests
*
* Copyright (C) 2006-2006 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/uml/uml_conf.h b/src/uml/uml_conf.h
index a914be0..05e19ff 100644
--- a/src/uml/uml_conf.h
+++ b/src/uml/uml_conf.h
@@ -1,5 +1,5 @@
/*
- * config.h: VM configuration management
+ * uml_conf.h: VM configuration management
*
* Copyright (C) 2006, 2007, 2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/util/viratomic.c b/src/util/viratomic.c
index 160a20b..278a749 100644
--- a/src/util/viratomic.c
+++ b/src/util/viratomic.c
@@ -1,5 +1,5 @@
/*
- * viratomic.h: atomic integer operations
+ * viratomic.c: atomic integer operations
*
* Copyright (C) 2012 Red Hat, Inc.
*
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 870c8fe..775262d 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -1,5 +1,5 @@
/*
- * virbitmap.h: Simple bitmap operations
+ * virbitmap.c: Simple bitmap operations
*
* Copyright (C) 2010-2013 Red Hat, Inc.
* Copyright (C) 2010 Novell, Inc.
diff --git a/src/util/virebtables.h b/src/util/virebtables.h
index c0d443d..2b6f1dd 100644
--- a/src/util/virebtables.h
+++ b/src/util/virebtables.h
@@ -1,5 +1,5 @@
/*
- * virebtables.c: Helper APIs for managing ebtables
+ * virebtables.h: Helper APIs for managing ebtables
*
* Copyright (C) 2007-2008, 2013 Red Hat, Inc.
* Copyright (C) 2009 IBM Corp.
diff --git a/src/util/virerror.h b/src/util/virerror.h
index 5ae4eb5..2de04f4 100644
--- a/src/util/virerror.h
+++ b/src/util/virerror.h
@@ -1,5 +1,5 @@
/*
- * virerror.c: error handling and reporting code for libvirt
+ * virerror.h: error handling and reporting code for libvirt
*
* Copyright (C) 2006-2014 Red Hat, Inc.
*
diff --git a/src/util/vireventpoll.h b/src/util/vireventpoll.h
index c46ab80..8844c9c 100644
--- a/src/util/vireventpoll.h
+++ b/src/util/vireventpoll.h
@@ -1,5 +1,5 @@
/*
- * vireventpool.h: Poll based event loop for monitoring file handles
+ * vireventpoll.h: Poll based event loop for monitoring file handles
*
* Copyright (C) 2007 Daniel P. Berrange
* Copyright (C) 2007 Red Hat, Inc.
diff --git a/src/util/viruuid.c b/src/util/viruuid.c
index c5fa9a8..48f5e2e 100644
--- a/src/util/viruuid.c
+++ b/src/util/viruuid.c
@@ -1,5 +1,5 @@
/*
- * viruuid.h: helper APIs for dealing with UUIDs
+ * viruuid.c: helper APIs for dealing with UUIDs
*
* Copyright (C) 2007-2013 Red Hat, Inc.
*
diff --git a/src/util/virxml.h b/src/util/virxml.h
index d967a2e..781b3bf 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -1,5 +1,5 @@
/*
- * virxml.c: helper APIs for dealing with XML documents
+ * virxml.h: helper APIs for dealing with XML documents
*
* Copyright (C) 2005, 2007-2012 Red Hat, Inc.
*
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index b8c1c27..1ed870d 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -1,5 +1,5 @@
/*
- * xen_unified.c: Unified Xen driver.
+ * xen_driver.h: Unified Xen driver.
*
* Copyright (C) 2007, 2010-2011 Red Hat, Inc.
*
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index f9c7b40..d24db06 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1,5 +1,5 @@
/*
- * xen_internal.c: direct access to Xen hypervisor level
+ * xen_hypervisor.c: direct access to Xen hypervisor level
*
* Copyright (C) 2005-2013 Red Hat, Inc.
*
diff --git a/src/xen/xen_hypervisor.h b/src/xen/xen_hypervisor.h
index 6aeab79..2990e51 100644
--- a/src/xen/xen_hypervisor.h
+++ b/src/xen/xen_hypervisor.h
@@ -1,5 +1,5 @@
/*
- * xen_internal.h: internal API for direct access to Xen hypervisor level
+ * xen_hypervisor.h: internal API for direct access to Xen hypervisor level
*
* Copyright (C) 2005, 2010-2011 Red Hat, Inc.
*
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index 2e9787f..c9718bd 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -1,5 +1,5 @@
/*
- * xen_inofify.c: Xen notification of xml file activity in the
+ * xen_inotify.c: Xen notification of xml file activity in the
* following dirs:
* /etc/xen
* /var/lib/xend/domains
diff --git a/src/xen/xen_inotify.h b/src/xen/xen_inotify.h
index 6055c88..8a9370d 100644
--- a/src/xen/xen_inotify.h
+++ b/src/xen/xen_inotify.h
@@ -1,5 +1,5 @@
/*
- * xen_inofify.h: Xen notification of xml files
+ * xen_inotify.h: Xen notification of xml files
*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2008 VirtualIron
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index d9a3502..5d078e7 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1,5 +1,5 @@
/*
- * xm_internal.h: helper routines for dealing with inactive domains
+ * xm_internal.c: helper routines for dealing with inactive domains
*
* Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
diff --git a/src/xenapi/xenapi_driver.h b/src/xenapi/xenapi_driver.h
index 30a8f1e..0925731 100644
--- a/src/xenapi/xenapi_driver.h
+++ b/src/xenapi/xenapi_driver.h
@@ -1,5 +1,5 @@
/*
- * xenapi_driver.h.c: Xen API driver header file to be included in libvirt.c.
+ * xenapi_driver.h: Xen API driver header file to be included in libvirt.c.
* Copyright (C) 2009, 2010 Citrix Ltd.
*
* This library is free software; you can redistribute it and/or
diff --git a/tests/testutils.h b/tests/testutils.h
index fa37246..e89492b 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -1,5 +1,5 @@
/*
- * utils.c: test utils
+ * testutils.h: test utils
*
* Copyright (C) 2005, 2008-2013 Red Hat, Inc.
*
diff --git a/tools/virsh-interface.h b/tools/virsh-interface.h
index 2544f7e..6272aab 100644
--- a/tools/virsh-interface.h
+++ b/tools/virsh-interface.h
@@ -1,5 +1,5 @@
/*
- * virsh-interface.c: Commands to manage host interface
+ * virsh-interface.h: Commands to manage host interface
*
* Copyright (C) 2005, 2007-2012 Red Hat, Inc.
*
diff --git a/tools/virsh-network.h b/tools/virsh-network.h
index 7178fde..3beeeb9 100644
--- a/tools/virsh-network.h
+++ b/tools/virsh-network.h
@@ -1,5 +1,5 @@
/*
- * virsh-network.c: Commands to manage network
+ * virsh-network.h: Commands to manage network
*
* Copyright (C) 2005, 2007-2012 Red Hat, Inc.
*
diff --git a/tools/virt-host-validate.c b/tools/virt-host-validate.c
index d3cf19c..a8c2075 100644
--- a/tools/virt-host-validate.c
+++ b/tools/virt-host-validate.c
@@ -1,5 +1,5 @@
/*
- * virt-host-check.c: Sanity check a hypervisor host
+ * virt-host-validate.c: Sanity check a hypervisor host
*
* Copyright (C) 2012 Red Hat, Inc.
*
--
1.8.3.2
10 years, 8 months
[libvirt] Seeking for advice on 'virsh console' problems debugging
by Roman Bogorodskiy
Hi,
I've been trying to understand why 'virsh console' doesn't work on
FreeBSD for some time and now I feel like I got stuck.
Background of the problem. Some time ago I started implementing console
support for the bhyve driver. I initially implemented it using nmdm(4)
device:
http://www.freebsd.org/cgi/man.cgi?query=nmdm&sektion=4&manpath=FreeBSD+1...
But 'virsh console' didn't work on it and exited immediately.
I though that it could be nmdm compatibility issue and decided to go
with the plan /dev/pts devices. But I got the same problem with it.
So I decided to try use console with qemu driver. And... I got the same
problem.
After some investigation, I spotted this block in tools/virsh-console.c:376
while (!con->quit) {
if (virCondWait(&con->cond, &con->lock) < 0) {
VIR_ERROR(_("unable to wait on console condition"));
goto cleanup;
}
}
The strange thing is that it doesn't look con->lock mutex before
waiting.
FreeBSD man page for pthread_cond_wait() says that it errors in that
situation:
[EPERM] The specified mutex was not locked by the
calling thread.
I replaced VIR_ERROR with virReportSystemError and it returns EPERM
indeed. So I've added virMutexLock() before calling virCondWait() and it
partially solved the problem for me -- 'virsh console' stopped exiting
immediately.
Actually, it started output for guest, but it's badly formatted: it
includes lots and lots of whitespaces. Input doesn't work properly
(cannot type in sensible stuff).
Here's a sample output, even libvirt messages are badly formatted (I
added some debug prints along the way).
http://people.freebsd.org/~novel/misc/ttyweirdness.png
So, e.g. dmesg output for the guest looks almost the same.
Looks like there's something wrong with the terminal settings, but how
could that be debugged?
PS Worth to mention that 'cu' worked all the time for me on these
devices (both created by bhyve and qemu).
Roman Bogorodskiy
10 years, 8 months