From patchwork Wed Apr 10 18:29:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162035 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6527247jan; Wed, 10 Apr 2019 11:30:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqypaecgeq0vjsPIwWppvlLt1QWehdJ7E01lztgfx4G972oHwjx22dp1wsds4yLFSMyuil64 X-Received: by 2002:a0c:9666:: with SMTP id 35mr36514314qvy.30.1554921010353; Wed, 10 Apr 2019 11:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554921010; cv=none; d=google.com; s=arc-20160816; b=BITPyh4UpuyVnWBXBIlEz3OMW8VW2iUCdcMGFU2CndXMYwif1OduPl1CK6ifnaWq3F M2uFaZw7BNv3ex19RGVTBUWRL7OVqxWaZ5CoqGWIsbPeXOb+Q2h8WW8it9ic4AIsqSQl CRlvXxkieAC6pOaVrKTfvrcHHE3ab9x77pb+KUNjlgyoOj+tPG4EY8NeACJFrAKPWTAu GLxF522JzQl6/6yl9xb+01v/0JcFCpflV8ULrsbAhP2LBsLlXI2NrojETYyeaxdzDwxY k9DqiWihtG8fre+jNxFXnq7Faru9e7FBVpIj1wL/fCZUKnT5o0+nFCM//UvhWwQPAkcd KmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=HCmpm8gZd5AC1boo2myBuRvGrG+ypFh+kojBXdIbw9Q=; b=KuhgMMObc7gs9y0vFlqCtVEshzgRNSq8N9xnajC8xEMmhudezUye2CBaeu9cb54rJo lwt65qWsqTqVA3KvRQasUmZq28XiLl2CPhgesmwCiCh2xcL5c+MnIrhOfhRG6QwOtL/v Tyoi9gaGcGacG2H2re0QS1jAub8HtDge9O59mh6BRJKN3YvmoS/uRyrXOy7ee7fDH4xt qnQu1OdCuuP7igv5rO6fV1MtlwCSyPbslmR/RxczEG9JmMHXpJ7CyVQqkc0dq5kZ5Kxk 6eZ2S40sEuWT4DzYhpZwykYWdhZGMVetsLeF9rnQz1Tf3yqkqXDoFvMh3Kc7OhV39MTs /4XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id v136si1572950qkb.162.2019.04.10.11.30.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 11:30:10 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A963D3089EC3; Wed, 10 Apr 2019 18:30:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B6DD5B6A3; Wed, 10 Apr 2019 18:30:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F0D80181AC8E; Wed, 10 Apr 2019 18:30:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3AITkYv002693 for ; Wed, 10 Apr 2019 14:29:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3CD21A915; Wed, 10 Apr 2019 18:29:46 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-233.rdu2.redhat.com [10.10.123.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BE8019C6F; Wed, 10 Apr 2019 18:29:46 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 10 Apr 2019 14:29:35 -0400 Message-Id: <05fe015e52f81def27c444ae323242d502bdf033.1554919494.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: monitor: cleanup loadvm error handling X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 10 Apr 2019 18:30:09 +0000 (UTC) Drop redundant NULL checks, add error string prefixes, consolidate a few indentical reports. Signed-off-by: Cole Robinson --- src/qemu/qemu_monitor_text.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 0b2c1a6aed..414da0ca28 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -215,28 +215,25 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) if (qemuMonitorHMPCommand(mon, cmd, &reply)) goto cleanup; - if (strstr(reply, "No block device supports snapshots") != NULL) { + if (strstr(reply, "No block device supports snapshots")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("this domain does not have a device to load snapshots")); goto cleanup; - } else if (strstr(reply, "Could not find snapshot") != NULL) { + } else if (strstr(reply, "Could not find snapshot")) { virReportError(VIR_ERR_OPERATION_INVALID, _("the snapshot '%s' does not exist, and was not loaded"), name); goto cleanup; - } else if (strstr(reply, "Snapshots not supported on device") != NULL) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); - goto cleanup; - } else if (strstr(reply, "Could not open VM state file") != NULL) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); - goto cleanup; - } else if (strstr(reply, "Error") != NULL - && strstr(reply, "while loading VM state") != NULL) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + } else if (strstr(reply, "Snapshots not supported on device")) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("Failed to load snapshot: %s"), reply); goto cleanup; - } else if (strstr(reply, "Error") != NULL - && strstr(reply, "while activating snapshot on") != NULL) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + } else if (strstr(reply, "Could not open VM state file") || + (strstr(reply, "Error") && + (strstr(reply, "while loading VM state") || + strstr(reply, "while activating snapshot on")))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to load snapshot: %s"), reply); goto cleanup; } From patchwork Wed Apr 10 18:29:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162037 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6528097jan; Wed, 10 Apr 2019 11:31:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyPvTzB9QAsZGDUaoC0qumONYFK3fVIFx7/JY18GRbKhnzhh4L7VBrSHNfE5U0LJQ7yNsV X-Received: by 2002:a0c:c988:: with SMTP id b8mr36358259qvk.33.1554921065885; Wed, 10 Apr 2019 11:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554921065; cv=none; d=google.com; s=arc-20160816; b=tJHEjYdau5K6GA2TFgneoBhshG9ki4ZFJmc6/gZVdc6TqmZ3eZ3OXfv3tCZH5fCoWk 6XK/noErI2xkEr4aarYZfnYFtqADXpa8WB0DTFZ0hMBewdvWVjusbWWhcgRWHdxMTers E+3Mp0MWkSf0TVzh9dtD7P3cm/hikOT3SqVHZrfZzMcEQja2yJD90j5Bs8fDe/r0Zs+Y yoIPe/rZdrTiIh7XmqHrMKeNTtDR53Hi3FntXbwLL6x6a/feAJ9tdwijh7riQc/NVbwr ZAVvlVuBK+EvB1/HD5b6xjIFi1CPyxm5txnTXWwpRDpp2JA1auBK3QvKvjS2wGFvh+vb k97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=x6fPR+gvwT8I5iI4oN5/FIUECEJtGz++SSBkH2TSRHo=; b=JzTxTs/Gdvr8hg2XqsMTkt9HV6aUK/qz98QCMBWBw8raQp8UZN6aqa6M8PUfOnZ13B ociNfEthgBpygVC9yIoNgfRO9war/JQAz1HhZqnTqW24f40JJaEUW7IAzKU1Z3iXzacu +tlpyCNVR9Cn/REMvnQZ5GBxiTEWnxDgqLobe/a4cd3NmHjZCjuRZJSZEdAOMzkHqwKD 72PiD7c1RT46S5d0CXE//kzk194hgVH0h/99VJuVPpfPWaPbDMjgyW3ds7lXhh+9ROPD Fb+BR+OOKahg6sSwd2O4UU6ttGz8+OLnat3Xm0Ez57ZlNWN/QMhQCzMicxtvBmruK/DQ sXfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id a2si3983945qkl.123.2019.04.10.11.31.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 11:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CCB241104; Wed, 10 Apr 2019 18:31:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF8D718258; Wed, 10 Apr 2019 18:31:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3EDA0181AC45; Wed, 10 Apr 2019 18:31:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3AITlrs002702 for ; Wed, 10 Apr 2019 14:29:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 791E71A915; Wed, 10 Apr 2019 18:29:47 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-233.rdu2.redhat.com [10.10.123.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 117BC19C6F; Wed, 10 Apr 2019 18:29:46 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 10 Apr 2019 14:29:36 -0400 Message-Id: <3dca227ff69081be71af1c52ac6283798fd50d24.1554919494.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: monitor cleanup delvm error handling X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 10 Apr 2019 18:31:04 +0000 (UTC) Drop redundant NULL checks, and add an error string prefix Signed-off-by: Cole Robinson --- src/qemu/qemu_monitor_text.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 414da0ca28..76095674ab 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -259,16 +259,17 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name) if (qemuMonitorHMPCommand(mon, cmd, &reply)) goto cleanup; - if (strstr(reply, "No block device supports snapshots") != NULL) { + if (strstr(reply, "No block device supports snapshots")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("this domain does not have a device to delete snapshots")); goto cleanup; - } else if (strstr(reply, "Snapshots not supported on device") != NULL) { + } else if (strstr(reply, "Snapshots not supported on device")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); goto cleanup; - } else if (strstr(reply, "Error") != NULL - && strstr(reply, "while deleting snapshot") != NULL) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + } else if (strstr(reply, "Error") && + strstr(reply, "while deleting snapshot")) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to delete snapshot: %s"), reply); goto cleanup; } From patchwork Wed Apr 10 18:29:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162036 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6527347jan; Wed, 10 Apr 2019 11:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwroVLu9GhL1FyjH8/oL65AqmWNSN1jrsigBuk+H6rFtZT3h8E7B+KQ577RwS0rOrjvfc03 X-Received: by 2002:a0c:d25a:: with SMTP id o26mr36358167qvh.78.1554921015608; Wed, 10 Apr 2019 11:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554921015; cv=none; d=google.com; s=arc-20160816; b=osR1jcHqK8xL75SeEP7kM4rLt9ZZnWUmbUMjLtzOiVCHWiFD4CkZ/6Aj3D4Wkd41YP /Yrvtvm4ihuRodZqKv3UKurh8Xy/qCw5Yg+GN8tyjmqa20OnLfGzno986nYpYst6axwe 5nDU5UZAYSPEGnRikflRJ9gceKT47r3F8xzVoc1nuLJWDsQXGA0BB9jozjhw1UmvF4EX 3qjvcKp4dvyPd7USX1Wkc+5vXlsHIXxtpDpoIqXCj/kOJ7U8taQtBS27lLd5jllpJiHn KvP3jSiqaJPYcEhUN/VeYFoMS2odtS+QbPsj5DZNvjZRHyPjJL/kuiuISph9eKJPeiw9 RuVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=2Vx/GXJu6COG5ObIPc0RDt31i4xbcijEDds2V63tNRQ=; b=lMloQdrti/0PqWtV5TI+Nja4YyC17MqXFypPHi7R7Y6CjH9ZyCHLKahqguwH8YLArY yxj7jB6uqV+iMMxJWrP3ES2xmbastrNxgfesEhXPmvgoK4kYaHpHdyK8/Vesji7yjmP9 IVpAiamadzLolGIEfb3dxUpwcq6/N/ETsaYD5oSpyHeTH8RGjHVNolYNhhHL6Z4itUG3 HkWOmKzHucMf8o2utGJij7XZAhHYyqBOllmu5b0uyQ4fR+HIgkip8my/W18ycLaG/fEd OZ5egajPLrcuIS+rkHLrnDfNZ9N+9VXY5dOegs9Mh9DBUCvC7guSBMJ8beyPaXE5uHG6 wpVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 11si703816qvl.102.2019.04.10.11.30.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 11:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B16288AAD; Wed, 10 Apr 2019 18:30:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2554D19814; Wed, 10 Apr 2019 18:30:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 84FEB181AC8F; Wed, 10 Apr 2019 18:30:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3AITm7w002713 for ; Wed, 10 Apr 2019 14:29:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1D3FF1A915; Wed, 10 Apr 2019 18:29:48 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-233.rdu2.redhat.com [10.10.123.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8F1F19C6F; Wed, 10 Apr 2019 18:29:47 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 10 Apr 2019 14:29:37 -0400 Message-Id: <894724dd2d3f282f41cbc828dfbb7aa5d0812599.1554919494.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: monitor: check for common 'Error: ' string X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 10 Apr 2019 18:30:14 +0000 (UTC) qemu 4.0.0 will prefix most errors with 'Error: ', so consider any string instance of that an error. This fixes savevm failure detection when migration is blocked due to usage of nested VMX https://bugzilla.redhat.com/show_bug.cgi?id=1697997 Signed-off-by: Cole Robinson --- src/qemu/qemu_monitor_text.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 76095674ab..280cc58840 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -182,6 +182,7 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, if (strstr(reply, "Error while creating snapshot") || strstr(reply, "Could not open VM state file") || strstr(reply, "State blocked by non-migratable device") || + strstr(reply, "Error: ") || (strstr(reply, "Error") && strstr(reply, "while writing VM"))) { virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to take snapshot: %s"), reply); @@ -229,6 +230,7 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) _("Failed to load snapshot: %s"), reply); goto cleanup; } else if (strstr(reply, "Could not open VM state file") || + strstr(reply, "Error: ") || (strstr(reply, "Error") && (strstr(reply, "while loading VM state") || strstr(reply, "while activating snapshot on")))) { @@ -266,8 +268,9 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name) } else if (strstr(reply, "Snapshots not supported on device")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); goto cleanup; - } else if (strstr(reply, "Error") && - strstr(reply, "while deleting snapshot")) { + } else if (strstr(reply, "Error: ") || + (strstr(reply, "Error") && + strstr(reply, "while deleting snapshot"))) { virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to delete snapshot: %s"), reply); goto cleanup;