<div dir="ltr">Opssss... Python feelings!<br><br><div class="gmail_extra"><div class="gmail_quote">2017-11-23 14:50 GMT-02:00 Ján Tomko <span dir="ltr"><<a href="mailto:jtomko@redhat.com" target="_blank">jtomko@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Nov 17, 2017 at 07:27:41PM -0200, Julio Faracco wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
The tag backend is not supported for user/direct/hostdev network when you<br>
try to define them inside the domain XML. So, other ways to include devices<br>
cannot be permitted too. But the attach-device command is wrongly adding<br>
unsupported features. This commit fixes this bug.<br>
<br>
After the patch:<br>
<br>
virsh # attach-device rhel7.4 backend.xml<br>
error: Failed to attach device from backend.xml<br>
error: unsupported configuration: Custom tap device path is not supported for: user<br>
<br>
Resolves: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1480251" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/sh<wbr>ow_bug.cgi?id=1480251</a><br>
<br>
Signed-off-by: Julio Faracco <<a href="mailto:jcfaracco@gmail.com" target="_blank">jcfaracco@gmail.com</a>><br>
---<br>
src/qemu/qemu_domain.c | 15 +++++++++++++++<br>
1 file changed, 15 insertions(+)<br>
<br>
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c<br>
index cc7596b..0215b2a 100644<br>
--- a/src/qemu/qemu_domain.c<br>
+++ b/src/qemu/qemu_domain.c<br></span><span class="">
@@ -3649,6 +3656,14 @@ qemuDomainDeviceDefValidate(co<wbr>nst virDomainDeviceDef *dev,<br>
                    }<br>
                }<br>
            }<br>
+        } else if (net->type == VIR_DOMAIN_NET_TYPE_DIRECT ||<br>
+                   net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {<br>
+            if (net->backend.tap) {<br>
+                virReportError(VIR_ERR_CONFIG_<wbr>UNSUPPORTED,<br>
+                               _("Custom tap device path is not supported for: %s"),<br>
+                               virDomainNetTypeToString(net-<wbr>>type));<br>
+                goto cleanup;<br>
+            }<br>
</span></blockquote>
<br>
Adding this 'else if' clause means that the following check is no longer<br>
executed for TYPE_DIRECT and TYPE_HOSTDEV:<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        } else if (net->guestIP.nroutes || net->guestIP.nips) {<br>
            virReportError(VIR_ERR_CONFIG_<wbr>UNSUPPORTED, "%s",<br>
                           _("Invalid attempt to set network interface "<br>
</blockquote>
<br></span>
Jan<br>
</blockquote></div><br></div></div>