- 20 3月, 2014 13 次提交
-
-
由 Jim Fehlig 提交于
Include a pointer to the libxl driver in libxlDomainObjPrivate object so it can be used in the domain event handler and shutdown thread. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlVmStart from libxl_driver to libxl_domain for use by other libxl modules. For consistency, rename to libxlDomainStart. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlFreeMem from libxl_driver to libxl_domain for use by other libxl modules. For consistency, rename to libxlDomainFreeMem. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDomainSetVcpuAffinities from libxl_driver to libxl_domain for use by other libxl modules. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDoNodeGetInfo from libxl_driver to libxl_conf for use by other libxl modules. For consistency, rename to libxlDriverNodeGetInfo. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDomainAutoCoreDump from libxl_driver to libxl_domain for use by other libxl modules. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDomEventsRegister from libxl_driver to libxl_domain for use by other libxl modules. For consistency, rename to libxlDomainEventsRegister. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlVmCleanup and libxlVmCleanupJob from libxl_driver to libxl_domain for use by other libxl modules. For consistency, rename to libxlDomainCleanup and libxlDomainCleanupJob. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlSaveImageOpen from libxl_driver to libxl_domain for use by other libxl modules. For consistency, rename to libxlDomainSaveImageOpen. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDomainManagedSavePath from libxl_driver to libxl_domain for use by other libxl modules. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Move libxlDomainEventQueue from libxl_driver to libxl_domain for use by other libxl modules. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Michal Privoznik 提交于
Currently, we use pthread_sigmask(SIG_BLOCK, ...) prior to calling poll(). This is okay, as we don't want poll() to be interrupted. However, then - immediately as we fall out from the poll() - we try to restore the original sigmask - again using SIG_BLOCK. But as the man page says, SIG_BLOCK adds signals to the signal mask: SIG_BLOCK The set of blocked signals is the union of the current set and the set argument. Therefore, when restoring the original mask, we need to completely overwrite the one we set earlier and hence we should be using: SIG_SETMASK The set of blocked signals is set to the argument set. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Stefan Berger 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1071181 Commit 49b59a15 fixed one problem but masks another one related to pointer freeing. Avoid putting of the virNWFilterSnoopReq once the thread has been started. It belongs to the thread and the thread will call virNWFilterSnoopReqPut() on it. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
-
- 19 3月, 2014 16 次提交
-
-
由 Michal Privoznik 提交于
s/of value/value of/ Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
Before refactoring this struct, I found it helpful to track which 'int' fields really contain an enum value. * src/conf/domain_conf.h (_virDomainDiskDef): Add comments. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Jiri Denemark 提交于
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Nehal J Wani 提交于
While running qemuhotplugtest, it was found that valgrind pointed out the following memory leak: ==7906== 5 bytes in 1 blocks are definitely lost in loss record 7 of 121 ==7906== at 0x4A069EE: malloc (vg_replace_malloc.c:270) ==7906== by 0x3E782A754D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6) ==7906== by 0x4CDAE03: virDomainDeviceInfoParseXML.isra.32 (domain_conf.c:3685) ==7906== by 0x4CE3BB9: virDomainNetDefParseXML (domain_conf.c:6707) ==7906== by 0x4CFBA08: virDomainDefParseXML (domain_conf.c:12235) ==7906== by 0x4CFBC1E: virDomainDefParseNode (domain_conf.c:13039) ==7906== by 0x4CFBD95: virDomainDefParse (domain_conf.c:12981) ==7906== by 0x41FEB4: testQemuHotplug (qemuhotplugtest.c:66) ==7906== by 0x420F41: virtTestRun (testutils.c:201) ==7906== by 0x41F287: mymain (qemuhotplugtest.c:422) ==7906== by 0x4216BD: virtTestMain (testutils.c:784) ==7906== by 0x3E6CE1ED1C: (below main) (libc-start.c:226) ...and 10 more. Problem is, since 20745748 we do both, parse <alias/> elements from XML files and call qemuAssignDeviceAliases(). While generating runtime info for domain at runtime is just fine in the test, we can parse just inactive XML and remove all <alias/>-es from the XML files. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Martin Kletzander 提交于
I forgot to delete the underscore in object_locking_SOURCES when changing the name in one of previous cleanups. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Jiri Denemark 提交于
Ancient automake (such as from RHEL5) does not provide abs_srcdir and abs_builddir variables which are used by a recent commit of mine (e562e82f). Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The CMD_STOPONERR macro uses its parameter as a boolean, so should be passed true rather than 1. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The 'int isTempChain' parameter to various nwfilter methods only takes two values so should be a bool type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Chunyan Liu 提交于
In libxl driver oldStateDir is NULL when calling virHostdevReAttachDomainHostdevs. This is allowed. Remove ATTRIBUTE_NONNULL setting from oldStateDir. Introduced by commit 6225cb3d. Signed-off-by: NChunyan Liu <cyliu@suse.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Jim Fehlig 提交于
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: NJim Fehlig <jfehlig@suse.com> Signed-off-by: NDavid Kiarie <davidkiarie4@gmail.com>
-
由 Eric Blake 提交于
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: NEric Blake <eblake@redhat.com>
-
- 18 3月, 2014 11 次提交
-
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
由 Michal Privoznik 提交于
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: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
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: NMichal Privoznik <mprivozn@redhat.com>
-
由 Martin Kletzander 提交于
Just to align the backslashes with most of the file. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Ján Tomko 提交于
Reported by Martin Kletzander
-