Skip to content

Commit

Permalink
Fix crash if <redirdev> has no <address>
Browse files Browse the repository at this point in the history
Old existing domain definitions may have `<redirdev>` elements without
any `<address>` child. It's impossible to actually create these with
current libvirt, as `virsh import`ing such a definition will
automatically add an address -- so we can't create a test for this.

Fixes #1307
  • Loading branch information
martinpitt authored and jelly committed Jan 8, 2024
1 parent 7793ee2 commit 331c757
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libvirt-xml-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ export function parseDumpxmlForRedirectedDevices(devicesElem) {
type: redirdevElem.getAttribute('type'),
bootOrder: bootElem?.getAttribute('order'),
address: {
type: addressElem.getAttribute('type'),
bus: addressElem.getAttribute('bus'),
port: addressElem.getAttribute('port'),
type: addressElem?.getAttribute('type'),
bus: addressElem?.getAttribute('bus'),
port: addressElem?.getAttribute('port'),
},
source: {
mode: sourceElem?.getAttribute('mode'),
Expand Down

0 comments on commit 331c757

Please sign in to comment.