- 10 3月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Device names can be manipulated, so it is better to also log the major/minor device number corresponding to the cgroup ACL changes that libvirt made. This required some refactoring of the relatively new qemu cgroup audit code. Also, qemuSetupChardevCgroup was only auditing on failure, not success. * src/qemu/qemu_audit.h (qemuDomainCgroupAudit): Delete. (qemuAuditCgroup, qemuAuditCgroupMajor, qemuAuditCgroupPath): New prototypes. * src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Rename... (qemuAuditCgroup): ...and drop a parameter. (qemuAuditCgroupMajor, qemuAuditCgroupPath): New functions, to allow listing device major/minor in audit. (qemuAuditGetRdev): New helper function. * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust callers. * src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow) (qemuSetupHostUsbDeviceCgroup, qemuSetupCgroup) (qemuTeardownDiskPathDeny): Likewise. (qemuSetupChardevCgroup): Likewise, fixing missing audit.
-
- 09 3月, 2011 7 次提交
-
-
由 Eric Blake 提交于
* src/qemu/qemu_audit.c (qemuDomainHostdevAudit): Avoid use of "type", which has a pre-defined meaning. (qemuDomainCgroupAudit): Likewise, as well as "item".
-
由 Eric Blake 提交于
I noticed these while testing 'make dist'. Parsing ./../src/util/event.c Function comment for virEventRegisterDefaultImpl lacks description of return value Function comment for virEventRunDefaultImpl lacks description of return value Parsing ./../src/util/virterror.c Missing comment for function virSetErrorLogPriorityFunc * src/util/event.c (virEventRegisterDefaultImpl) (virEventRunDefaultImpl): Document return types. * src/util/virterror.c (virSetErrorLogPriorityFunc): Provide docs.
-
由 Cole Robinson 提交于
virRun gives pretty useful error output, let's not overwrite it unless there is a good reason. Some places were providing more information about what the commands were _attempting_ to do, however that's usually less useful from a debugging POV than what actually happened.
-
由 Guido Günther 提交于
as described at http://wiki.debian.org/ToolChain/DSOLinking https://fedoraproject.org/wiki/UnderstandingDSOLinkChange otherwise the build fails on current Debian unstable with: CCLD libvirtd /usr/bin/ld: ../src/.libs/libvirt_driver_lxc.a(libvirt_driver_lxc_la-lxc_container.o): undefined reference to symbol 'capng_apply' /usr/bin/ld: note: 'capng_apply' is defined in DSO //usr/lib/libcap-ng.so.0 so try adding it to the linker command line CCLD libvirtd /usr/bin/ld: ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend.o): undefined reference to symbol 'fgetfilecon' /usr/bin/ld: note: 'fgetfilecon' is defined in DSO //lib/libselinux.so.1 so try adding it to the linker command line //lib/libselinux.so.1: could not read symbols: Invalid operation and similar errors.
-
由 Hu Tao 提交于
* src/qemu/qemu_driver.c: qemuDomainUpdateDeviceFlags() is not disk specific as the message suggests
-
由 Eric Blake 提交于
On cygwin: CC libvirt_driver_security_la-security_dac.lo security/security_dac.c: In function 'virSecurityDACSetProcessLabel': security/security_dac.c:618: warning: format '%d' expects type 'int', but argument 7 has type 'uid_t' [-Wformat] We've done this before (see src/util/util.c). * src/security/security_dac.c (virSecurityDACSetProcessLabel): On cygwin, uid_t is a 32-bit long.
-
由 Eric Blake 提交于
On cygwin: CC libvirt_util_la-cgroup.lo util/cgroup.c: In function 'virCgroupKillRecursiveInternal': util/cgroup.c:1458: warning: implicit declaration of function 'virCgroupNew' [-Wimplicit-function-declaration] * src/util/cgroup.c (virCgroupKill): Don't build on platforms where virCgroupNew is unsupported.
-
- 08 3月, 2011 5 次提交
-
-
由 Daniel Veillard 提交于
Apparently some signals found on Unix are not exposed, this led to a compilation failure * src/util/logging.c: make code related to each signal dependant upon the definition of that signal
-
由 Wen Congyang 提交于
Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Wen Congyang 提交于
The way to detach a USB disk is the same as that to detach a SCSI disk. Rename this function and we can use it to detach a USB disk. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Cole Robinson 提交于
Currently it sounds like spice is completely unsupported, which is confusing.
-
由 Wen Congyang 提交于
When I use newest libvirt to save a domain, libvirtd will be deadlock. Here is the output of gdb: (gdb) thread 3 [Switching to thread 3 (Thread 0x7f972a1fc710 (LWP 30265))]#0 0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt at qemu/qemu_driver.c:2074 ret=0x7f972a1fbbe0) at remote.c:2273 (gdb) thread 7 [Switching to thread 7 (Thread 0x7f9730bcd710 (LWP 30261))]#0 0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt (gdb) p *(virMutexPtr)0x6fdd60 $2 = {lock = {__data = {__lock = 2, __count = 0, __owner = 30261, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000\065v\000\000\001", '\000' <repeats 26 times>, __align = 2}} (gdb) p *(virMutexPtr)0x1a63ac0 $3 = {lock = {__data = {__lock = 2, __count = 0, __owner = 30265, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000\071v\000\000\001", '\000' <repeats 26 times>, __align = 2}} (gdb) info threads 7 Thread 0x7f9730bcd710 (LWP 30261) 0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 6 Thread 0x7f972bfff710 (LWP 30262) 0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 5 Thread 0x7f972b5fe710 (LWP 30263) 0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 4 Thread 0x7f972abfd710 (LWP 30264) 0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 * 3 Thread 0x7f972a1fc710 (LWP 30265) 0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 2 Thread 0x7f97297fb710 (LWP 30266) 0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 1 Thread 0x7f9737aac800 (LWP 30260) 0x000000351fe0803d in pthread_join () from /lib64/libpthread.so.0 The reason is that we will try to lock some object in callback function, and we may call event API with locking the same object. In the function virEventDispatchHandles(), we unlock eventLoop before calling callback function. I think we should do the same thing in the function virEventCleanupTimeouts() and virEventCleanupHandles(). Signed-off-by: NWen Congyang <wency@cn.fujitsu.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 3月, 2011 3 次提交
-
-
由 Daniel P. Berrange 提交于
Not all applications have an existing event loop they need to integrate with. Forcing them to implement the libvirt event loop integration APIs is an undue burden. This just exposes our simple poll() based implementation for apps to use. So instead of calling virEventRegister(....callbacks...) The app would call virEventRegisterDefaultImpl() And then have a thread somewhere calling static bool quit = false; .... while (!quit) virEventRunDefaultImpl() * daemon/libvirtd.c, tools/console.c, tools/virsh.c: Convert to public event loop APIs * include/libvirt/libvirt.h.in, src/libvirt_private.syms: Add virEventRegisterDefaultImpl and virEventRunDefaultImpl * src/util/event.c: Implement virEventRegisterDefaultImpl and virEventRunDefaultImpl using poll() event loop * src/util/event_poll.c: Add full error reporting * src/util/virterror.c, include/libvirt/virterror.h: Add VIR_FROM_EVENTS
-
由 Daniel P. Berrange 提交于
The event loop implementation is used by more than just the daemon, so move it into the shared area. * daemon/event.c, src/util/event_poll.c: Renamed * daemon/event.h, src/util/event_poll.h: Renamed * tools/Makefile.am, tools/console.c, tools/virsh.c: Update to use new virEventPoll APIs * daemon/mdns.c, daemon/mdns.c, daemon/Makefile.am: Update to use new virEventPoll APIs
-
由 Daniel Veillard 提交于
* src/util/logging.c: fix virLogDumpAllFD() to avoid snprintf, simplify the code and provide more useful signal descriptions. Also remove an unused variable.
-
- 06 3月, 2011 1 次提交
-
-
由 Osier Yang 提交于
For qemu names the primary vga as "qxl-vga": 1) if vram is specified for 2nd qxl device: -vga qxl -global qxl-vga.vram_size=$SIZE \ -device qxl,id=video1,vram_size=$SIZE,... 2) if vram is not specified for 2nd qxl device, (use the default set by global): -vga qxl -global qxl-vga.vram_size=$SIZE \ -device qxl,id=video1,... For qemu names all qxl devices as "qxl": 1) if vram is specified for 2nd qxl device: -vga qxl -global qxl.vram_size=$SIZE \ -device qxl,id=video1,vram_size=$SIZE ... 2) if vram is not specified for 2nd qxl device: -vga qxl -global qxl-vga.vram_size=$SIZE \ -device qxl,id=video1,... "-global" is the only way to define vram_size for the primary qxl device, regardless of how qemu names it, (It's not good a good way, as original idea of "-global" is to set a global default for a driver property, but to specify vram for first qxl device, we have to use it). For other qxl devices, as they are represented by "-device", could specify it directly and seperately for each, and it overrides the default set by "-global" if specified. v1 - v2: * modify "virDomainVideoDefaultRAM" so that it returns 16M as the default vram_size for qxl device. * vram_size * 1024 (qemu accepts bytes for vram_size). * apply default vram_size for qxl device for which vram_size is not specified. * modify "graphics-spice" tests (more sensiable vram_size) * Add an argument of virDomainDefPtr type for qemuBuildVideoDevStr, to use virDomainVideoDefaultRAM in qemuBuildVideoDevStr). v2 - v3: * Modify default video memory size for qxl device from 16M to 24M * Update codes to be consistent with changes on qemu_capabilities.*
-
- 05 3月, 2011 1 次提交
-
-
由 Phil Petty 提交于
Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 3月, 2011 6 次提交
-
-
由 Daniel Veillard 提交于
virLogEmergencyDumpAll() allows to dump the content of the debug buffer from within a signal handler. It saves to all log file or stderr if none is found * src/util/logging.h src/util/logging.c: add the new API and cleanup the old virLogDump code * src/libvirt_private.syms: exports it as a private symbol
-
由 Daniel Veillard 提交于
* src/util/logging.c: the start pointer need to wrap around too
-
由 Daniel Veillard 提交于
Initially only the log actually written out by libvirt were saved on the memory buffer, this patch forces all informations including info and debug to be saved in memory too. This is useful to get full data in case of crash.
-
由 Laine Stump 提交于
This was also found while investigating https://bugzilla.redhat.com/show_bug.cgi?id=670848 An EOF on a domain's monitor socket results in an event being queued to handle the EOF. The handler calls qemuProcessHandleMonitorEOF. If it is a transient domain, this leads to a call to virDomainRemoveInactive, which removes the domain from the driver's hashtable and unref's it. Nowhere in this code is the qemu driver lock acquired. However, all modifications to the driver's domain hashtable *must* be done while holding the driver lock, otherwise the hashtable can become corrupt, and (even more likely) another thread could call a different hashtable function and acquire a pointer to the domain that is in the process of being destroyed. To prevent such a disaster, qemuProcessHandleMonitorEOF must get the qemu driver lock *before* it gets the DomainObj's lock, and hold it until it is finished with the DomainObj. This guarantees that nobody else modifies the hashtable at the same time, and that anyone who had already gotten the DomainObj from the hashtable prior to this call has finished with it before we remove/destroy it.
-
由 Laine Stump 提交于
This was found while researching the root cause of: https://bugzilla.redhat.com/show_bug.cgi?id=670848 virDomainUnref should only be called with the lock held for the virDomainObj in question. However, when a transient qemu domain gets EOF on its monitor socket, it queues an event which frees the monitor, which unref's the virDomainObj without first locking it. If another thread has already locked the virDomainObj, the modification of the refcount could potentially be corrupted. In an extreme case, it could also be potentially unlocked by virDomainObjFree, thus left open to modification by anyone else who would have otherwise waited for the lock (not to mention the fact that they would be accessing freed data!). The solution is to have qemuMonitorFree lock the domain object right before unrefing it. Since the caller to qemuMonitorFree doesn't expect this lock to be held, if the refcount doesn't go all the way to 0, qemuMonitorFree must unlock it after the unref.
-
由 Matthias Bolte 提交于
Passwords are allowed to contain <, >, &, ', " characters. Those need to be replaced by the corresponding entities. Reported by Hereward Cooper.
-
- 03 3月, 2011 4 次提交
-
-
由 Eric Blake 提交于
In virFileOperation, the parent does a fallback to a non-fork attempt if it detects that the child returned EACCES. However, the child was calling _exit(-EACCES), which does _not_ appear as EACCES in the parent. * src/util/util.c (virFileOperation): Correctly pass EACCES from child to parent.
-
由 Soren Hansen 提交于
virSecurityDAC{Set,Restore}ChardevCallback expect virSecurityManagerPtr, but are passed virDomainObjPtr instead. This makes virSecurityDACSetChardevLabel set a wrong uid/gid on chardevs. This patch fixes this behaviour. Signed-off-by: NSoren Hansen <soren@linux2go.dk>
-
由 Jiri Denemark 提交于
This fixes a possible crash of libvirtd during its startup. When qemu driver reconnects to running domains, it iterates over all domain objects in a hash. When reconnecting to an associated qemu monitor fails and the domain is transient, it's immediately removed from the hash. Despite the fact that it's explicitly forbidden to do so. If libvirtd is lucky enough, virHashForEach will access random memory when the callback finishes and the deamon will crash. Since it's trivial to fix virHashForEach to allow removal of hash entries while iterating through them, I went this way instead of fixing qemuReconnectDomain callback (and possibly others) to avoid deleting the entries.
-
由 Daniel P. Berrange 提交于
Replace the 'Unknown failure' error message with something a little bit more descriptive. * src/util/virterror.c: Improve error message
-
- 02 3月, 2011 2 次提交
-
-
由 Eric Blake 提交于
qemudDomainSaveImageStartVM was evil - it closed the incoming fd argument on some, but not all, code paths, without informing the caller about that action. No wonder that this resulted in double-closes: https://bugzilla.redhat.com/show_bug.cgi?id=672725 * src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Alter signature, to avoid double-close. (qemudDomainRestore, qemudDomainObjRestore): Update callers.
-
由 Daniel P. Berrange 提交于
Followup to commit 2222bd24
-
- 01 3月, 2011 1 次提交
-
-
由 Eric Blake 提交于
When a SPICE or VNC graphics controller is present, and sound is piggybacked over a channel to the graphics device rather than directly accessing host hardware, then there is no need to grant host hardware access to that qemu process. * src/qemu/qemu_cgroup.c (qemuSetupCgroup): Prevent sound with spice, and with vnc when vnc_allow_host_audio is 0. Reported by Daniel Berrange.
-
- 28 2月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The kill() function doesn't exist on Win32, so it needs to be checked for at build time & code disabled in cgroups * configure.ac: Check for kill() * src/util/cgroup.c: Stub out virCGroupKill* functions when kill() isn't available
-
- 26 2月, 2011 2 次提交
-
-
由 Michal Novotny 提交于
this is the patch to add support for multiple serial ports to the libvirt Xen driver. It support both old style (serial = "pty") and new style (serial = [ "/dev/ttyS0", "/dev/ttyS1" ]) definition and tests for xml2sexpr, sexpr2xml and xmconfig have been added as well. Written and tested on RHEL-5 Xen dom0 and working as designed but the Xen version have to have patch for RHBZ #614004 but this patch is for upstream version of libvirt. Also, this patch is addressing issue described in RHBZ #670789. Signed-off-by: NMichal Novotny <minovotn@redhat.com>
-
由 Michal Novotny 提交于
this is the patch to fix the virDomainChrDefParseTargetXML() functionality to parse the target port from XML if available. This is necessary for multiple serial port support which is the second part of this patch. Signed-off-by: NMichal Novotny <minovotn@redhat.com>
-
- 25 2月, 2011 6 次提交
-
-
由 Daniel P. Berrange 提交于
The virCgroupKill method kills all PIDs found in a cgroup The virCgroupKillRecursively method does this recursively for child cgroups. The virCgroupKillPainfully method does a recursive kill several times in a row until everything has really died
-
由 Daniel P. Berrange 提交于
Relax the restriction that the hash table key must be a string by allowing an arbitrary hash code generator + comparison func to be provided * util/hash.c, util/hash.h: Allow any pointer as a key * internal.h: Include stdbool.h as standard. * conf/domain_conf.c, conf/domain_conf.c, conf/nwfilter_params.c, nwfilter/nwfilter_gentech_driver.c, nwfilter/nwfilter_gentech_driver.h, nwfilter/nwfilter_learnipaddr.c, qemu/qemu_command.c, qemu/qemu_driver.c, qemu/qemu_process.c, uml/uml_driver.c, xen/xm_internal.c: s/char */void */ in hash callbacks
-
由 Daniel P. Berrange 提交于
Since the deallocator is passed into the constructor of a hash table it is not desirable to pass it into each function again. Remove it from all functions, but provide a virHashSteal to allow a item to be removed from a hash table without deleteing it. * src/util/hash.c, src/util/hash.h: Remove deallocator param from all functions. Add virHashSteal * src/libvirt_private.syms: Add virHashSteal * src/conf/domain_conf.c, src/conf/nwfilter_params.c, src/nwfilter/nwfilter_learnipaddr.c, src/qemu/qemu_command.c, src/xen/xm_internal.c: Update for changed hash API
-
由 Philipp Hahn 提交于
Replace wrong "set" by correct "seek" in error message. Signed-off-by: NPhilipp Hahn <hahn@univention.de>
-
由 Eric Blake 提交于
* src/qemu/qemu_audit.h (qemuDomainHostdevAudit): New prototype. * src/qemu/qemu_audit.c (qemuDomainHostdevAudit): New function. (qemuDomainStartAudit): Call as appropriate. * src/qemu/qemu_hotplug.c (qemuDomainAttachHostPciDevice) (qemuDomainAttachHostUsbDevice, qemuDomainDetachHostPciDevice) (qemuDomainDetachHostUsbDevice): Likewise.
-
由 Eric Blake 提交于
* src/qemu/qemu_audit.h (qemuDomainMemoryAudit) (qemuDomainVcpuAudit): New prototypes. * src/qemu/qemu_audit.c (qemuDomainResourceAudit) (qemuDomainMemoryAudit, qemuDomainVcpuAudit): New functions. (qemuDomainStartAudit): Call as appropriate. * src/qemu/qemu_driver.c (qemudDomainSetMemory) (qemudDomainHotplugVcpus): Likewise.
-