Remove redundant conditions

All of these have been checked earlier.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-08-02 22:57:29 +02:00
parent bb5a4844ba
commit 1edf164848
7 changed files with 9 additions and 10 deletions

View File

@ -1425,7 +1425,7 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev,
usbsrc->bus, usbsrc->device,
bus, device);
}
} else if (!vendor && bus) {
} else if (bus) {
if (virUSBDeviceFindByBus(bus, device, NULL, mandatory, usb) < 0)
return -1;
}

View File

@ -450,7 +450,7 @@ xenParseXLVnuma(virConfPtr conf,
unsigned long long kbsize = 0;
/* Is there a sublist (vnode)? */
if (list && list->type == VIR_CONF_LIST) {
if (list->type == VIR_CONF_LIST) {
vnode = list->list;
while (vnode && vnode->type == VIR_CONF_STRING) {

View File

@ -4711,8 +4711,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
if (rc == 0 &&
qemuMonitorDelObject(priv->mon, objAlias, true) < 0)
if (qemuMonitorDelObject(priv->mon, objAlias, true) < 0)
rc = -1;
if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD &&

View File

@ -6888,11 +6888,11 @@ qemuProcessLaunch(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Handshake complete, child running");
if (rv == -1) /* The VM failed to start; tear filters before taps */
if (rv == -1) {
/* The VM failed to start; tear filters before taps */
virDomainConfVMNWFilterTeardown(vm);
if (rv == -1) /* The VM failed to start */
goto cleanup;
}
if (qemuDomainObjStartWorker(vm) < 0)
goto cleanup;

View File

@ -687,7 +687,7 @@ int virNetSocketNewConnectUNIX(const char *path,
if (spawnDaemon) {
g_autofree char *binname = NULL;
if (spawnDaemon && !binary) {
if (!binary) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Auto-spawn of daemon requested, "
"but no binary specified"));

View File

@ -244,7 +244,7 @@ virLeaseNew(virJSONValuePtr *lease_ret,
return -1;
if (ip && virJSONValueObjectAppendString(lease_new, "ip-address", ip) < 0)
return -1;
if (mac && virJSONValueObjectAppendString(lease_new, "mac-address", mac) < 0)
if (virJSONValueObjectAppendString(lease_new, "mac-address", mac) < 0)
return -1;
if (hostname && virJSONValueObjectAppendString(lease_new, "hostname", hostname) < 0)
return -1;

View File

@ -1201,7 +1201,7 @@ vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
if (disk->src->readonly) {
gVBoxAPI.UIMedium.SetType(medium, MediumType_Immutable);
VIR_DEBUG("Setting hard disk to immutable");
} else if (!disk->src->readonly) {
} else {
gVBoxAPI.UIMedium.SetType(medium, MediumType_Normal);
VIR_DEBUG("Setting hard disk type to normal");
}