- 11 2月, 2020 21 次提交
-
-
由 Peter Krempa 提交于
Since we parse attributes for 'raw' which is a format driver and thus has nested 'file' structure we must prevent that this isn't nested arbitrarily. Add a flag for the function which allows parsing of 'format' type drivers only on the first pass. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
There are two possibilities: 1) json:{"file":{"driver":...}} 2) json:{"driver":...} Our code didn't work properly with the second one as it was expecting the 'file' wrapper. Conditionalize the removal to only the situation when the top level doesn't have "driver". Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The parser was originally designed only for protocol parsers. Since we already have 'raw' format driver in the list we'll need to be able to parse it too. In later patches this will be used to prevent parsing nested format drivers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Originally virStorageSourceParseBackingJSON didn't recurse, but when the 'raw' driver support was added we need to parse it's information which contains nested 'file' object. Since the deflattening helper recurses already there's no need to call it again. Move it one level up to the entry point. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
There are a few error messages which might want to report the original backing store string. Pass it around rather than trying to re-generate it. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
My original implementation was completely broken because it attempted to use object-add/del instead of blockdev-add/del. https://bugzilla.redhat.com/show_bug.cgi?id=1798366Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Peter Krempa 提交于
Modify qemuMonitorBlockdevAdd so that it takes a double pointer for the @props argument so that it's cleared inside the call. This allows writing cleaner callers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Peter Krempa 提交于
Use automatic variable freeing and get rid of the cleanup section. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Peter Krempa 提交于
Use automatic variable freeing and get rid of the cleanup section. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Peter Krempa 提交于
Now that we accept full backing chains on input nothing should prevent users from also using disk type 'VOLUME' for specifying the backing images. Do the translation for the whole backing chain. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Extract all the code setting up one storage source from the rest which sets up the whole disk. This will allow us to prepare the whole backing chain. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Only 'def->src' was ever used in this function. Use the source directly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Only 'def->src' was ever used in this function. Use the source directly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Only 'def->src' was ever used in this function. Use the source directly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Use virStringSplitCount instead of virStringSplit so that we can drop the call to virStringListLength and use VIR_AUTOSTRINGLIST to declare it and allow removal of the cleanup section. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Few switch cases returned failure but didn't report an error. For a situation when the backingStore type='volume' was not translated the following error would occur: $ virsh start VM error: Failed to start domain VM error: An error occurred, but the cause is unknown After this patch: $ virsh start VM error: Failed to start domain VM error: internal error: storage source pool 'tmp' volume 'pull3.qcow2' is not translated Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Simplify gathering the actual return value from a passed-through QMP command when using 'qemu-monitor-command' by adding '--return-value' switch which just extracts the 'return' section and alternatively reports an error if the section is not present. This simplifies gathering of some test data where the full reply would need to be trimmed just for the actual return value. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Mention that we actually by default use QMP and clarify the rest of the documentation. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
- 10 2月, 2020 2 次提交
-
-
由 Ján Tomko 提交于
We call APIs that reset the error in the rollback code. Preserve the error from the original call that failed. This turns the boringly cryptic: error: Unable to set interface parameters error: An error occurred, but the cause is unknown to the unexpectedly anarchist: error: internal error: Child process (/usr/sbin/tc filter add dev vnet1 parent ffff: protocol all u32 match u32 0 0 police rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1) unexpected exit status 1: Illegal "rate" Illegal "police" Signed-off-by: NJán Tomko <jtomko@redhat.com> Fixes: f02e21cb https://bugzilla.redhat.com/show_bug.cgi?id=1800505Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Otherwise an attempt to set an invalid value: virsh domiftune rhel8.2 vnet0 --outbound 4294968 on an interface with no bandwidth set crashes. Signed-off-by: NJán Tomko <jtomko@redhat.com> Fixes: f02e21cb https://bugzilla.redhat.com/show_bug.cgi?id=1800505Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 09 2月, 2020 1 次提交
-
-
由 Ján Tomko 提交于
When debugging test failures in seven independent test cases, it might be helpful to only gather the debug output of the failing cases. Record the indexes of the tests that fail and print them in the VIR_TEST_RANGE of the command line that will result in only those tests being run. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 2月, 2020 13 次提交
-
-
由 Daniel P. Berrangé 提交于
This deletes all trace of gnulib from libvirt. We still have the keycodemapdb submodule to deal with. The simple solution taken was to update it when running autogen.sh. Previously gnulib could auto-trigger refresh when running 'make' too. We could figure out a solution for this, but with the pending meson rewrite it isn't worth worrying about, given how infrequently keycodemapdb changes. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
It is no longer require since switching to the GLib based event loop impl. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
This sets the GLib event loop as the impl when calling virEventRegisterDefaultImpl(). This remains a private impl detail of libvirt, so applications must *NOT* assume that a call to virEventRegisterDefaultImpl() results in a GLib based event loop. They should continue to use the libvirt-glib API gvir_event_register() if they explicitly want to guarantee a GLib event loop. This follows the general principal that the libvirt public API should not expose the fact that GLib is being used internally. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The libvirt-glib project has provided a GMainContext based event loop impl for applications. This imports it and sets it up for use by libvirt as the primary event loop. This remains a private impl detail of libvirt. IOW, applications must *NOT* assume that a call to "virEventRegisterDefaultImpl" results in a GLib based event loop. They should continue to use the libvirt-glib API gvir_event_register() if they explicitly want to guarantee a GLib event loop. This follows the general principle that the libvirt public API should not expose the fact that GLib is being used internally. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
To eliminate the dependancy on GNULIB's poll impl, we need to change the RPC client code to use GMainLoop. We don't really want to use GIOChannel, but it provides the most convenient way to do socket event watches with Windows portability. The other alternative would be to use GSocket but that is a much more complex change affecting libvirt more broadly. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
We need to be able to create event loop watches using the GSource API for sockets. GIOChannel is able todo this, but we don't want to use the GIOChannel APIs for reading/writing, and testing shows just using its GSource APIs is unreliable on Windows. This patch thus creates a standalone helper API for creating a GSource for a socket file descriptor. This impl is derived from code in QEMU's io/channel-watch.c file that was written by myself & Paolo Bonzini & thus under Red Hat copyright. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
For long running jobs (save, managed save, dump & live migrate) virsh runs a background thread for executing the job and then has the main thread catch Ctrl-C for graceful shutdown, as well as displaying progress info. The monitoring code is written using poll, with a pipe used to get the completion status from the thread. Using a pipe and poll is problematic for Windows portability. This rewrites the code to use a GMainLoop instance for monitoring stdin and doing progress updates. The use of a pipe is entirely eliminated, instead there is just a shared variable between both threads containing the job completion status. No mutex locking is used because the background thread writes to the variable only when the main loop is still running, while the foreground thread only reads it after the main loop has exited. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The contents of 'struct dirent' are only valid until the next call to readdir() or closedir(). It is thus invalid to save a pointer to the 'd_name' field. Somehow this hasn't affected the test suite until recently when FreeBSD 12 started showing use of uninitialized memory resulting in test failures. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 zhenwei pi 提交于
Pvpanic device supports bit 1 as crashloaded event, it means that guest actually panicked and run kexec to handle error by guest side. Handle crashloaded as a lifecyle event in libvirt. Test case: Guest side: before testing, we need make sure kdump is enabled, 1, build new pvpanic driver (with commit from upstream e0b9a42735f2672ca2764cfbea6e55a81098d5ba 191941692a3d1b6a9614502b279be062926b70f5) 2, insmod new kmod 3, enable crash_kexec_post_notifiers, # echo 1 > /sys/module/kernel/parameters/crash_kexec_post_notifiers 4, trigger kernel panic # echo 1 > /proc/sys/kernel/sysrq # echo c > /proc/sysrq-trigger Host side: 1, build new qemu with pvpanic patches (with commit from upstream 600d7b47e8f5085919fd1d1157f25950ea8dbc11 7dc58deea79a343ac3adc5cadb97215086054c86) 2, build libvirt with this patch 3, handle lifecycle event and trigger guest side panic # virsh event stretch --event lifecycle event 'lifecycle' for domain stretch: Crashed Crashloaded events received: 1 Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: Nzhenwei pi <pizhenwei@bytedance.com>
-
由 Daniel P. Berrangé 提交于
When using ``....`` in RST, this results in <span class="literal">...</span> instead of <code>...</code>. We thus need an extra rule to render it with a monospace font. Colouring a light gray also helps the text stand out a little more and matches background of <pre> blocks. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jiri Denemark 提交于
Starting a KVM domain on s390 with old machine type (such as s390-ccw-virtio-2.5) and without any guest CPU model configured fails with CPU models are not available: KVM doesn't support CPU models QEMU error. This is cause by libvirt using host-model CPU as the default CPU based on QEMU reporting "host" CPU model as being the default one (see commit v5.9.0-402-g24d82022: qemu: Use host-model CPU on s390 by default). However, even though both QEMU and KVM support CPU models on s390 and QEMU can give us the host-model CPU, we can't use it with old machine types which only support -cpu host. https://bugzilla.redhat.com/show_bug.cgi?id=1795651Reported-by: NChristian Ehrhardt <paelzer@gmail.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Jiri Denemark 提交于
Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Jiri Denemark 提交于
The usability of a specific CPU mode may depend on machine type, let's prepare for this by passing it to virQEMUCapsIsCPUModeSupported. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 06 2月, 2020 3 次提交
-
-
由 Julio Faracco 提交于
After LXC version 3, some settings were changed to new names. Same as network. LXC introduced network indexes and changed IPv{4,6} addresses fields. Before, users should only pass `lxc.network.ipv4` to define an IPv4 address. Now, on version 3, users need to pass `lxc.net.X.ipv4.address` to specify the same thing. Same for IPv6. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Julio Faracco 提交于
To configure network settings using config file, legacy LXC settings require starting them with 'lxc.network.type' entry. If someone accidentally starts with 'lxc.network.name', libvirt will crash with segfault. This patch checks if this case is happening. Sample invalid settings: lxc.network.link = eth0 lxc.network.type = phys lxc.network.name = eth1 lxc.network.ipv4 = 192.168.122.2/24 lxc.network.ipv4.gateway = 192.168.122.1 Now, libvirt only see error without segmentation fault. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Pavel Hrdina 提交于
There is a race deadlock in eventtest after the recent rewrite to drop GNULIB from libvirt code base. The issue happens when the callbacks testPipeReader() or testTimer() are called before waitEvents() starts waiting on `eventThreadCond`. It will never happen because the callbacks are already done and there is nothing that will signal the condition again. Reported-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-