From patchwork Wed Jun 22 18:51:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 70681 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp58062qgy; Wed, 22 Jun 2016 11:54:10 -0700 (PDT) X-Received: by 10.176.66.130 with SMTP id j2mr13214973uaj.120.1466621650273; Wed, 22 Jun 2016 11:54:10 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id h1si816077uah.132.2016.06.22.11.54.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 11:54:10 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MIpVkx014731; Wed, 22 Jun 2016 14:51:31 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.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 u5MIpUsi000718 for ; Wed, 22 Jun 2016 14:51:30 -0400 Received: from colepc.redhat.com (ovpn-116-65.rdu2.redhat.com [10.10.116.65]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MIpTY1022838; Wed, 22 Jun 2016 14:51:29 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 22 Jun 2016 14:51:23 -0400 Message-Id: <1412bce0acc777730b58d0ca1fcbdae073f5c1e3.1466621483.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: Remove dead console compat formatting 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com This code was attempting to handle some implicit XML formatting for manually assembled DomainDef, since previously the console<->serial compat copying was only done at XML parse time. Nowadays it's done via virDomainDefPostParse -> virDomainDefAddConsoleCompat, which all manual DomainDef builders already call, so we can drop this workaround. --- src/conf/domain_conf.c | 14 -------------- 1 file changed, 14 deletions(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 75ad03f..6ab7450 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23463,20 +23463,6 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (virDomainChrDefFormat(buf, &console, flags) < 0) goto error; } - /* The back-compat console device stub is added when parsing the domain XML - * and handled above, this is for formatting definitions created via other - * means. - */ - if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && - def->nconsoles == 0 && - def->nserials > 0) { - virDomainChrDef console; - memcpy(&console, def->serials[n], sizeof(console)); - console.deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; - console.targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; - if (virDomainChrDefFormat(buf, &console, flags) < 0) - goto error; - } for (n = 0; n < def->nchannels; n++) if (virDomainChrDefFormat(buf, def->channels[n], flags) < 0)