From nobody Mon Feb 9 04:12:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1531265720900107.69980308692413; Tue, 10 Jul 2018 16:35:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6040030832E8; Tue, 10 Jul 2018 23:35:19 +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 2385E1084380; Tue, 10 Jul 2018 23:35:19 +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 B4D5818037F2; Tue, 10 Jul 2018 23:35:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6ANYxCC003965 for ; Tue, 10 Jul 2018 19:34:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2B23C30012C2; Tue, 10 Jul 2018 23:34:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F6683001A47; Tue, 10 Jul 2018 23:34:57 +0000 (UTC) Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B53CE307D844; Tue, 10 Jul 2018 23:34:46 +0000 (UTC) Received: by mail-qk0-f193.google.com with SMTP id c192-v6so12546129qkg.12; Tue, 10 Jul 2018 16:34:46 -0700 (PDT) Received: from localhost.localdomain ([179.185.212.58]) by smtp.gmail.com with ESMTPSA id r185-v6sm7918363qkf.53.2018.07.10.16.34.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 16:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VB7daaSczTpwHgQdc8mrsT99sjrW1dCYPbmBds7ZGVo=; b=Cjuo2xyciCrDKIQgg+X/6ZCRU3M0SXdHCCTypXa1F6E5mogjsIXI91MaRKMnL20CPa /t93p2JliM/uG27S7vStBb+e/hYmF9FFMMmIOuW3omUhtN9IexF0b8wGWjQO/v668eZL nAwftpz/k4aiCJcoQMsGLy8AUTdm+RhotJkDjoda9QB8Ogd1Lf1NL71xozV41kFpzXLx wl3k0OFRmd0SzizQXDEVrMyUeGKPkpVxWMQmRTppmHQ+pTCnAVBG7B7PTz2vVcEvdi6b n6QsZrYcxapNgFr7fO7A2gIFKvjyULeR8D+ojn6Lo9btVKPEzacbWZXQuNkXnDTQFVgP pAAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VB7daaSczTpwHgQdc8mrsT99sjrW1dCYPbmBds7ZGVo=; b=UrnsFTdxHRuzSKILogN0zm0Uh5PX0LYpMhHAnaST7IHSbmqKbRXyrvDom80WaBO80u 5AmtpN55RK3H/ibhHcyXX5svaZygTUodJqfezhwGrF4kGqVh5sXx3ADV5nd41vQSgcM5 TxR8KvCuIGz7xhkAYJtqffKykOSW9kdupqNabcpFtouPLlpGsVPimyyHhg8jYQAwTXfF k6Ec8uBHg5f0qFayTXkfNwKGA4ybheoBxW0ycZuYYUlYdOrs2J4zz02Wyq+LqNOk1iX5 O52Td9nEn2hoYsaLxJcCi38t+5EHXkc0Y37jEzj6L0BH2aLs/BXivGcsiWMWDStHd4wP nxBg== X-Gm-Message-State: APt69E2emaF7guZco19T/YQsCBgRtQGysF+fN5YBB1owntVc/TS76WQu 0xEUBRjUYAYAltOv3OJ6MjBknQ== X-Google-Smtp-Source: AAOMgpflfUpWNvHpQpLPlg06jvs0WtKs/Aiv90YQDIkiQEd1EuiDmprxMqy0/cLcauAxPMCqSwPy4g== X-Received: by 2002:a37:28c4:: with SMTP id o65-v6mr23527100qko.251.1531265685535; Tue, 10 Jul 2018 16:34:45 -0700 (PDT) From: Marcos Paulo de Souza To: libvir-list@redhat.com Date: Tue, 10 Jul 2018 20:30:59 -0300 Message-Id: <20180710233102.28186-3-marcos.souza.org@gmail.com> In-Reply-To: <20180710233102.28186-1-marcos.souza.org@gmail.com> References: <20180710233102.28186-1-marcos.souza.org@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 10 Jul 2018 23:34:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 10 Jul 2018 23:34:46 +0000 (UTC) for IP:'209.85.220.193' DOMAIN:'mail-qk0-f193.google.com' HELO:'mail-qk0-f193.google.com' FROM:'marcos.souza.org@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.220.193 mail-qk0-f193.google.com 209.85.220.193 mail-qk0-f193.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Marcos Paulo de Souza Subject: [libvirt] [PATCH v3 2/5] libvirt.c: Return error when remoteOnly is set but server is empty 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 10 Jul 2018 23:35:20 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Some drivers require a server in order to work, so this flag removes the burden of esach driver to check for an server by doing it in virConnectOpenInternal. Signed-off-by: Marcos Paulo de Souza --- src/libvirt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libvirt.c b/src/libvirt.c index 52f4dd2808..aeb8804714 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1029,6 +1029,13 @@ virConnectOpenInternal(const char *name, VIR_DEBUG("Matching any URI scheme for '%s'", ret->uri ? ret->= uri->scheme : ""); } =20 + /* before starting the new connection, check if the driver only wo= rks + * with a server, and so return an error if the server is missing = */ + if (virConnectDriverTab[i]->remoteOnly && ret->uri && !ret->uri->s= erver) { + virReportError(VIR_ERR_INVALID_ARG, "%s", _("URI is missing th= e server part")); + goto failed; + } + ret->driver =3D virConnectDriverTab[i]->hypervisorDriver; ret->interfaceDriver =3D virConnectDriverTab[i]->interfaceDriver; ret->networkDriver =3D virConnectDriverTab[i]->networkDriver; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list