]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
11 years agoAdd ability to register callback for virCommand dry run
Daniel P. Berrange [Fri, 7 Mar 2014 11:39:48 +0000 (11:39 +0000)]
Add ability to register callback for virCommand dry run

To allow for fault injection of the virCommand dry run,
add the ability to register a callback. The callback will
be passed the argv, env and stdin buffer and is expected
to return the exit status and optionally fill stdout and
stderr buffers.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoChange CMD_STOPONERR(1) to use true
Daniel P. Berrange [Fri, 14 Mar 2014 16:01:57 +0000 (16:01 +0000)]
Change CMD_STOPONERR(1) to use true

The CMD_STOPONERR macro uses its parameter as a boolean, so should
be passed true rather than 1.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoChange 'int isTempChain' to bool in nwfilter
Daniel P. Berrange [Fri, 14 Mar 2014 16:00:49 +0000 (16:00 +0000)]
Change 'int isTempChain' to bool in nwfilter

The 'int isTempChain' parameter to various nwfilter methods
only takes two values so should be a bool type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove pointless return values in nwfilter methods
Daniel P. Berrange [Fri, 14 Mar 2014 13:39:51 +0000 (13:39 +0000)]
Remove pointless return values in nwfilter methods

Many nwfilter methods have an int return value but only ever
return 0 and their callers never check the return value either.
These methods can all be void.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove 'int stopOnError' parameters in nwfilter methods
Daniel P. Berrange [Fri, 14 Mar 2014 13:31:57 +0000 (13:31 +0000)]
Remove 'int stopOnError' parameters in nwfilter methods

Many nwfilter methods have an 'int stopOnError' parameter but
with 1 exception, the callers always pass '1'. The parameter
can therefore be removed from all except one method. That method
will be changed to 'bool stopOnError'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove pointless brackets around boolean
Daniel P. Berrange [Fri, 14 Mar 2014 13:24:28 +0000 (13:24 +0000)]
Remove pointless brackets around boolean

A lot of methods have a 'bool incoming' parameter but then
do  (incoming) ? ... : .... The round brackets here add nothing
to the code so can be removed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoChange 'int incoming' to 'bool incoming' in nwfilter code
Daniel P. Berrange [Fri, 14 Mar 2014 13:21:52 +0000 (13:21 +0000)]
Change 'int incoming' to 'bool incoming' in nwfilter code

Many methods in the nwfilter code have an 'int incoming' parameter
that only takes 0 or 1, so should use a bool instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agovirhostdev.h: remove ATTRIBUTE_NONNULL from oldStateDir
Chunyan Liu [Wed, 19 Mar 2014 03:17:22 +0000 (11:17 +0800)]
virhostdev.h: remove ATTRIBUTE_NONNULL from oldStateDir

In libxl driver oldStateDir is NULL when calling
virHostdevReAttachDomainHostdevs. This is allowed.
Remove ATTRIBUTE_NONNULL setting from oldStateDir.

Introduced by commit 6225cb3.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
11 years agolibxl: fix framebuffer port setting for HVM domains
Jim Fehlig [Mon, 17 Mar 2014 20:22:44 +0000 (14:22 -0600)]
libxl: fix framebuffer port setting for HVM domains

libxl uses the libxl_vnc_info and libxl_sdl_info fields from the
hvm union in libxl_domain_build_info struct when generating QEMU
args for VNC or SDL.  These fields were left unset by the libxl
driver, causing libxl to ignore any user settings.  E.g. with

  <graphics type='vnc' port='5950'/>

port would be ignored and QEMU would instead be invoked with

  -vnc 127.0.0.1:0,to=99

Unlike the libxl_domain_config struct, the libxl_domain_build_info
contains only a single libxl_vnc_info and libxl_sdl_info, so
populate these fields from the first vfb in
libxl_domain_config->vfbs.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: David Kiarie <davidkiarie4@gmail.com>
11 years agomaint: avoid unbalanced {} across vbox #ifdef
Eric Blake [Tue, 18 Mar 2014 20:10:27 +0000 (14:10 -0600)]
maint: avoid unbalanced {} across vbox #ifdef

Emacs is fairly good about navigating across function and scope
boundaries, provided that the code has balanced {}.  The vbox
code, however, violated that premise, by splitting 'if () {'
across several #ifdef branches, but sharing the '} else {...}'
outside of the branches.  The extra lines of code is worth my
sanity, in a function that is already a horrendous 1100+ lines
long.

* src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc) Duplicate code
rather than trying to share else branch across #ifdef.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoRemove global log buffer feature entirely
Daniel P. Berrange [Mon, 3 Mar 2014 14:54:33 +0000 (14:54 +0000)]
Remove global log buffer feature entirely

A earlier commit changed the global log buffer so that it only
records messages that are explicitly requested via the log
filters setting. This removes the performance burden, and
improves the signal/noise ratio for messages in the global
buffer. At the same time though, it is somewhat pointless, since
all the recorded log messages are already going to be sent to an
explicit log output like syslog, stderr or the journal. The
global log buffer is thus just duplicating this data on stderr
upon crash.

The log_buffer_size config parameter is left in the augeas
lens to prevent breakage for users on upgrade. It is however
completely ignored hereafter.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoSwitch to filtering based on log source name instead of filename
Daniel P. Berrange [Fri, 28 Feb 2014 13:55:11 +0000 (13:55 +0000)]
Switch to filtering based on log source name instead of filename

Currently the log filter strings are used in a string comparison
against the source filename each time log message is emitted.
If no log filters at all are set, there's obviously no string
comparison to be done. If any single log filter is set though,
this imposes a compute burden on every logging call even if logs
from the file in question are disabled. This string comparison
must also be done while the logging mutex is held, which has
implications for concurrency when multiple threads are emitting
log messages.

This changes the log filtering to be done based on the virLogSource
object name. The virLogSource struct is extended to contain
'serial' and 'priority' fields. Any time the global log filter
rules are changed a global serial number is incremented. When a
log message is emitted, the serial in the virLogSource instance
is compared with the global serial number. If out of date, then
the 'priority' field in the virLogSource instance is updated based
on the new filter rules. The 'priority' field is checked to see
whether the log message should be sent to the log outputs.

The comparisons of the 'serial' and 'priority' fields are done
with no locks held. So in the common case each logging call has
an overhead of 2 integer comparisons, with no locks held. Only
if the decision is made to forward the message to the log output,
or if the 'serial' value is out of date do locks need to be
acquired.

Technically the comparisons of the 'serial' and 'priority' fields
should be done with locks held, or using atomic operations. Both
of these options have a notable performance impact, however, and
since all writes a protected by a global mutex, it is believed
that worst case behaviour where the fields are read concurrently
with being written would merely result in an mistaken emission
or dropping of the log message in question. This is an acceptable
tradeoff for the performance benefit of avoiding locking.

As a quick benchmark, a demo program that registers 500 file
descriptors with the event loop (eg equiv of 500 QEMU monitor
commands), creates pending read I/O on every FD, and then runs
virEventRunDefaultImpl() took 4.6 seconds to do 51200 iterations.
After this optimization it only takes 3.3 seconds, with the log
APIs no longer being a relevant factor in the running time.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd virLogSource variables to all source files
Daniel P. Berrange [Fri, 28 Feb 2014 12:16:17 +0000 (12:16 +0000)]
Add virLogSource variables to all source files

Any source file which calls the logging APIs now needs
to have a VIR_LOG_INIT("source.name") declaration at
the start of the file. This provides a static variable
of the virLogSource type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoTurn virLogSource into a struct instead of an enum
Daniel P. Berrange [Thu, 27 Feb 2014 17:44:53 +0000 (17:44 +0000)]
Turn virLogSource into a struct instead of an enum

As part of the goal to get away from doing string matching on
filenames when deciding whether to emit a log message, turn
the virLogSource enum into a struct which contains a log
"name". There will eventually be one virLogSource instance
statically declared per source file. To minimise churn in this
commit though, a single global instance is used.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoMove dtrace probe macros into separate header file
Daniel P. Berrange [Thu, 27 Feb 2014 13:41:11 +0000 (13:41 +0000)]
Move dtrace probe macros into separate header file

The dtrace probe macros rely on the logging API. We can't make
the internal.h header include the virlog.h header though since
that'd be a circular include. Instead simply split the dtrace
probes into their own header file, since there's no compelling
reason for them to be in the main internal.h header.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRefactor code that skips logging of error messages
Daniel P. Berrange [Mon, 3 Mar 2014 18:29:33 +0000 (18:29 +0000)]
Refactor code that skips logging of error messages

The error reporting code will invoke a callback when any error
is raised and the default callback will print to stderr. The
virRaiseErrorFull method also sends all error messages on to the
logging code, which also prints to stderr by default. To avoid
duplicated data on stderr, the logging code has some logic to
skip emission when no log outputs are configured, which checks
whether the virLogSource == VIR_LOG_FROM_ERROR.

Meanwhile the libvirtd daemon can register another callback which
is used to reduce log message priority from error to a lower level.
When this is used we do want messages to end up on stderr, so the
error code will conditionally use either VIR_LOG_FROM_FILE or
VIR_LOG_FROM_ERROR depending on whether such a callback is provided.

This will all complicate later refactoring. By pushing the checks
for whether a log output is present up a level into the error code,
the special cases can be isolated in one place.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoReduce performance overhead of the global log buffer
Daniel P. Berrange [Mon, 24 Feb 2014 17:22:14 +0000 (17:22 +0000)]
Reduce performance overhead of the global log buffer

With the vast number of log debug statements in the code, the
logging framework has a measurable performance impact on libvirt
code, particularly in the daemon event loop.

The global log buffer records every single log message triggered
whether anyone cares to see them or not. This makes it impossible
to eliminate the overhead of printf format expansions in any of
the logging code. It is possible to disable the global log buffer
in libvirtd itself, but this doesn't help client side library
code. Also even if disabled by the config file, the existence of
the feature makes other performance improvements in the logging
layer impossible.

Instead of logging every single message to the global buffer, only
log messages that pass the log filters. This if libvirtd is set
to have log_filters="1:libvirt 1:qemu" the global log buffer will
only get filled with those messages instead of everything. This
reduces the performance burden, as well as improving the signal
to noise ratio of the log buffer.

As a quick benchmark, a demo program that registers 500 file
descriptors with the event loop (eg equiv of 500 QEMU monitor
commands), creates pending read I/O on every FD, and then runs
virEventRunDefaultImpl() took 1 minute 40 seconds to do 51200
iterations with nearly all the time shown against the logging
code. After this optimization it only takes 4.6 seconds.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agovirNetServerNewPostExecRestart: Initialize @max_anonymous_clients
Michal Privoznik [Tue, 18 Mar 2014 10:04:27 +0000 (11:04 +0100)]
virNetServerNewPostExecRestart: Initialize @max_anonymous_clients

Coverity spotted a use of possibly undefined variable. If a server is
restarting as an result of update, the JSON file that keeps current
value of some variables will not contain the new variables. This is
the case of @max_anonymous_clients too. We are correctly querying if
there's "max_anonymous_clients" in the JSON, however, we are not
setting a sane default if there's none.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agoqemuDomainSetInterfaceParameters: Allow bandwidth clear out
Michal Privoznik [Tue, 18 Mar 2014 09:50:02 +0000 (10:50 +0100)]
qemuDomainSetInterfaceParameters: Allow bandwidth clear out

We allow translation from no_bandwidth to has_bandwidth for a vnic.
However, going in the opposite direction is not implemented. It's not
limitation of the API rather than internal implementation. The problem
is, we correctly detect that user hasn't specified any outbound (say
he wants to clear out outbound). However, this gets overwritten by
current vnic outbound settings. Then, virNetDevBandwidthSet doesn't
change anything. We need to stop overwriting the outbound if users
don't want us to. Same applies for inbound.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agocfg.mk: Fix whitespaces
Martin Kletzander [Tue, 18 Mar 2014 12:19:21 +0000 (13:19 +0100)]
cfg.mk: Fix whitespaces

Just to align the backslashes with most of the file.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoRemove double space in file name comment check
Ján Tomko [Tue, 18 Mar 2014 12:15:31 +0000 (13:15 +0100)]
Remove double space in file name comment check

Reported by Martin Kletzander

11 years agoDon't leave empty first line in C source files
Martin Kletzander [Fri, 7 Mar 2014 15:47:37 +0000 (16:47 +0100)]
Don't leave empty first line in C source files

If there should be some sort of separator it is better to use comment
with the filename, copyright, description, license information and
authors.

Found by:

git grep -nH '^$' | grep '\.[ch]:1:'

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoExplicitly cast some switch parameters to enum
Martin Kletzander [Fri, 7 Mar 2014 16:21:51 +0000 (17:21 +0100)]
Explicitly cast some switch parameters to enum

This patch is not trying to fix every switch, just the ones I worked
with last time, because some of these were especially unreadable.
Covers enums virDomainGraphicsType and virDomainChrType (where
applicable).

Also sort its cases by their value.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoRequire spaces around equality comparisons
Martin Kletzander [Mon, 17 Mar 2014 09:38:38 +0000 (10:38 +0100)]
Require spaces around equality comparisons

Commit a1cbe4b5 added a check for spaces around assignments and this
patch extends it to checks for spaces around '=='.  One exception is
virAssertCmpInt where comma after '==' is acceptable (since it is a
macro and '==' is its argument).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoRemove duplicate network model characters
Martin Kletzander [Mon, 17 Mar 2014 09:37:23 +0000 (10:37 +0100)]
Remove duplicate network model characters

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agotests: cleanup object-locking test
Martin Kletzander [Thu, 13 Feb 2014 14:20:04 +0000 (15:20 +0100)]
tests: cleanup object-locking test

When ran, cil is throwing out some errors and warnings for obsolete
'or' unused variables and wrong module name (it should not contain a
hyphen; hence the rename).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoqemu: agent availability cleanup
Martin Kletzander [Thu, 27 Feb 2014 10:45:13 +0000 (11:45 +0100)]
qemu: agent availability cleanup

Eliminate all the code re-use which checks for priv->agentError or
priv->agent.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoFix memory leak in virDomainChrSourceDefClear()
Nehal J Wani [Tue, 18 Mar 2014 07:32:24 +0000 (13:02 +0530)]
Fix memory leak in virDomainChrSourceDefClear()

While running qemuxml2xmltest, it was found that valgrind pointed out
the following memory leak:

==21905== 26 bytes in 1 blocks are definitely lost in loss record 23 of 69
==21905==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==21905==    by 0x3E782A754D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
==21905==    by 0x4CD986D: virDomainChrSourceDefParseXML (domain_conf.c:7233)
==21905==    by 0x4CE4199: virDomainChrDefParseXML (domain_conf.c:7512)
==21905==    by 0x4CFAF3F: virDomainDefParseXML (domain_conf.c:12303)
==21905==    by 0x4CFB46E: virDomainDefParseNode (domain_conf.c:13031)
==21905==    by 0x4CFB5E9: virDomainDefParse (domain_conf.c:12973)
==21905==    by 0x41E9D8: testCompareXMLToXMLFiles (qemuxml2xmltest.c:40)
==21905==    by 0x41EBAA: testCompareXMLToXMLHelper (qemuxml2xmltest.c:93)
==21905==    by 0x421D21: virtTestRun (testutils.c:199)
==21905==    by 0x41FCE9: mymain.part.0 (qemuxml2xmltest.c:244)
==21905==    by 0x42249D: virtTestMain (testutils.c:782)
==21905==
... and 7 more

11 years agovirsh: Prohibit virConnectOpen* functions in virsh
Martin Kletzander [Fri, 7 Mar 2014 10:15:39 +0000 (11:15 +0100)]
virsh: Prohibit virConnectOpen* functions in virsh

Addition of vshConnect() makes virConnectOpen() functions obsolete in
virsh.  Thus all virsh-*.[ch] files should be left only with
vshConnect() in the case of need.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agovirsh: Add keepalive in new vshConnect function
Martin Kletzander [Thu, 6 Mar 2014 16:20:11 +0000 (17:20 +0100)]
virsh: Add keepalive in new vshConnect function

Introducing keepalive similarly to Guannan around 2 years ago.  Since
we want to introduce keepalive for every connection, it makes sense to
wrap the connecting function into new virsh one that can deal
keepalive as well.

Function vshConnect() is now used for connecting and keepalive added
in that function (if possible) helps preventing long waits e.g. while
nework goes down during migration.

This patch also adds the options for keepalive tuning into virsh and
fails connecting only when keepalives are explicitly requested and
cannot be set (whether it is due to missing support in connected
driver or remote server).  If not explicitely requested, a debug
message is printed (hence the addition to virsh-optparse test).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073506
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=822839

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agovirt-aa-helper: handle 9pfs
Felix Geyer [Sun, 9 Mar 2014 15:03:20 +0000 (16:03 +0100)]
virt-aa-helper: handle 9pfs

Make virt-aa-helper create rules to allow VMs access to filesystem
mounts from the host.

Signed-off-by: Felix Geyer <debfx@fobos.de>
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
11 years agoFix memory leak in virDomainSnapshotDiskDefClear()
Nehal J Wani [Sun, 16 Mar 2014 08:39:30 +0000 (14:09 +0530)]
Fix memory leak in virDomainSnapshotDiskDefClear()

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.

11 years agobhyve: allow to destroy only active domains
Roman Bogorodskiy [Sat, 15 Mar 2014 15:47:15 +0000 (19:47 +0400)]
bhyve: allow to destroy only active domains

Add a check that domain is active before attempting to destroy it.

11 years agoGive virNWFilterVarCombIterNext saner semantics
Daniel P. Berrange [Mon, 17 Mar 2014 11:38:20 +0000 (11:38 +0000)]
Give virNWFilterVarCombIterNext saner semantics

The virNWFilterVarCombIterNext method will free its
parameter when it gets to the end of the iterator.
This is somewhat misleading design, making it appear
as if the caller has a memory leak. Remove the free'ing
of the parameter and ensure that the calling method
ebiptablesCreateRuleInstanceIterate free's it instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix leak on OOM when creating nwfilter rule instances
Daniel P. Berrange [Mon, 17 Mar 2014 11:58:34 +0000 (11:58 +0000)]
Fix leak on OOM when creating nwfilter rule instances

The ebiptablesAddRuleInst method would leak an instance
of ebiptablesRuleInstPtr if it hit OOM when adding it
to the list of instances. Remove the pointless helper
method virNWFilterRuleInstAddData and just inline the
call to VIR_APPEND_ELEMENT and free the instance on
failure.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAvoid warning message from libxl driver on non-Xen kernels
Daniel P. Berrange [Mon, 17 Mar 2014 12:14:11 +0000 (12:14 +0000)]
Avoid warning message from libxl driver on non-Xen kernels

The libxl driver reads /proc/xen/capabilities to see if it
is on a Dom0 kernel. If that file does not even exist though,
an error is logged. Check for the file existance before trying
to read its contents to avoid the log message.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agobhyve: fix hostbridge device command generation
Roman Bogorodskiy [Sat, 15 Mar 2014 15:17:14 +0000 (19:17 +0400)]
bhyve: fix hostbridge device command generation

Addition of the hostbridge device was mistakenly placed to
bhyveBuildNetArgStr(). This could result in hostbridge device not being
added to the commandline if there are no network devices specified, but
hostbridge device should be added unconditionally.

Fix by placing it to virBhyveProcessBuildBhyveCmd().

11 years agobhyve: add support for virtio block devices
Roman Bogorodskiy [Sat, 15 Mar 2014 14:52:19 +0000 (18:52 +0400)]
bhyve: add support for virtio block devices

11 years agoEnforce attribute check of the virRegister functions
Pavel Hrdina [Mon, 17 Mar 2014 14:55:31 +0000 (15:55 +0100)]
Enforce attribute check of the virRegister functions

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
11 years agodaemon: Introduce max_anonymous_clients
Michal Privoznik [Tue, 4 Mar 2014 17:55:24 +0000 (18:55 +0100)]
daemon: Introduce max_anonymous_clients

https://bugzilla.redhat.com/show_bug.cgi?id=992980

This config tunable allows users to determine the maximum number of
accepted but yet not authenticated users.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agovirNetServer: Introduce unauth clients counter
Michal Privoznik [Tue, 4 Mar 2014 14:37:27 +0000 (15:37 +0100)]
virNetServer: Introduce unauth clients counter

The counter gets incremented on each unauthenticated client added to the
server and decremented whenever the client authenticates.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agodatatypes: Fix comments
Michael Chapman [Tue, 11 Mar 2014 04:04:59 +0000 (15:04 +1100)]
datatypes: Fix comments

- As of commit 2ff4c137, all virGet*() functions in datatypes.c always
  return pointers to new objects. Objects are not cached in a
  per-connection hashtable.

- Fix variable names in comments for all vir*Dispose() functions in
  datatypes.c.

- Add comments for virGetStream(), virStreamDispose(),
  virGetDomainSnapshot(), virDomainSnapshotDispose().

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
11 years agobhyve: implement nodeGetInfo()
Roman Bogorodskiy [Sun, 16 Mar 2014 11:10:51 +0000 (15:10 +0400)]
bhyve: implement nodeGetInfo()

Add bhyveNodeGetInfo() which is a simple wrapper around nodeGetInfo()
from src/nodeinfo.c.

11 years agoAdd parameter to wait for lock in file locking APIs
Nehal J Wani [Mon, 17 Mar 2014 14:17:36 +0000 (19:47 +0530)]
Add parameter to wait for lock in file locking APIs

Our current pidfile acquire APis (virPidFileAcquire) simply return -1 upon
failure to acquire a lock. This patch adds a parameter 'bool waitForLock'
which instructs the APIs if we want to make it block and wait for the lock
or not.

11 years agoFix mistakes in checking return values
Daniel P. Berrange [Mon, 17 Mar 2014 15:47:45 +0000 (15:47 +0000)]
Fix mistakes in checking return values

Thre was a syntax error in checking virRegisterStateDriver in
the remote driver, and bogus checking of a void return type
of virDomainConfNWFilterRegister in nwfilter.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agospec: move some dirs into appropriate subpackages
Michael Chapman [Thu, 6 Mar 2014 02:46:45 +0000 (13:46 +1100)]
spec: move some dirs into appropriate subpackages

This commit moves a few directories into more appropriate subpackages.
In a few cases a directory is owned by two subpackages, however this is
OK as long as the permissions and ownership for the directory are
consistent between them.

- %{_sysconfdir}/libvirt/qemu/

  Used by the qemu and network drivers.

  When building with separate driver modules, this directory is only
  owned by l-d-d-network. l-d-d-qemu has a hard dependency on
  l-d-d-network, which means this directory is created with the
  correct permissions and ownership, however it's clearer if both
  subpackages own the directory independently.

- %{_sysconfdir}/libvirt/nwfilter/

  Used by the nwfilter driver only.

  This directory is currently always owned by libvirt-daemon. This
  commit moves it into l-d-d-nwfilter when building with separate
  driver modules.

- %{_localstatedir}/run/libvirt/network/

  Used by the network and nwfilter drivers.

  When building without separate driver modules, this directory is
  should be owned by libvirt-daemon only if either of these drivers
  are enabled. When building with separate driver modules, this
  directory should be owned by l-d-d-nwfilter in addition to
  l-d-d-network.

- %{_datadir}/libvirt/networks/ and
  %{_datadir}/libvirt/networks/default.xml

  Used only by the %post scriptlet in libvirt-daemon-config-network.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
11 years agoFix issue found by coverity and cleanup
Pavel Hrdina [Mon, 17 Mar 2014 13:35:42 +0000 (14:35 +0100)]
Fix issue found by coverity and cleanup

Coverity found an issue in lxc_driver and uml_driver that we don't
check the return value of register functions.

I've also updated all other places and unify the way we check the
return value.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
11 years agoXMLToNative: Parse XML as INACTIVE
Cole Robinson [Thu, 13 Mar 2014 19:10:45 +0000 (15:10 -0400)]
XMLToNative: Parse XML as INACTIVE

Right now we are parsing the XML as though it's live, which for example
will choke on hardcoded XML like:

  <seclabel type='dynamic' model='selinux' relabel='yes'/>

Erroring with:

  $ sudo virsh domxml-to-native qemu-argv f
  error: XML error: security label is missing

All drivers are fixed, but only qemu was tested.

11 years agoqemu: XMLToNative: Don't open vhostfd
Cole Robinson [Thu, 13 Mar 2014 19:10:09 +0000 (15:10 -0400)]
qemu: XMLToNative: Don't open vhostfd

Just skip the vhost command line generation, since this won't work if
attempting to run manually.

11 years agoqemu: XMLToNative: Don't show -S
Cole Robinson [Thu, 13 Mar 2014 18:23:56 +0000 (14:23 -0400)]
qemu: XMLToNative: Don't show -S

-S causes qemu to start in the paused state. Since XML2Native is intended
to generate something that users can run directly, this will trip them up.

11 years agoqemu: cleanup tap devices on FreeBSD
Roman Bogorodskiy [Tue, 11 Mar 2014 07:17:26 +0000 (11:17 +0400)]
qemu: cleanup tap devices on FreeBSD

We have to explicitly destroy TAP devices on FreeBSD because
they're not freed after being closed, otherwise we end up with
orphaned TAP devices after destroying a domain.

11 years agoFix build with qemu driver disabled
Roman Bogorodskiy [Sat, 8 Mar 2014 16:51:45 +0000 (20:51 +0400)]
Fix build with qemu driver disabled

Do not include test_libvirt_lockd.aug when configured without qemu
driver.

https://bugzilla.redhat.com/show_bug.cgi?id=1071777

11 years agoopenvzRegister: Check for error return
John Ferlan [Fri, 14 Mar 2014 10:26:40 +0000 (06:26 -0400)]
openvzRegister: Check for error return

A recent change to openvz_driver.c caused Coverity to make additional
comparisons and find that the openvzRegister() was not checking the
status of virRegisterDriver() call like other callers and thus generated
a CHECKED_RETURN condition

11 years agobuild: detect/prohibit hardcoded XML indent in syntax-check
Laine Stump [Thu, 13 Mar 2014 00:05:31 +0000 (18:05 -0600)]
build: detect/prohibit hardcoded XML indent in syntax-check

This rule wouldn't be able to find any case of a hardcoded indent that
was in the middle of a string, but then virBuffer doesn't add
indentation in the middle of a string either.

11 years agoconf: eliminate hardcoded indentation in all remaining xml
Laine Stump [Thu, 6 Mar 2014 14:58:56 +0000 (16:58 +0200)]
conf: eliminate hardcoded indentation in all remaining xml

These last files had such a small change count I just put them into a
single patch.

11 years agoqemu: elminate hardcoded indent in capabilities cache XML
Laine Stump [Thu, 13 Mar 2014 00:35:01 +0000 (18:35 -0600)]
qemu: elminate hardcoded indent in capabilities cache XML

11 years agoutil: eliminate hardcoded indent in virConnectSysInfo formatting
Laine Stump [Thu, 13 Mar 2014 00:03:03 +0000 (18:03 -0600)]
util: eliminate hardcoded indent in virConnectSysInfo formatting

This same set of functions is used by the qemu, xen, and lxc drivers'
connectSysInfo function.

11 years agoqemu: eliminate hardcoded indent from migration cookie xml
Laine Stump [Thu, 13 Mar 2014 00:00:10 +0000 (18:00 -0600)]
qemu: eliminate hardcoded indent from migration cookie xml

This is also never seen by a human.

11 years agovirsh: eliminate hardcoded indentation in xml generated for commands
Laine Stump [Wed, 12 Mar 2014 23:52:07 +0000 (17:52 -0600)]
virsh: eliminate hardcoded indentation in xml generated for commands

These are never seen externally, only passed into libvirt APIs, so in
practice this makes no real difference, but it's good to be
consistent.

11 years agoconf: eliminate hardcoded indent in volume/pool xml
Laine Stump [Thu, 6 Mar 2014 14:57:47 +0000 (16:57 +0200)]
conf: eliminate hardcoded indent in volume/pool xml

Again completely mechanical, but a lot of lines.

11 years agoconf: eliminate hardcoded indentation in node device xml
Laine Stump [Thu, 6 Mar 2014 14:53:02 +0000 (16:53 +0200)]
conf: eliminate hardcoded indentation in node device xml

Completely mechanical changes, but there were a lot of lines so I made
it a separate patch.

11 years agoconf: eliminate hardcoded indentation in capabilities xml
Laine Stump [Thu, 6 Mar 2014 14:50:15 +0000 (16:50 +0200)]
conf: eliminate hardcoded indentation in capabilities xml

There were a lot of changes here, but all very mechanical. For some
reason, the virBufferPtr had been named "xml" instead of "buf" in this
file, so since the indentation changing touched almost every line
using the buffer, I took this chance to change its name for "buf" for
consistency with every other file.

11 years agoconf: eliminate hardcoded indentation in nwfilter xml
Laine Stump [Wed, 5 Mar 2014 15:04:15 +0000 (17:04 +0200)]
conf: eliminate hardcoded indentation in nwfilter xml

This file was using multiple virBuffers, inserting the contents of
buf3 into buf2, then inserting the contents of buf2 into buf1, rather
than the more conventional method of just passing around a single
virBufferPtr and streaming everything into that single buffer. This
was unnecessary, and also made it more difficult to make indentation
relative, because when you insert a string into a buffer, the
indentation of the buffer is only applied once at the beginning of the
string, *not* each time a newline is encountered in the string.

11 years agoconf: eliminate outmoded/odd indent method from interface xml
Laine Stump [Wed, 5 Mar 2014 12:24:22 +0000 (14:24 +0200)]
conf: eliminate outmoded/odd indent method from interface xml

These format functions needed the ability to be indented by an
arbitrary amount, but were written before the introduction of
virBufferAdjustIndent(). They instead used the much more clunky method
of adding a "level" arg to every format function, and padding with
spaces using the "%*s" printf format specifier (giving it the level,
and "", which has the effect of adding level spaces to the output).

While eliminating the hardcoded indentation in other xml, I decided it
was finally time to also modernize the interface formatter code to
make it more consistent.

11 years agoconf: eliminate hardcoded indent from network xml
Laine Stump [Wed, 5 Mar 2014 11:55:51 +0000 (13:55 +0200)]
conf: eliminate hardcoded indent from network xml

This was very simple, since the only place that had hardcoded
indentation was a few items in the network status xml.

11 years agoconf: eliminate hardcoded indent from domain snapshot xml
Laine Stump [Wed, 5 Mar 2014 10:09:46 +0000 (12:09 +0200)]
conf: eliminate hardcoded indent from domain snapshot xml

All leading spaces in domain snapshot xml format functions have been
replaced with appropriate calls to virBufferAdjustIndent(). This will
make it easier to call other similarly fixed format functions
(e.g. domain device format functions).

11 years agoconf: eliminate hardcoded indent from domain xml
Laine Stump [Wed, 5 Mar 2014 09:50:42 +0000 (11:50 +0200)]
conf: eliminate hardcoded indent from domain xml

Many of the domain xml format functions (including all of the device
format functions) had hard-coded spaces, which made for incorrect
indentation when those functions were called in a different context
(for example, commit 2122cf39 added <interface> XML into the document
provided to a network hook script, and in this case it should have
been indented by 2 spaces, but was instead indented by 6 spaces).

To make it possible to insert a properly indented device anywhere into
an XML document, this patch removes hardcoded spaces from the
formatting functions, and calls virBufferAdjustIndent() at appropriate
places instead. (a regex search of domain_conf.c was done to assure
that all occurrences of hardcoded spaces were removed).

virDomainDiskSourceDefFormatInternal() is also called from
snapshot_conf.c, so two virBufferAdjustIndent() calls were temporarily
added around that call - those functions will have hardcoded spaces
removed in a separate patch.

This could cause some conflicts when backporting future changes to the
formatting functions to older branches, but fortunately the changes
are almost all trivial, so conflict resolution will be obvious.

11 years agonwfilter: Add ARP src/dst IP mask for ebtables ARP
Stefan Berger [Thu, 13 Mar 2014 22:30:09 +0000 (18:30 -0400)]
nwfilter: Add ARP src/dst IP mask for ebtables ARP

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=862887

Add a netmask for the source and destination IP address for the
ebtables --arp-ip-src and --arp-ip-dst options. Extend the XML
parser with support for XML attributes for these netmasks similar
to already supported netmasks. Extend the documentation.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
11 years agonwfilter: Fix rule priority problem
Stefan Berger [Thu, 13 Mar 2014 22:30:09 +0000 (18:30 -0400)]
nwfilter: Fix rule priority problem

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1072292

Fix a problem related to rule priorities that did not allow to
have rules applied that had a higher priority than the chain they
were in. In this case the chain did not exist yet when the rule
was instantiated. The solution is to adjust the priority of rules
if the priority of the chain is of higher value. That way the chain
will be created before the rule.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
11 years agohostdev: add virObject field to virHostdevManager struct
Jim Fehlig [Wed, 12 Mar 2014 22:57:36 +0000 (16:57 -0600)]
hostdev: add virObject field to virHostdevManager struct

Commit 6b306d66 converted virHostdevManager to a virObject, but
missed adding a virObject field to the virHostdevManager struct.
Result is memory corruption when taking a reference on an instance
of the object, where atomic inc is done on the stateDir field.
Later use of stateDir crashes libvirtd.

11 years agoqemu.conf: Mention virtlockd in @lock_manager description
Michal Privoznik [Wed, 12 Mar 2014 07:53:37 +0000 (08:53 +0100)]
qemu.conf: Mention virtlockd in @lock_manager description

When I played with virtlockd I was stunned by lacking
documentation. My frustration got bigger when I had to
read the patches to get the correct value to set in
qemu.conf.

Moreover, from pure libvirt-pride  I'm changing commented
value from sanlock to lockd. We want to favor our own
implementation after all.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agohotplug:Fix log mistake in qemuMonitorAddNetdev
Wang Rui [Thu, 13 Mar 2014 17:05:03 +0000 (17:05 +0000)]
hotplug:Fix log mistake in qemuMonitorAddNetdev

VIR_DEBUG  in qemuMonitorAddNetdev should print vhostfdSize

Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
11 years agoMake ABI stability issue easier to debug
Jiri Denemark [Wed, 12 Mar 2014 10:50:12 +0000 (11:50 +0100)]
Make ABI stability issue easier to debug

When ABI stability check fails, we only log the error message describing
the incompatibility. Let's log both XMLs in case of an error to make it
easier to analyze where and why the stability check failed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoqemu: Forbid "sgio" support for SCSI generic host device
Osier Yang [Fri, 7 Mar 2014 14:23:26 +0000 (22:23 +0800)]
qemu: Forbid "sgio" support for SCSI generic host device

The kernel didn't support the unprivileged SGIO for SCSI generic
device finally, and since it's unknow whether the way to support
unprivileged SGIO for SCSI generic device will be similar as for
SCSI block device or not, even it's simliar (I.e. via sysfs, for
SCSI block device, it's /sys/dev/block/8\:0/queue/unpriv_sgio,
for example), the file name might be different, So it's better not
guess what it should be like currently.

This patch removes the related code (mainly about the "shareable"
checking on the "sgio" setting, it's not supported at all, why
we leave checking code there? :-), and error out if "sgio" is
specified in the domain config.

11 years agodocs: add VMmanager to web apps
Martin Kletzander [Wed, 12 Mar 2014 07:27:42 +0000 (08:27 +0100)]
docs: add VMmanager to web apps

This is a request for adding a VMmanager application as requested and
described by Ksenya Phil.

Signed-off-by: Ksenya Phil <philka2003@mail.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agolibxl: Check for control_d string to decide about dom0
Stefan Bader [Wed, 12 Mar 2014 12:03:26 +0000 (13:03 +0100)]
libxl: Check for control_d string to decide about dom0

As soon as any guest mounts xenfs to /proc/xen, there is a capabilities
file in that directory. However it returns nothing when reading from it.
Change the test to actually check the contents of the file.

BugLink: http://bugs.launchpad.net/bugs/1248025
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
11 years agovircrypto: fix Invalid write in virCryptoHashString()
Nehal J Wani [Wed, 12 Mar 2014 21:44:11 +0000 (03:14 +0530)]
vircrypto: fix Invalid write in virCryptoHashString()

While running vircryptotest, it was found that valgrind pointed out the
following error:

==27453== Invalid write of size 1
==27453==    at 0x4C7D7C9: virCryptoHashString (vircrypto.c:76)
==27453==    by 0x401C4E: testCryptoHash (vircryptotest.c:41)
==27453==    by 0x402A11: virtTestRun (testutils.c:199)
==27453==    by 0x401AD5: mymain (vircryptotest.c:76)
==27453==    by 0x40318D: virtTestMain (testutils.c:782)
==27453==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
==27453==  Address 0x51f0541 is 0 bytes after a block of size 65 alloc'd
==27453==    at 0x4A0577B: calloc (vg_replace_malloc.c:593)
==27453==    by 0x4C69F2E: virAllocN (viralloc.c:189)
==27453==    by 0x4C7D76B: virCryptoHashString (vircrypto.c:69)
==27453==    by 0x401C4E: testCryptoHash (vircryptotest.c:41)
==27453==    by 0x402A11: virtTestRun (testutils.c:199)
==27453==    by 0x401AD5: mymain (vircryptotest.c:76)
==27453==    by 0x40318D: virtTestMain (testutils.c:782)
==27453==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
==27453==

...and many more.  Two observations: hashstrlen was already set
to include the trailing NUL byte (so writing to hashstrlen as
the array offset was indeed writing one byte beyond bounds), and
VIR_ALLOC_N already guarantees zero-initialization (so we already
have a trailing NUL without needing to explicitly write one).

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoFix type mismatch of virNetDev*NetConfig on non-Linux
Ján Tomko [Wed, 12 Mar 2014 17:17:39 +0000 (18:17 +0100)]
Fix type mismatch of virNetDev*NetConfig on non-Linux

Commit b4bbaee changed char* to const char*, but omitted
the non-Linux version.

11 years agoadd pci passthrough to libxl driver
Chunyan Liu [Thu, 6 Mar 2014 09:46:11 +0000 (17:46 +0800)]
add pci passthrough to libxl driver

Add pci passthrough to libxl driver, support attach-device, detach-device and
start a vm with pci hostdev specified.

11 years agoadd hostdev pci backend type for xen
Chunyan Liu [Thu, 6 Mar 2014 08:44:22 +0000 (16:44 +0800)]
add hostdev pci backend type for xen

Add VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN. For legacy xen, it will use "pciback" as
stub driver.

11 years agochange lxc_hostdev.c to use virhostdev common library APIs
Chunyan Liu [Thu, 6 Mar 2014 08:24:17 +0000 (16:24 +0800)]
change lxc_hostdev.c to use virhostdev common library APIs

11 years agoadd unit test for new virhostdev common library
Chunyan Liu [Thu, 6 Mar 2014 08:08:36 +0000 (16:08 +0800)]
add unit test for new virhostdev common library

Add unit test for hostdev common library. Current tests are based on virpcimock.

11 years agoAdd parameter checks/annotations to hostdev APIs
Chunyan Liu [Thu, 6 Mar 2014 08:02:31 +0000 (16:02 +0800)]
Add parameter checks/annotations to hostdev APIs

Mark many parameters as NONNULL and check for empty list of
hostdevs.

11 years agoadd 3 wrapper functions for prepare/reattach/update domain hostdevs
Chunyan Liu [Thu, 6 Mar 2014 07:57:03 +0000 (15:57 +0800)]
add 3 wrapper functions for prepare/reattach/update domain hostdevs

11 years agoimprove virHostdevUpdate* parameters to make it more widely used
Chunyan Liu [Thu, 6 Mar 2014 07:48:49 +0000 (15:48 +0800)]
improve virHostdevUpdate* parameters to make it more widely used

Changes parameter from vm def to specific hostdevs info and name info, so that
it could be used more widely, e.g, could be used without full vm def info.

11 years agoCapitalize USB, PCI and SCSI in hostdev variables
Daniel P. Berrange [Wed, 12 Mar 2014 16:38:18 +0000 (16:38 +0000)]
Capitalize USB, PCI and SCSI in hostdev variables

Change any variable names with Usb, Pci or Scsi to use
USB, PCI and SCSI since they are abbreviations.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove redundant duplicated 'Hostdev' string method names
Daniel P. Berrange [Wed, 12 Mar 2014 16:35:30 +0000 (16:35 +0000)]
Remove redundant duplicated 'Hostdev' string method names

Some virHostdevXXXX methods included the string Hostdev again
as a suffix. Change the latter to Device instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoCapitalize USB, PCI and SCSI in hostdev methods
Chunyan Liu [Thu, 6 Mar 2014 07:35:03 +0000 (15:35 +0800)]
Capitalize USB, PCI and SCSI in hostdev methods

Change any method names with Usb, Pci or Scsi to use
USB, PCI and SCSI since they are abbreviations.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFixed const-ness of parameters in netdev/hostdev code
Daniel P. Berrange [Wed, 12 Mar 2014 16:01:39 +0000 (16:01 +0000)]
Fixed const-ness of parameters in netdev/hostdev code

Various methods in virnetdev.c and virhostdev.c were missing
const-ness for several char * parameters.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoimprove parameter name to let it more meaningful
Chunyan Liu [Thu, 6 Mar 2014 07:24:06 +0000 (15:24 +0800)]
improve parameter name to let it more meaningful

11 years agomove virHostdevNodeDevice* to virhostdev.c
Chunyan Liu [Thu, 6 Mar 2014 07:20:14 +0000 (15:20 +0800)]
move virHostdevNodeDevice* to virhostdev.c

11 years agoextract general code of NodeDeviceReset
Chunyan Liu [Thu, 6 Mar 2014 07:14:44 +0000 (15:14 +0800)]
extract general code of NodeDeviceReset

11 years agoextract general code of NodeDeviceReAttach
Chunyan Liu [Thu, 6 Mar 2014 07:04:01 +0000 (15:04 +0800)]
extract general code of NodeDeviceReAttach

11 years agoextract general code of NodeDeviceDetach
Chunyan Liu [Thu, 6 Mar 2014 06:57:02 +0000 (14:57 +0800)]
extract general code of NodeDeviceDetach

11 years agomove virHostdevReAttachHostScsiDevices to virhostdev.c
Chunyan Liu [Thu, 6 Mar 2014 06:49:23 +0000 (14:49 +0800)]
move virHostdevReAttachHostScsiDevices to virhostdev.c

11 years agopass driver name as parameter to virHostdevReAttachScciHostdevs
Chunyan Liu [Thu, 6 Mar 2014 06:47:56 +0000 (14:47 +0800)]
pass driver name as parameter to virHostdevReAttachScciHostdevs

11 years agoextract general code from qemuDomainReAttachHostScsiDevices
Chunyan Liu [Thu, 6 Mar 2014 06:45:23 +0000 (14:45 +0800)]
extract general code from qemuDomainReAttachHostScsiDevices

Extract general code from qemuDomainReAttachHostScsiDevices to
virHostdevDomainReAttachHostScsiDevices.

11 years agomove virHostdevReAttachUsbHostdevs to virhostdev.c
Chunyan Liu [Thu, 6 Mar 2014 06:37:30 +0000 (14:37 +0800)]
move virHostdevReAttachUsbHostdevs to virhostdev.c

11 years agopass driver name as paramter to virHostdevReAttachUsbHostdevs
Chunyan Liu [Thu, 6 Mar 2014 06:33:29 +0000 (14:33 +0800)]
pass driver name as paramter to virHostdevReAttachUsbHostdevs

11 years agoextract general code from qemuDomainReAttachHostUsbDevices
Chunyan Liu [Thu, 6 Mar 2014 06:28:07 +0000 (14:28 +0800)]
extract general code from qemuDomainReAttachHostUsbDevices

Extract general code from qemuDomainReAttachHostUsbDevices to
virHostdevDomainReAttachHostUsbDevices.