From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Paris Subject: [PATCH] qemu: accept filename for incoming migration Date: Thu, 9 Aug 2007 16:05:04 -0400 Message-ID: <11866899043188-git-send-email-jim@jtan.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jim Paris To: Uri Lublin , kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Extends option syntax to allow "-incoming file://" for file-based migration. Signed-off-by: Jim Paris --- 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/