From nobody Sun Feb 8 01:33:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589277178; cv=none; d=zohomail.com; s=zohoarc; b=MEodjPzvYkE5dgGTSQ786AIPlCltT2L4U6nlFVV64KluDbgz9qKpIf8W8Xa5m9YawgtjZUThJwEenavA9xNHzWebi4Eo65UEhUhP1A7yW6COBGLePCv63MYBXUXiyy6UJdYd2j5wh+V4XAVpXeivjeAb8jTg5CGX0fvHGnetSW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589277178; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9H0Mb3vslr+OkycsayrhUi/uh2dXA5d8S7al5jV+9NY=; b=jtYudfvJOE8NFVljyJfHgTVirhD9dwJBkur0NNiuI0qXfMB+KmvY3VZXRXEjC2WzQMVLkgtGl8TKt4ItG77d6QfbyHSX0/zftiW235aSnisU9KFxpra5syppCeUdSlk8nI/f1ImJbVdARkNHnPA/shUsu2Xr0xpc1uW3gVNQLjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1589277178706195.32815870349805; Tue, 12 May 2020 02:52:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-zS4mrQ9kOAq92TnzwKJvXA-1; Tue, 12 May 2020 05:52:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0ED8D475; Tue, 12 May 2020 09:52:49 +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 E053360C05; Tue, 12 May 2020 09:52:48 +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 761821809554; Tue, 12 May 2020 09:52:47 +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 04C9qKZV027320 for ; Tue, 12 May 2020 05:52:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7343D1C94D; Tue, 12 May 2020 09:52:20 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id A513038E; Tue, 12 May 2020 09:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589277177; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9H0Mb3vslr+OkycsayrhUi/uh2dXA5d8S7al5jV+9NY=; b=Cg0HO1ITPg/0K/NriFsE+tOAmeQdziCbMAtEKwAA38cmD+KmddHDGggce5v+VuBzPGcp1U bXh4UHVymKGXGCTPOuu902OMWN4XeKXMs4yDDYoc7eRZmWEIeCIO0rfJENpMy5qFBQcEZ0 yntAO1f5UZAFl0MoNwubTqAKUxSWkFs= X-MC-Unique: zS4mrQ9kOAq92TnzwKJvXA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt-java PATCH 2/6] Add workaround for broken screenshot API on Ubuntu 18.04 vintage Date: Tue, 12 May 2020 10:51:48 +0100 Message-Id: <20200512095152.1194084-3-berrange@redhat.com> In-Reply-To: <20200512095152.1194084-1-berrange@redhat.com> References: <20200512095152.1194084-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Daniel P. Berrang=C3=A9 --- src/test/java/org/libvirt/TestJavaBindings.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/jav= a/org/libvirt/TestJavaBindings.java index 4b55a13..0a3bca0 100644 --- a/src/test/java/org/libvirt/TestJavaBindings.java +++ b/src/test/java/org/libvirt/TestJavaBindings.java @@ -325,7 +325,16 @@ public final class TestJavaBindings extends TestCase { =20 assertFalse("Domain \"test\" not found", dom =3D=3D null); =20 - String mimetype =3D dom.screenshot(str, 0); + String mimetype; + try { + mimetype =3D dom.screenshot(str, 0); + } catch (LibvirtException ex) { + if (ex.getMessage().contains("test-screenshot.png': No such fi= le or directory")) { + System.err.format("testDomainScreenshot skipped (missing p= ng file)"); + return; + } + throw ex; + } =20 ByteBuffer bb =3D ByteBuffer.allocateDirect(8192); =20 --=20 2.26.2