mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
Revert "networkAllocateActualDevice: Set QoS for bridgeless networks too"
This reverts commit2996e6be19and some parts of2636dc8c4d. The former one tried to implement QoS setting on bridgeless networks. However, as discussed upstream [1], the patch is far away from being useful in even a single case. The whole idea of network QoS is to have aggregated limits over several interfaces. This patch is doing completely the opposite when merging two QoS settings (from the network and the domain interface) into one which is then set at the domain interface itself, not the network. The latter one is the test for the previous one. Now none of them makes sense. 1: https://www.redhat.com/archives/libvir-list/2014-January/msg01441.html Conflicts: tests/virnetdevbandwidthtest.c: New test has been introduced since then.
This commit is contained in:
1 parent
7bcbb53e18
commit
122cd16982
5 files changed
+2
-205
No files matched your search
@@ -61,56 +61,6 @@ struct testSetStruct {
|
||||
goto cleanup; \
|
||||
} while (0)
|
||||
|
||||
static int
|
||||
testVirNetDevBandwidthMinimal(const void *data)
|
||||
{
|
||||
int ret = -1;
|
||||
const struct testMinimalStruct *info = data;
|
||||
virNetDevBandwidthPtr expected_result = NULL, result = NULL,
|
||||
band1 = NULL, band2 = NULL;
|
||||
|
||||
|
||||
/* Parse given XMLs */
|
||||
PARSE(info->expected_result, expected_result);
|
||||
PARSE(info->band1, band1);
|
||||
PARSE(info->band2, band2);
|
||||
|
||||
if (virNetDevBandwidthMinimal(&result, band1, band2) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virNetDevBandwidthEqual(expected_result, result)) {
|
||||
virBuffer exp_buf = VIR_BUFFER_INITIALIZER,
|
||||
res_buf = VIR_BUFFER_INITIALIZER;
|
||||
char *exp = NULL, *res = NULL;
|
||||
|
||||
fprintf(stderr, "expected_result != result");
|
||||
|
||||
if (virNetDevBandwidthFormat(expected_result, &exp_buf) < 0 ||
|
||||
virNetDevBandwidthFormat(result, &res_buf) < 0 ||
|
||||
!(exp = virBufferContentAndReset(&exp_buf)) ||
|
||||
!(res = virBufferContentAndReset(&res_buf))) {
|
||||
fprintf(stderr, "Failed to fail");
|
||||
virBufferFreeAndReset(&exp_buf);
|
||||
virBufferFreeAndReset(&res_buf);
|
||||
VIR_FREE(exp);
|
||||
VIR_FREE(res);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virtTestDifference(stderr, exp, res);
|
||||
VIR_FREE(exp);
|
||||
VIR_FREE(res);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virNetDevBandwidthFree(expected_result);
|
||||
virNetDevBandwidthFree(result);
|
||||
virNetDevBandwidthFree(band1);
|
||||
virNetDevBandwidthFree(band2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
testVirNetDevBandwidthSet(const void *data)
|
||||
{
|
||||
@@ -159,15 +109,6 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#define DO_TEST_MINIMAL(r, ...) \
|
||||
do { \
|
||||
struct testMinimalStruct data = {r, __VA_ARGS__}; \
|
||||
if (virtTestRun("virNetDevBandwidthMinimal", \
|
||||
testVirNetDevBandwidthMinimal, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_SET(Band, Exp_cmd, ...) \
|
||||
do { \
|
||||
struct testSetStruct data = {.band = Band, \
|
||||
@@ -180,38 +121,6 @@ mymain(void)
|
||||
} while (0)
|
||||
|
||||
|
||||
DO_TEST_MINIMAL(NULL, NULL, NULL);
|
||||
|
||||
DO_TEST_MINIMAL("<bandwidth>"
|
||||
" <inbound average='1000' peak='5000' burst='5120'/>"
|
||||
" <outbound average='128' peak='256' burst='256'/>"
|
||||
"</bandwidth>",
|
||||
.band1 = "<bandwidth>"
|
||||
" <inbound average='1000' peak='5000' burst='5120'/>"
|
||||
" <outbound average='128' peak='256' burst='256'/>"
|
||||
"</bandwidth>");
|
||||
|
||||
DO_TEST_MINIMAL("<bandwidth>"
|
||||
" <inbound average='1000' peak='5000' burst='5120'/>"
|
||||
" <outbound average='128' peak='256' burst='256'/>"
|
||||
"</bandwidth>",
|
||||
.band2 = "<bandwidth>"
|
||||
" <inbound average='1000' peak='5000' burst='5120'/>"
|
||||
" <outbound average='128' peak='256' burst='256'/>"
|
||||
"</bandwidth>");
|
||||
DO_TEST_MINIMAL("<bandwidth>"
|
||||
" <inbound average='1' peak='2' floor='3' burst='4'/>"
|
||||
" <outbound average='5' peak='6' burst='7'/>"
|
||||
"</bandwidth>",
|
||||
"<bandwidth>"
|
||||
" <inbound average='1' peak='2' burst='4'/>"
|
||||
" <outbound average='0' burst='7'/>"
|
||||
"</bandwidth>",
|
||||
"<bandwidth>"
|
||||
" <inbound average='1' peak='2' floor='3'/>"
|
||||
" <outbound average='5' peak='6'/>"
|
||||
"</bandwidth>");
|
||||
|
||||
DO_TEST_SET(("<bandwidth>"
|
||||
" <inbound average='1' peak='2' floor='3' burst='4'/>"
|
||||
" <outbound average='5' peak='6' burst='7'/>"
|
||||
|
||||
Reference in new issue
Block a user