Skip to content

Commit

Permalink
Merge pull request #69 from antholeole/oleina/vhostuser
Browse files Browse the repository at this point in the history
added configuration for domain.devices.interface vhostuser
  • Loading branch information
AshleyYakeley authored Oct 20, 2024
2 parents 853427e + 2fd943f commit bd12164
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 3 deletions.
13 changes: 13 additions & 0 deletions checks/domain/issues/expected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@
<cpu>
<model>test</model>
</cpu>
<devices>
<interface type='vhostuser'>
<source mode='client' type='unix' path='/tmp/vhost.sock'>
<reconnect enabled='yes' timeout='10'/>
</source>
</interface>
<interface type='network'>
<driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'>
<host gso='off' mrg_rxbuf='off' csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
<guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
</interface>
</devices>
</domain>
46 changes: 44 additions & 2 deletions checks/domain/issues/input.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
{ ... }:
{
{ ... }: {
name = "issues";
cpu.model.name = "test"; # ISSUE #66
devices.interface = [
{
type = "vhostuser";
source = {
type = "unix";
path = "/tmp/vhost.sock";
mode = "client";
reconnect = {
enabled = true;
timeout = 10;
};
};
}
{
type = "network";
driver = {
name = "vhost";
txmode = "iothread";
mode = "client";
ioeventfd = true;
event_idx = false;
queues = 5;
rx_queue_size = 256;
tx_queue_size = 256;
host = {
csum = false;
gso = false;
tso4 = false;
tso6 = false;
ecn = false;
ufo = false;
mrg_rxbuf = false;
};
guest = {
csum = false;
tso4 = false;
tso6 = false;
ecn = false;
ufo = false;
};
};
}
];
}
37 changes: 36 additions & 1 deletion generate-xml/domain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,49 @@ let
(subattr "trustGuestRxFilters" typeBoolYesNo)
]
[
(subelem "driver" [
(subattr "name" typeString)
(subattr "txmode" typeString)
(subattr "ioeventfd" typeBoolOnOff)
(subattr "event_idx" typeBoolOnOff)
(subattr "queues" typeInt)
(subattr "rx_queue_size" typeInt)
(subattr "tx_queue_size" typeInt)
]
(
let
nicOpts = [
(subattr "csum" typeBoolOnOff)
(subattr "tso4" typeBoolOnOff)
(subattr "tso6" typeBoolOnOff)
(subattr "ecn" typeBoolOnOff)
(subattr "ufo" typeBoolOnOff)
];

nicHostOpts = [
(subattr "gso" typeBoolOnOff)
(subattr "mrg_rxbuf" typeBoolOnOff)
];
in
[
(subelem "host" (nicHostOpts ++ nicOpts) [ ])
(subelem "guest" nicOpts [ ])
]
))
(subelem "mac" [ (subattr "address" typeString) ] [ ])
(subelem "source"
[
(subattr "bridge" typeString)
(subattr "dev" typeString)
(subattr "mode" typeString)
(subattr "network" typeString)
] [ addresselem ])
(subattr "type" typeString)
# this typically points to a socket (/tmp/my.sock), so don't use typePath, which only allows in-store elements.
(subattr "path" typeString)
] [
addresselem
(subelem "reconnect" [ (subattr "enabled" typeBoolYesNo) (subattr "timeout" typeInt) ] [ ])
])
(subelem "model" [ (subattr "type" typeString) ] [ ])
targetelem
addresselem
Expand Down

0 comments on commit bd12164

Please sign in to comment.