mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-03 12:55:45 +00:00
ch: support serial and console devices in parallel
Starting v18, cloud-hypervisor supports serial and console devices in parallel. Drop related check based on ch version. Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2c1f34a2bb
commit
6be0d1a0d3
@ -142,10 +142,11 @@ virDomainXMLPrivateDataCallbacks virCHDriverPrivateDataCallbacks = {
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
chValidateDomainDeviceDef(const virDomainDeviceDef *dev,
|
chValidateDomainDeviceDef(const virDomainDeviceDef *dev,
|
||||||
const virDomainDef *def G_GNUC_UNUSED,
|
const virDomainDef *def,
|
||||||
void *opaque G_GNUC_UNUSED,
|
void *opaque,
|
||||||
void *parseOpaque G_GNUC_UNUSED)
|
void *parseOpaque G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
|
virCHDriver *driver = opaque;
|
||||||
switch (dev->type) {
|
switch (dev->type) {
|
||||||
case VIR_DOMAIN_DEVICE_DISK:
|
case VIR_DOMAIN_DEVICE_DISK:
|
||||||
case VIR_DOMAIN_DEVICE_NET:
|
case VIR_DOMAIN_DEVICE_NET:
|
||||||
@ -191,18 +192,25 @@ chValidateDomainDeviceDef(const virDomainDeviceDef *dev,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((def->nconsoles &&
|
if (!virBitmapIsBitSet(driver->chCaps, CH_SERIAL_CONSOLE_IN_PARALLEL)) {
|
||||||
def->consoles[0]->source->type == VIR_DOMAIN_CHR_TYPE_PTY)
|
if ((def->nconsoles &&
|
||||||
&& (def->nserials &&
|
def->consoles[0]->source->type == VIR_DOMAIN_CHR_TYPE_PTY)
|
||||||
def->serials[0]->source->type == VIR_DOMAIN_CHR_TYPE_PTY)) {
|
&& (def->nserials &&
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
def->serials[0]->source->type == VIR_DOMAIN_CHR_TYPE_PTY)) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Only a single console or serial can be configured for this domain"));
|
_("Only a single console or serial can be configured for this domain"));
|
||||||
return -1;
|
return -1;
|
||||||
} else if (def->nconsoles > 1) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (def->nconsoles > 1) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Only a single console can be configured for this domain"));
|
_("Only a single console can be configured for this domain"));
|
||||||
return -1;
|
return -1;
|
||||||
} else if (def->nserials > 1) {
|
}
|
||||||
|
|
||||||
|
if (def->nserials > 1) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Only a single serial can be configured for this domain"));
|
_("Only a single serial can be configured for this domain"));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user