From: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
To: Uri Lublin <uril-atKUWr5tajBWk0Htik3J/w@public.gmane.org>,
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
Subject: [PATCH] qemu: accept filename for incoming migration
Date: Thu, 9 Aug 2007 16:05:04 -0400 [thread overview]
Message-ID: <11866899043188-git-send-email-jim@jtan.com> (raw)
Extends option syntax to allow "-incoming file://<path>" for
file-based migration.
Signed-off-by: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
---
For some applications (e.g. qemu launched by libvirt) it's much easier
to just pass a filename on the commandline than to feed data via
stdin.
qemu/migration.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/qemu/migration.c b/qemu/migration.c
index 96b0c2f..737bb22 100644
--- a/qemu/migration.c
+++ b/qemu/migration.c
@@ -949,7 +949,15 @@ int migrate_incoming(const char *device)
if (strcmp(device, "stdio") == 0)
ret = migrate_incoming_fd(STDIN_FILENO);
- else if (strstart(device, "tcp://", &ptr)) {
+ else if (strstart(device, "file://", &ptr)) {
+ int fd = open(ptr, O_RDONLY);
+ if (fd < 0) {
+ ret = MIG_STAT_DST_INVALID_PARAMS;
+ } else {
+ ret = migrate_incoming_fd(fd);
+ close(fd);
+ }
+ } else if (strstart(device, "tcp://", &ptr)) {
char *host, *end;
host = strdup(ptr);
end = strchr(host, '/');
--
1.5.3.rc4
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next reply other threads:[~2007-08-09 20:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 20:05 Jim Paris [this message]
[not found] ` <11866899043188-git-send-email-jim-XrPbb/hENzg@public.gmane.org>
2007-08-09 21:46 ` [PATCH] qemu: accept filename for incoming migration Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11866899043188-git-send-email-jim@jtan.com \
--to=jim-xrpbb/henzg@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=uril-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox