- 20 9月, 2016 4 次提交
-
-
由 Nikolay Shirokovskiy 提交于
We can easily handle receiving garbage on sync. We don't have to make client deal with this situation. We just need to resend sync command but this time garbage is not be possible.
-
由 Nikolay Shirokovskiy 提交于
When we wait for sync reply we can receive delayed reply to syncs or commands that were sent erlier. We can safely skip them until we receive sync reply with correct id. There is no much sense report this situation to client. Actually with a bit of "luck" if we involve client into this the play can go on forever: send sync 0, receive sync reply -1, send sync 1, receive reply 0 ...
-
由 Nikolay Shirokovskiy 提交于
After sync is sent we can receive garbare and this is not error. Consider next regular case: 1. libvirtd sends sync 2. qga sends partial sync reply and die 3. libvirtd sends sync 4. qga sends sync reply 5. libvirtd receives garbage (half of first reply and second reply together) We should handle this situation as it is recoverable. Next sync can succeed. Let's report reply is NULL, it will be converted to the VIR_ERR_AGENT_UNSYNCED which signals client to retry.
-
由 Nikolay Shirokovskiy 提交于
Errors in qemuAgentIOProcessLine stop agent IO processing just like any regular IO error, however some of current errors that this functions spawns are false positives. Consider next case for example: 1. send sync (unsynced state) 2. receive sync reply (sync established) 3. command send, but timeout occured (unsynced state) 4. receive command reply Last IO triggers error because current code ignores only delayed syncs when unsynced We should not treat any delayed reply as error in unsynced state. Until client and qga are not in sync delayed reply to any command is possible. msg == NULL is the exact criterion that we are not in sync.
-
- 19 9月, 2016 1 次提交
-
-
由 Chen Hanxiao 提交于
Both qemu monitor and agent print the same log on HUANGUP event, which would be confusing when reading libvirtd log. This patch will give a different log message to them. Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 9月, 2016 1 次提交
-
-
由 Yuri Pudgorodskiy 提交于
A separate error code will help recognize real failures from necessity to try again Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 22 6月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Documentation for the "guest-set-vcpus" command describes a proper algorithm how to set vcpus. This patch makes the following changes: - state of cpus that has not changed is not updated - if the command was partially successful the command is re-tried with the rest of the arguments to get a proper error message - code is more robust against malicious guest agent - fix testsuite to the new semantics
-
- 16 5月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Add a new helper that sanitizes error semantics of base64_encode_alloc.
-
- 02 5月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
We had both and the only difference was that the latter also included information about multifunction setting. The problem with that was that we couldn't use functions made for only one of the structs (e.g. parsing). To consolidate those two structs, use the one in virpci.h, include that in domain_conf.h and add the multifunction member in it. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 15 4月, 2016 1 次提交
-
-
由 Richard W.M. Jones 提交于
In a few places in libvirt we busy-wait for events, for example qemu creating a monitor socket. This is problematic because: - We need to choose a sufficiently small polling period so that libvirt doesn't add unnecessary delays. - We need to choose a sufficiently large polling period so that the effect of busy-waiting doesn't affect the system. The solution to this conflict is to use an exponential backoff. This patch adds two functions to hide the details, and modifies a few places where we currently busy-wait. Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
-
- 11 4月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Replace the nonsensical debug statement by adding the expected event code into the existing debug statement. Since the monitor code always notifies the agent on guest reboot/shutdown even if that was not initiated by the agent the warning emitted later is bogus and pollutes the logs in such cases. Delete it and keep just the original debug message where this info can be inferred.
-
- 15 1月, 2016 1 次提交
-
-
由 Yaniv Kaul 提交于
We have this function qemuAgentNotifyEvent() which is supposed to be called from thread pool responsible for processing qemu monitor events. The function then should wake up other thread that is waiting for a guest to shutdown or reboot. However, if we have received a different error a warning is printed out. This warning lacks info on which event is expected. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 1月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
While this is no functional change, whole channel definition is going to be needed very soon. Moreover, while touching this obey const correctness rule in qemuAgentOpen() - so far it was passed regular pointer to channel config even though the function is expected to not change pointee at all. Pass const pointer instead. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 10月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
The internal representation of a JSON array counts the items in size_t. However, for some reason, when asking for the count it's reported as int. Firstly, we need the function to return a signed type as it's returning -1 on an error. But, not every system has integer the same size as size_t. Therefore, lets return ssize_t. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 01 7月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
While CPU0 was made unpluggable in Linux a while ago it's not desirable to unplug it since some parts of the kernel (suspend-to-ram) still depend on it. This patch fixes the vCPU selection code in libvirt so that it will not be disabled.
-
- 21 5月, 2015 2 次提交
-
-
由 Ján Tomko 提交于
Base-64 encode the password and pass it to the guest agent via the 'guest-set-user-password' command. https://bugzilla.redhat.com/show_bug.cgi?id=1174177
-
由 Jiri Denemark 提交于
Most virDomainDiskIndexByName callers do not care about the index; what they really want is a disk def pointer. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 07 5月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=890648 So, imagine you've issued an API that involves guest agent. For instance, you want to query guest's IP addresses. So the API acquires QUERY_JOB, locks the guest agent and issues the agent command. However, for some reason, guest agent replies to initial ping correctly, but then crashes tragically while executing real command (in this case guest-network-get-interfaces). Since initial ping went well, libvirt thinks guest agent is accessible and awaits reply to the real command. But it will never come. What will is a monitor event. Our handler (processSerialChangedEvent) will try to acquire MODIFY_JOB, which will fail obviously because the other thread that's executing the API already holds a job. So the event handler exits early, and the QUERY_JOB is never released nor ended. The way how to solve this is to put flag somewhere in the monitor internals. The flag is called @running and agent commands are issued iff the flag is set. The flag itself is set when we connect to the agent socket. And unset whenever we see DISCONNECT event from the agent. Moreover, we must wake up all the threads waiting for the agent. This is done by signalizing the condition they're waiting on. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 4月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Since the code is now separated into the common helper, we can reuse it instead of maintaining two copies.
-
- 02 4月, 2015 1 次提交
-
-
由 zhang bo 提交于
When we shutdown/reboot a guest using agent-mode, if the guest itself blocks infinitely, libvirt would block in qemuAgentShutdown() forever. Thus, we set a timeout for shutdown/reboot, from our experience, 60 seconds would be fine. Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com> Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
-
- 18 3月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
Now that we allow HW address to be not present on our RPC layer, don't error out if qemu-ga hasn't provided any. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 3月, 2015 1 次提交
-
-
由 Nehal J Wani 提交于
By querying the qemu guest agent with the QMP command "guest-network-get-interfaces" and converting the received JSON output to structured objects. Although "ifconfig" is deprecated, IP aliases created by "ifconfig" are supported by this API. The legacy syntax of an IP alias is: "<ifname>:<alias-name>". Since we want all aliases to be clubbed under parent interface, simply stripping ":<alias-name>" suffices. Note that IP aliases formed by "ip" aren't visible to "ifconfig", and aliases created by "ip" do not have any specific name. But we are lucky, as qemu guest agent detects aliases created by both. src/qemu/qemu_agent.h: * Define qemuAgentGetInterfaces src/qemu/qemu_agent.c: * Implement qemuAgentGetInterface src/qemu/qemu_driver.c: * New function qemuGetDHCPInterfaces * New function qemuDomainInterfaceAddresses src/remote_protocol-sructs: * Define new structs tests/qemuagenttest.c: * Add new test: testQemuAgentGetInterfaces Test cases for IP aliases, 0 or multiple ipv4/ipv6 address(es) Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
-
- 24 11月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
Get mounted filesystems list, which contains hardware info of disks and its controllers, from QEMU guest agent 2.2+. Then, convert the hardware info to corresponding device aliases for the disks. Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 29 10月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
Not every error message from qemu-ga has to have the 'class' field filled out. For instance, I've seen this error message lately: qemuAgentCheckError:1047 : unable to execute QEMU agent command \ {"execute":"guest-set-time"}: \ {"error":{"desc":"Invalid parameter type, expected: integer"}} However, this got translated into rather generic error message: internal error: unable to execute QEMU agent command 'guest-set-time': unknown QEMU command error So we've dropped better error message in favor of a generic one. This is due to our code which expects 'class' which is not present here. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 8月, 2014 1 次提交
-
-
由 John Ferlan 提交于
Coverity found that on error paths, the 'arg' value wasn't be cleaned up. Followed the example in qemuAgentSetVCPUs() where upon successful call to qemuAgentCommand() the 'cpus' is set to NULL; otherwise, when cleanup occurs the free the memory for 'arg'
-
- 11 8月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
A command to freeze a part of mounted file systems is implemented in upstream QEMU-guest-agent with a name of 'guest-fsfreeze-freeze-list'. This fixes the name of the command used to partial fsfreeze in qemu driver when 'mountpoints' option is specified to virDomainFSFreeze API. Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
-
- 20 5月, 2014 1 次提交
-
-
由 Pavel Hrdina 提交于
Old gcc complains about shadowing 'sync' variable: ../../src/qemu/qemu_agent.c: In function 'qemuAgentSetTime': ../../src/qemu/qemu_agent.c:1737: warning: declaration of 'sync' shadows a global declaration [-Wshadow] /usr/include/unistd.h:464: warning: shadowed declaration is here [-Wshadow] Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 15 5月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
One caveat though, qemu-ga is expecting time and returning time in nanoseconds. With all the buffering and propagation delay, the time is already wrong once it gets to the qemu-ga, but there's nothing we can do about it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 13 5月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
With this patch, virDomainFSFreeze will pass the mountpoints argument to qemu guest agent. For example, virDomainFSFreeze(dom, {"/mnt/vol1", "/mnt/vol2"}, 2, 0) will issue qemu guest agent command: {"execute":"guest-fsfreeze-freeze", "arguments":{"mountpoints":["/mnt/vol1","/mnt/vol2"]}} Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com> Acked-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 03 4月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Commit 5b3492fa aimed to fix this and caught one error but exposed another one. When agent command is being executed and the thread waiting for the reply is woken up by an event (e.g. EOF in case of shutdown), the command finishes with no data (rxObject == NULL), but no error is reported, since this might be desired by the caller (e.g. suspend through agent). However, in other situations, when the data are required (e.g. getting vCPUs), we proceed to getting desired data out of the reply, but none of the virJSON*() functions works well with NULLs. I chose the way of a new parameter for qemuAgentCommand() function that specifies whether reply is required and behaves according to that. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 02 4月, 2014 2 次提交
-
-
由 Martin Kletzander 提交于
by moving qemuAgentCommand() after qemuAgentCheckError(). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
On all the places where qemuAgentComand() was called, we did a check for errors in the reply. Unfortunately, some of the places called qemuAgentCheckError() without checking for non-null reply which might have resulted in a crash. So this patch makes the error-checking part of qemuAgentCommand() itself, which: a) makes it look better, b) makes the check mandatory and, most importantly, c) checks for the errors if and only if it is appropriate. This actually fixes a potential crashers when qemuAgentComand() returned 0, but reply was NULL. Having said that, it *should* fix the following bug: https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 21 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 18 3月, 2014 1 次提交
-
-
由 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>
-
- 10 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Some of these are leftovers from renaming the files, others are just typos. Also introduce an ugly awk script to enforce this.
-
- 05 12月, 2013 1 次提交
-
-
由 Wangyufei (James) 提交于
When an error occurred in qemuAgentIO, it will be saved in mon->lastError, but it will not be freed at the end. Present since commit c160ce33; and compare to commit 9cc8a5af fixing the same problem in qemu_monitor.c. ==22219== 54 bytes in 1 blocks are definitely lost in loss record 982 of 1,379 ==22219== at 0x4C26B9B: malloc (vg_replace_malloc.c:263) ==22219== by 0x8520521: strdup (in /lib64/libc-2.11.3.so) ==22219== by 0x52E99CB: virStrdup (virstring.c:554) ==22219== by 0x52B44C4: virCopyError (virerror.c:195) ==22219== by 0x52B5123: virCopyLastError (virerror.c:312) ==22219== by 0x10905877: qemuAgentIO (qemu_agent.c:660) ==22219== by 0x52B6122: virEventPollDispatchHandles (vireventpoll.c:501) ==22219== by 0x52B7AEA: virEventPollRunOnce (vireventpoll.c:647) ==22219== by 0x52B5C1B: virEventRunDefaultImpl (virevent.c:274) ==22219== by 0x54181FD: virNetServerRun (virnetserver.c:1112) ==22219== by 0x11EF4D: main (libvirtd.c:1513) Signed-off-by: NZhou Yimin <zhouyimin@huawei.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 31 7月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
Most APIs in libvirt report errors, thus no need to state that explicitly.
-
由 Peter Krempa 提交于
To allow testing of the cpu updater function, this function needs to be available separately. Export it from qemu_agent.c where it should belong.
-